Moving Platforms Up/Down

Dr. Scorpio

Member
This account is temporarily muted.
Hey what's up guys? I have been using platforms quiet a bit now and I was wondering how I could make platforms go up and down automatically?
 
I've actually done this in one of my mods(with help). Here's the txt file:
Code:
name	TBP4
type	none
shadow	0
alpha   0
remove  0
setlayer 1
offscreenkill 5000
antigravity 100

anim idle
@script
    void self = getlocalvar("self");

    if(frame==0||frame==2){
      changeentityproperty(self, "velocity", 0, 0, 0);
    }
    if(frame==1){
      changeentityproperty(self, "velocity", 0, 0, -5);
    }
    if(frame==3){
      changeentityproperty(self, "velocity", 0, 0, 5);
    }
@end_script
    delay     180
    loop      1
    offset    0 0
    drawmethod  256  256  1  0  0  -1  -1
    platform  89  22  -90  -90  39  39  26  1
    frame     data/bgs/TBase/TBP3.gif
    delay     22
    frame     data/bgs/TBase/TBP3.gif
    delay     180
    frame     data/bgs/TBase/TBP3.gif
    delay     22
    frame     data/bgs/TBase/TBP3.gif

I should also mention I had to make these zip up and down rather then a slower pace, as it made my characters constantly loose their footing, making it harder if you wanted to move while it was going down.

x)
 
Liu Kang's suggestion is correct except that don't use seta and set subject_to_gravity 0 instead for better flexibility.

I myself use script to move platform up and down.

Though there would be problems with entities standing on top of moving platform:
1. When platform moves down, entities would fall instead of 'glued' to platform. This will trigger their WALKOFF animation, if they have any
2. When platform moves up, entities would be forced to go up and could trigger their DUCK animation, if they have any

Those 2 are the reasons I didn't have platforms moving up and down in Contra mod.
If you can tolerate those problems, then you're good to make these platforms :)
 
Back
Top Bottom