• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.

Solved Elevator stages going down

Question that is answered or resolved.
Is there any way of making elevators look like they're going up? In the more recent versions of openbor the elevators always seem to be going down no matter whether you put "up" or "down" in the folder (this looks very strange on King of Fighters Plus because you start off at the top of the castle where Wolfgang Krauser is waiting and then kind of descend into the depths). I don't want to use an earlier version of openbor because it means a lot of the sprites I use for playable characters go funny colours.
 
Solution
For elevator levels, I never use direction up nor down anymore. I simply modify background's vertical autoscrolling speed with script like this:
Code:
spawn    delay
@script
  void main()
  {
    changelevelproperty("bgspeed", 0);
    changelevelproperty("vbgspeed", 5);
  }
@end_script
health  100
coords    160 190
at    0

spawn    delay
@script
  void main()
  {
    changelevelproperty("bgspeed", 0);
    changelevelproperty("vbgspeed", -5);
  }
@end_script
health  100
coords    160 190
at    0
For elevator levels, I never use direction up nor down anymore. I simply modify background's vertical autoscrolling speed with script like this:
Code:
spawn    delay
@script
  void main()
  {
    changelevelproperty("bgspeed", 0);
    changelevelproperty("vbgspeed", 5);
  }
@end_script
health  100
coords    160 190
at    0

spawn    delay
@script
  void main()
  {
    changelevelproperty("bgspeed", 0);
    changelevelproperty("vbgspeed", -5);
  }
@end_script
health  100
coords    160 190
at    0
 
Solution
thanks @Bloodbane

i did figure out the vaules that enable the scrolling on the new engine in the NSW23 mod.

are there any drawbaks or adjustments that need to be made if this scripted method is implemented?
 
He uses this trick for the delay entity to exist until it vanishes.

Code:
name       delay
health       10
type       enemy
nomove     1 1
stealth      350
antigravity   100
subject_to_wall   0
offscreenkill   3000
nodrop      2
defense    normal9 0 2000


anim idle
@script
    void self = getlocalvar("self");
    int  Health = getentityproperty(self, "health");

    if(frame==1){
      changeentityproperty(self, "health", Health-5);
      if (Health <= 0){
        killentity(self);
      }
    }
@end_script
   loop   1
   delay   49
   offset   1 1
   frame   data/chars/misc/empty.gif
   delay   1
   frame   data/chars/misc/empty.gif

anim spawn
   delay   1
   offset   1 1
   frame   data/chars/misc/empty.gif

If you're asking about the background moving and then stopping, you need to use changelevelproperty with its bgspeed to stop or move.

This one stops the background speed from moving.

