 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Karies

Joined: 03 Dec 2009 Posts: 1
|
Posted: Thu Dec 03, 2009 11:00 pm Post subject: Making npc animations |
|
|
Hi everybody!
I want to know how to animate npc. I want an npc typing on the computer while the hero(the user) is walking around or something. But when the hero is near the npc, the npc will stand up and next he will walk to another place.
I need to program the npc action frame by frame on plotscript?...
then when the hero is near him I place the regular npc and I make him to walk?
Is somebody have an example?
thx |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Fri Dec 04, 2009 5:27 am Post subject: |
|
|
You can create a typing "walkabout", and set the NPC to "walk in place".
That way, the NPC will ambiently animate (typing) as the hero is walking around.
By placing a step-on NPC, you can trigger the NPC's departure.
The step-on NPC would start a plotscript that changes the walkabout sprite of the NPC, and then walks the NPC wherever you like.
You might also want to change the NPC's "walk in place" setting.
Code: |
Plotscript, makeNpcStandAndDoStuff, begin
# Set the NPC to "stand still", "wander" or whatever you prefer
alter NPC ( npc_ID ,NPCstat:move type,NPCmovetype:standstill)
# Change the typing graphic to a walking one
Alter NPC ( npc_ID ,NPCstat:picture, picture number)
# Use these two commands as many times as you need to
# walk the npc wherever he needs to go
walk NPC ( npc_ID , number of tiles, direction (north south east west)
wait for NPC (npc_ID)
end |
If you want the player to be unable to move while the NPC is walking, add "suspend player" to the beginning of the script, and "resume player" to the end. _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Dec 04, 2009 8:25 am Post subject: |
|
|
Hi, welcome!
It's also a common trick to set an NPC's Movetype to Right (or Left) Turns, and surround it with walls. This gives you 4 or 8 frames of animation, but the frames will switch twice as fast as when using Walk In Place. Of course... then you would have to do something about the walls before attempting to walk the NPC (which is really easy actually: write pass block (X, Y, 0)).
You could even use an animated tile.
You'll need to make sure the script is only triggered once. If you're using invisible stepon NPCs, just make the NPC one time use. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|