Need help regarding View scripting

Started by Nero_Ace, Mon 15/04/2013 13:26:54

Previous topic - Next topic

Nero_Ace

I recently started work on a side-scrolling adventure game. There's this one thing I wanna know if it's possible or not.

I don't want to have any walking animations in the game. So any time the main character clicks on a hot-spot to move to a new area, I want the editor to do the following in order -

1) Move him to a location near where the hot spot is.
2) Change his sprite to a different one, for 1.5 seconds.
3) Transition to a different area while returning his sprite to the default one.

Please let me know if this is even possible or if I should just stick to walking animations.
If possible, please elaborate on how I can implement it.

Any help or feedback would be much appreciated. I can provide more detail also if you believe it's necessary.

selmiak

yes, this is possible,
1)give the character no animation frames in the view and then just use the walk command from the tutorials to move him there when the hotspot is clicked. he moves with only one single frame shown, like a spaceship or so.
2)to change the sprite you need another view with this sprite and then call cCharacter.ChangeView(#); and Wait(60); for the 1,5 seconds (at 40fps)
you could also animate the character with the second view and set the delay there, but I prefer the wait command as you can then change everything in the script without having to open the view window.
3) do you mean teleportation, instant movement to a specfic location with transition? just use the cCharacter.x = numericalvalueofroomcoordinates; and cCharacter.y = #; for this. If you mean something else with transition please explain.

Nero_Ace

Thank you for the quick reply.

For point 2, wouldn't that make the character crawl to the point? I need something like a teleportation so that the character instantly moves there and then shifts to the different view.
For 3, apologies, instead of area, i meant to say room. So that when you use the ChangeRoom command, it returns to the default view.

selmiak

then use the  cCharacter.x = 123; for 2).

for 3) just change the room like you always do and in the room_Load() of the new room change the view again.

Nero_Ace

Okay, I got it working. Problem solved.
Much obliged for the information and help.

SMF spam blocked by CleanTalk