Code:
spawn   delay
@script
  void main()
  {
    void Stop = loadsample("data/sounds/bike.wav");
    playsample(Stop, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
    changelevelproperty("bgspeed", 0);
  }
@end_script
health  20
coords 160 190
at 6080
 
He uses this trick for the delay entity to exist until it vanishes.

Code:
name       delay
health       10
type       enemy
nomove     1 1
stealth      350
antigravity   100
subject_to_wall   0
offscreenkill   3000
nodrop      2
defense    normal9 0 2000


anim idle
@script
    void self = getlocalvar("self");
    int  Health = getentityproperty(self, "health");

    if(frame==1){
      changeentityproperty(self, "health", Health-5);
      if (Health <= 0){
        killentity(self);
      }
    }
@end_script
   loop   1
   delay   49
   offset   1 1
   frame   data/chars/misc/empty.gif
   delay   1
   frame   data/chars/misc/empty.gif

anim spawn
   delay   1
   offset   1 1
   frame   data/chars/misc/empty.gif

If you're asking about the background moving and then stopping, you need to use changelevelproperty with its bgspeed to stop or move.

This one stops the background speed from moving.

Code:
spawn   delay
@script
  void main()
  {
    void Stop = loadsample("data/sounds/bike.wav");
    playsample(Stop, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
    changelevelproperty("bgspeed", 0);
  }
@end_script
health  20
coords 160 190
at 6080
Yes, but I’d like to see the settings on that stage .txt
 
Its weird,

have yet to test these scripts, but at least for my initial restorationsof the elevator level in NS
the wait commant would stop the scrolling, then if the enemy entities die, wait is over and elevator (bglayers) start scrolling again.

the only thing that i have to check out is if Bloodbane's script has to also include the weird new values for scroll reversal, but its potential for speeding up the scroll or slowing it down are very useful, in fact by not declaring up or down pretty much allows for a more dinamic level design where you can have an elevator in a section that goes everywhere...
 
Yes, but I’d like to see the settings on that stage .txt
If you have bgspeed or vbgspeed inserted in the level, you can use the level property to change as @Bloodbane gave an example a while ago. I'm not going to show you the whole thing, but just relatable ones.

bglayer data/bgs/subway/back.png 0 0 0 0 0 0 -1 1 1 0 0 0 0 0 1 #bglayer {path} | {xratio} {zratio} | {xposition} {zposition} | {xspacing} {zspacing} | {xrepeat} {zrepeat} | {transparency} {alpha} {watermode} {amplitude} {wavelength} {wavespeed} {bgspeedratio}
bglayer data/bgs/subway/overlay2.png 0 0 0 0 0 0 -1 1 1 5 0 0 0 0 1
bgspeed 15

spawn delay
@script
void main()
{
void Stop = loadsample("data/sounds/bike.wav");
playsample(Stop, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
changelevelproperty("bgspeed", 0);
}
@end_script
health 20
coords 160 190
at 6080

In level for regular background speed from left to right or vice versa.
Code:
bgspeed        15

bgspeed {speed} {dir}

  • Causes the background of the stage to scroll by automatically in horizontal direction.
  • {value} should be a number from 0 to 30 or so. 0 means no movement, 1 means slow movement, and anything above that means faster movement.
  • {dir} controls the direction that the background moves in. 0 means right-to-left, 1 means left-to-right

vbgspeed {speed} {dir}

  • Causes the background of the stage to scroll by automatically in vertical direction.(4287+)
  • {value} should be a number from 0 to 30 or so. 0 means no movement, 1 means slow movement, and anything above that means faster movement.
  • {dir} controls the direction that the background moves in. 0 means up-to-down, 1 means down-to-up
  • use vbgspeed+bgspeed combo for diagonal levels

bglayer {path} {xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha} {watermode} {amplitude} {wavelength} {wavespeed} {bgspeedratio}

background {path} {xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha}


  • These 2 command have same effect which is create a background layer with the image at {path}.
  • The image used must have a width which is a multiple of 4 (ex. 4, 200, 128, not 3, 202, 130).
  • The height could be any size but make sure it matches screen resolution to avoid void background areas.
  • Just like any image used by OpenBoR, background and bglayers must use paletted images. In 8 bit colourdepth (default), it must use same palette as 'background' (see above). In 16/32 bit, it can use different palette
  • Beware though, if bglayers use different palette than background, 'palette' command (see below) won't work
  • The graphic automatically repeats if the stage is longer than the background.
  • Layers are drawn in the order they are defined; currently, up to 100 are supported. However 'background' sets the bottommost layer while 'bglayer' sets layers in front of it.
  • {xratio} and {zratio} determine how fast the layer will scroll; 1 = same scroll speed as panel, 0.5 = same as background, any float value can be used for them. It works also in levels with direction up or down but the layers will autoscroll just like background.
  • {xposition} and {zposition} determine where the top left corner of the first layer will be. {xposition} is measured from left for direction right levels, from right for direction left, from bottom for direction up and from top for direction down levels.
  • {xspacing} and {zspacing} determine how how much blank space there will be between repeated layers. Only works if you set repeating layers (see below).
  • {xrepeat} and {zrepeat} determine how many times the image will repeat. Setting 0 will make layer not drawn at all (it will become palette holder). Setting -1 will make it repeat forever
  • use 1 for {transparency} to have your transparency color not appear. Remember that this is more processor intensive, so don't use it on images that won't benefit from it. And don't use it for 'background' too since it's the bottommost layer. In 16/32 bit mode, pure black color will be used instead.
  • {alpha} will display the image using alpha transparency. It works just like for entities. Possible values are 0 to 6. Don't use it for background too.
  • {watermode} determines water effect. Currently there are 3 modes.
    • 0 = No water effect for this bglayer
    • 1 = Water effect for this bglayer is on
    • 3 = Mode 7 effect
  • {amplitude} determines the amplitude of sine wave for water effect. Only apply if {watermode} is not 3 (see below)
  • {wavelength} determines length of sine wave in pixels. It's repeated since it's sine wave. Only apply if {watermode} is not 3 (see below)
  • {wavespeed} determines the moving speed of sine wave. Only apply if {watermode} is not 3 (see below)
  • When {watermode} is set to 3, the next 3 parameters ( {amplitude} {wavelength} {wavespeed} ) becomes new ones: {beginsize} {endsize} {perspective}
  • {beginsize} and {endsize} defines size multiplier of upper and lower border
respectively. The upper border should be smaller than lower one cause the former is farther

  • {perspective} defines z depth effect it should have
    • 0 = No effect (default)
    • 1 = Perspective & tile
    • 2 = Perspective & stretch
  • {bgspeedratio} determines the moving ratio of this bglayer relative to main background. Defaults to 0 (no movement).

Oh, and I forgot about @Mr.Q!'s Ultimate Double Dragon which has a background that moves and stops like you're in an elevator.
 
I've shown an example elevator in The House. The script above was copied from Lift level there.
In the game, enter The House then go to the right to find the elevator entrance to access the elevator.
Thanks. Yes last night precisely I got into The House V2 and saw the elevator. Btw I have some questions regarding a script on branch in that mod that I sent you through DM :)
 
Oh, and I forgot about @Mr.Q!'s Ultimate Double Dragon which has a background that moves and stops like you're in an elevator.
I have one in my game too (not release yet). It uses the same concept but I use an entity to control it, so I can make it random - some directions has longer delay than others, to make it more dynamic:


Also, the layers always shake, when the elevator stops, in the opposite direction it was moving originally :)
 
@O Ilusionista
that´s the ticket, this is precisely what i was talking about.

the shacking of the panel seems a bit excessive at times tho, is there any way to control the limits of how much up and down motions can go?, and your background layers don't seem to shake, but i wonder if shaking the backgrouns might look bad.

you know, i wonder if Openbor's equivalent of the Deltas in Mugen help the bglayers and fglayers also shake a little less, because it would look a bit jarring if stuff far away shakes at the same rate than the panel...
 
the shacking of the panel seems a bit excessive at times tho, is there any way to control the limits of how much up and down motions can go?
ah, its two different things:
1- The background fake shake I did using velocities
2- The screen quakeframe using a scripted quake

You are talking about the second one (quakeframe), that is something related to my project (I use high values to simulate big impacts), not releated to the original question.

I was talking about the first option - the fake shake. What I do is to make the bgspeed/vbgspeed to change to the oposite direction fast but for a little amount of time, simulating a quake

It looks like this:

anim idle
loop 1
offset 65 79
delay 240
@cmd setvbgspeed 0
frame data/sprites/0empty.gif
delay 10
sound data/sounds/elevator_move.wav
@cmd setvbgspeed 1
frame data/sprites/0empty.gif
@cmd setvbgspeed 2
frame data/sprites/0empty.gif
delay 600
@cmd setvbgspeed 3
frame data/sprites/0empty.gif
delay 2
@cmd setvbgspeed 0
frame data/sprites/0empty.gif
@cmd setvbgspeed -10
frame data/sprites/0empty.gif
@cmd setvbgspeed 0
frame data/sprites/0empty.gif
@cmd setvbgspeed 10
frame data/sprites/0empty.gif
delay 240
@cmd setvbgspeed 0
@cmd setbgrock 0

sound data/sounds/elevator_stop.wav
frame data/sprites/0empty.gif
frame data/sprites/0empty.gif

The more important ones are in yellow - notice that I set the vbgspeed to 3 for 600 ticks, then quickly changed it to 0, -10 and 0 again.
This is what creates the shake feeling :)

