Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Fußabdrücke im Spiel

  • #10, by dionous 8 years ago Zitieren
    that's a fantastic example indeed!
  • #11, by esmeralda 8 years ago Zitieren
    Thank you for the demo SimonS! It's great!
    It took me some time to understand the setting of the emission count (didn't realise you can leftclick to create another node), but now I got it working in a test-project.
  • #12, by afrlme 8 years ago Zitieren
    Cheers for that Simon. Was really interesting to see. The particle system is really alien to me. Not really needed to use it so far, so I haven't spent much time figuring it out.

    Anyway, thanks again for the example. Both the particle system example & script will surely be useful as reference to a lot of people; & not just for creating footsteps.
  • #13, by Machtnix 8 years ago Zitieren
    Is it only possible with R 5?
  • #14, by SimonS 8 years ago Zitieren
    V5 only.
  • #15, by Machtnix 8 years ago Zitieren
    Why? Because the features aren't available in 4.2.5? I didn't try particles very often (only for snow of dandelions and some laser beams - it seems not very userfriendly to me), but setting the emitter to a position should be possible with Lua in 4.2.5? I can't use R5.

    Edit: all functions you need are available in 4.2.5 (emitter position, particle direction from point), but remarked as not scriptable. I don't know what happens if I will edit them, I think it's on my own risk... wink
  • #16, by SimonS 8 years ago Zitieren
    The particle system in V5 and V4 are not the same, V5 has a complete rework with much more possibilities.
  • #17, by sebastian 8 years ago Zitieren
    Very nice script. 
    I tried to put a character on fire (still named footstep). 
    It works also well. But it seems that i cant control the y-coordinate of the object to let the fire particle render above the character (y+1) but also always behind objects the character is standing behind.

    function particleLoop()
      local p = graphics.getParticles(game.CurrentScene.Objects.footstep)
      local c = game.CurrentCharacter
      local dir = (game.CurrentCharacter.Direction - 90) / 180 * 3.1415
      game.CurrentScene.Objects.footstep.Center = game.CurrentCharacter.Position.y +1
      p.rotation = {0.0, dir, 0.0, dir}
      p.center = {c.Position.x, c.Position.y}
      p.size = {0.0, c.Size*0.5, 0.0, c.Size*0.5}
      print(game.CurrentScene.Objects.footstep.Center)
    end
    
    registerEventHandler("mainLoop", "particleLoop") 

    (rotation is still in it, but not necceccary for my fire...thats what the emitter will handle by itself)

    The console logs that the object center is updated, but the particles stay always on the same initial layer which is set at the objects center number. So it seems that the NEW emitted particles dont get affected by the Y-setting

    any ideas?

  • #18, by Alex 8 years ago Zitieren
    The scene objects are drawn in the same order as they appear in the scene object list. The y-coordinate is only used to determine if the character is drawn in front or behind the object. I don't think it's currently possible to change the order of the object.
  • #19, by sebastian 8 years ago Zitieren
    it seems that when i also add an object image, that the particles get shown in front or behind the character basing on the image y location. so maybe itll update properly when i move (also) the whole object and use a transparent image... 
  • #20, by afrlme 8 years ago Zitieren
    I'm not 100% sure, but if you offset the object it should also adjust the object center value with it. Start object position at 0, 0 then you can have it offset to the current characters position or whatever you want.