How would you do smoke ? [SOLVED]

Started by Candle, Mon 17/01/2005 07:28:50

Previous topic - Next topic

Candle

At one point in the game you will need to hold some straw that is smoking to run some bees off . and I have no clue how to do the smoke .

Scorpiorus

There is a Fire plugin you can use to simulate smoke/fire easily: http://www.adventuregamestudio.co.uk/games.php?action=detail&id=424

Alternatively, you can just create an animation loop and use that.

Candle

You don't know if there is a template that would show it in use ?
That way  I can see how the code works in use  ..

Necro

I would of thought the easiest way to animate some smoke if just by getting the stack of straw and animating it , use a white/light grey colour with a low opacity , then use a bit of smudging too , tak e a look at my avatar <--

Scorpiorus

As for using the plugin, you should import two sprite files that come along with the plugin: the seed sprite and the palette sprite.

Then on player enters screen (after fade-in):

FireAddObject(object, seedSprite, paletteSprite);

where:
object - room object number
seedSprite - seed sprite number
paletteSprite - palette sprite number

and on room repeatedly execute

FireUpdate();

See a plugin html help file for more functions.

To make a smoke you need to draw your own palette sprite.

Skeller53

#5
I understand how one would make a "smoke" animation, but I'm not certain how one would make the smoke animation appear at the right location in relation to the straw that the character would be holding. I know you could just make an animation including both straw and smoke, but is it possible to make a separate and independent smoke object that would appear and animate at a certain location relative to the straw object (i.e. always at the end of the straw object no matter where the straw object was on the screen)?

I hope it's OK to ask this here. Sorry if you think it should be a different topic.

Scorpiorus

This can be a tricky one.

One of the possibilities is to create a SMOKE object/character and change its position within "repeatedly execute" (i.e. each game loop):

repeatedly execute:

SetObjectPosition(SMOKE, player.x + offsetX, player.y + offsetY);

The problem here is that you have to set offsetX/offsetY depending on the player character's current walking frame.


Another way, to create a SMOKE character and make it following the player character (using the FOLLOW_EXACTLY mode):

FollowCharacterEx (SMOKE, GetPlayerCharacter(), FOLLOW_EXACTLY, 1);

You then, of course, have to set up a smoke view accordingly to the player character's walking one.

Candle

I just went with a fire on the ground  and have the straw on the fire make the smoke .

Skeller53

I may try that out, Scorpiorus, but as I suspected it sounds like it would be easier to just create the animation of the straw with smoke, and then change the straw to that animation whenever the guy picked it up.

Thanks, Sorpiorus. Good luck, Candle.

SMF spam blocked by CleanTalk