I do like to make functions for this type of control, so they are here:

C-like:
void setbgspeed(int fX)
{// Set bg speed
// O Ilusionista - 10/04/2022
    changelevelproperty("bgspeed", fX);
}


void setvbgspeed(int fX)
{// Set bg v speed
// O Ilusionista - 10/04/2022
    changelevelproperty("vbgspeed", fX);
}


void setbgrock(int fX)
{// Set bg rocking
// O Ilusionista - 10/04/2022
    changelevelproperty("rocking", fX);
}

oh and yeah, you can change the "rock" setting too :)
 
@Mr.Q!

when i updated Night Slashers to wide-screen in 2019, i used the old engine the original game was using.

many things stopped functioning correctly when i begun to use Openbor 6391,
like the AI, some wall climb issues, some Bind issues and amongst the bunch
the parameters that allowed the Elevator level´s bglayers to scroll downwards no longer worked in the new engine.

after lots of trial and error i found the values that allow for the correct effect, but it would have been much easier at the time to have used scripts - then again i don't know if the scripts must also take into account then new numbers too...
which where a pain in the ass to figure out.


@O Ilusionista

would it had not been easier for the controlling entity or another hidden entity to just shake everythign with a quake triggering command, and just let the layers do all the work with their default switch/value parameter?

for example , in my elevator shaft restoration, there is an entity at the beginning that thanks to a wait command, has the elevator stuck a the bottom, this entity then damages itself at about 3 seconds, does a death aniamation and it makes a quake effect, shaking the panel/platform entity and at the the same time all the bglayers, after its death elevator moves "up" and at the end of the elevator run another wait will happen with an entity that will spawn and quake everything on its first or 2nd animation frame

Still these scripts are very commendable, because they allow for a variety of controls that simple quake won't do
 
would it had not been easier for the controlling entity or another hidden entity to just shake everythign with a quake triggering command,
No. The default quakeframe is a bit limited (Kratus did a scripted version which works amazing and I helped him to make it to work a like Mugen does).
And we are talking about two different effects - if I use quakframe for that, thanks to the limitation I said above, one effect would nullify the other.

Also, my fake shake works in every direction (vertical, horizontal and even diagonal), while quakeframe dont.
 
Back
Top Bottom