Floating Platforms that go up and down

Dr. Scorpio

Member
Hey guys,

I had floating platforms in my Castlevania mod working but now that I switched over to a newer engine, they stopped working.
I don't understand why or how to get them to work again. This is how I made my floating platforms. I'm using [v.3.0 Build 4426] now, I was using
OpenBOR v3.0 Build.


Code:
name        MegaPlat
type        none
facing          1
antigravity    100
setlayer 1

subject_to_hole 0
subject_to_obstacle 0
subject_to_platform 0
subject_to_gravity 0
subject_to_minz 0
subject_to_maxz 0



anim idle
    
loop 1
  delay    30
    offset    16 13
    platform    16 13 -20 -20 20 20 10 10
    frame    data/chars/misc/bossplat.gif
    delay    30
    offset    16 23
    platform    16 23 -20 -20 20 20 10 20
    frame    data/chars/misc/bossplat.gif
    delay    30
    offset    16 33
    platform    16 33 -20 -20 20 20 10 30
    frame    data/chars/misc/bossplat.gif
    offset    16 43
    platform    16 43 -20 -20 20 20 10 40
    frame    data/chars/misc/bossplat.gif
#delay    30
#offset    16 43
   # platform    16 43 -20 -20 20 20 10 40
   #frame    data/chars/misc/bossplat.gif
    delay    20
    offset    16 33
    platform    16 33 -20 -20 20 20 10 30
    frame    data/chars/misc/bossplat.gif
    delay    20
    offset    16 23
    platform    16 23 -20 -20 20 20 10 20
    frame    data/chars/misc/bossplat.gif
    offset    16 13
    platform    16 13 -20 -20 20 20 10 10
    frame    data/chars/misc/bossplat.gif
 
@Dr. Scorpio

i suggest you use either the jumpframe command,
(but i think this only moves the entity once per animation) or a script

@Bloodbane or @danno,
are there any examples of Jumpframe alternatives to have entities move multiple times within the same animation?

anyway, using jumpframe or a script (it should allow you to do up and down motions with jumpframe type accuracy) will result in a more smooth motion and you don't have to declare the platform parameters so many times.
 
using just jumpframe only, you can program the idle animation to switch to an anispecial that contains the up-ward motion jumpframe, and the animation can switch you back to idle for tha downward motion...
 
Looks like you are changing the offset and changing the platform settings, right? I really don't advice you to make this way - it's way more work.
You can use move, or can simply change the velocity (by either using a function or inline script)

This is one of my platforms (it uses inline script):

anim idle
offset 47 242
loop 1
@script
void self = getlocalvar("self");
if(frame == 0){
changeentityproperty(self, "velocity", 0,0, -0.1);
}
if(frame == 1){
changeentityproperty(self, "velocity", 0,0, -0.15);
}
if(frame == 2){
changeentityproperty(self, "velocity", 0,0, -0.1);
}
if(frame == 3){
changeentityproperty(self, "velocity", 0, 0, 0);
}
if(frame == 4){
changeentityproperty(self, "velocity", 0,0, 0.1);
}
if(frame == 5){
changeentityproperty(self, "velocity", 0,0, 0.15);
}
if(frame == 6){
changeentityproperty(self, "velocity", 0,0, 0.1);
}
if(frame == 7){
changeentityproperty(self, "velocity", 0, 0, 0);
}
@end_script
delay 40
platform 5 255 -5 -4 86 86 20 2
frame data/Bgs/platform/platform_xmen.gif
frame data/Bgs/platform/platform_xmen.gif
frame data/Bgs/platform/platform_xmen.gif
delay 120
frame data/Bgs/platform/platform_xmen.gif
delay 40
frame data/Bgs/platform/platform_xmen.gif
frame data/Bgs/platform/platform_xmen.gif
frame data/Bgs/platform/platform_xmen.gif
delay 120
frame data/Bgs/platform/platform_xmen.gif
 
Looks like you are changing the offset and changing the platform settings, right? I really don't advice you to make this way - it's way more work.
You can use move, or can simply change the velocity (by either using a function or inline script)

This is one of my platforms (it uses inline script):
It worked! Thank you! I can see how I can adjust them to make them higher. Yes using the offset was a lot of work!
 
I can see how I can adjust them to make them higher.
I am glad it worked :)
The easiest way to make them to go higher is raising the delay value (where you see 40, try something higher).
Just keep in mind that the you need to use the same value (and frame counting) to go up and down (or at least change the values to make them even), so the platform will go up and return to its position.

by the way, if instead of changing the last value you change the first one, the platform will move horizontally, like this:

changeentityproperty(self, "velocity", -0.15, 0,0);
 
I am glad it worked :)
The easiest way to make them to go higher is raising the delay value (where you see 40, try something higher).
Just keep in mind that the you need to use the same value (and frame counting) to go up and down (or at least change the values to make them even), so the platform will go up and return to its position.

by the way, if instead of changing the last value you change the first one, the platform will move horizontally, like this:
I love it! Thank you! I have some floating plats that have a delay before they appear, it's perfect for hiding power up! This helped me out a lot!
 
Back
Top Bottom