scenario problem

jiam

Member
what is the best way to make this scenario?

the platform rises to the end and stops at the door.

[attachment deleted by admin]
 
I think just make the direction up with a slower speed, make a shaker during stops (optional. Just a illusion, since the level is stone based, so it's not smooth). You need to figure out where it stops (for example, the lighting fixtures are good places for a background) finally stopping at the area near the door. Figure out the exact time you need to trigger a stop.

Final Fight Gold does this on the elevator scene, each time the elevator goes, nothing happens, but once it stops, the enemies get out and fight, this is because when there are enemies, it won't stop and keep scrolling until the enemies present are terminated.

But that's one way of tackling it. I hope others would respond.  :)
 
For this, I prefer to use script to 'animate' the background. In detail, an entity showing this background image has offset set at top of this image. It's spawned on high altitude which also requires this entity to be unaffected by gravity
A global variable is used to control that entity's movement. That entity sets is velocity based on value set on that variable

I hope you're using latest build cause it's easier to set that variable just by declaring script in level directly instead of using entities

That's the general idea
I'm going to attempt this myself later ;)
 
Well, I've tried this myself and it works well :D (see attached shots below)
However, it turns out the gates above aren't low enough OR the ceiling isn't high enough causing background (black backgorund that is) to be shown, see 0007 below

Oh for example, here's the entity for the 'scrolling backgorund':

name ElevBack
type none
setlayer -10
antigravity 100


anim idle
@script
  void self = getlocalvar("self");
  int Vy = getindexedvar(0);

  changeentityproperty(self, "velocity", 0, 0, Vy);
@end_script
loop 1
delay 1
offset 192 0
frame data/bgs/elevator/elevator.png
frame data/bgs/elevator/elevator.png

Oh yes, I chose to use indexed variable for this purpose :)
Now, you need to use delay entity to control the movement of this entity. Here's example on how to set it in a level:

spawn ElevBack # the background to move
flip 1
coords 192 240 2500
at 0

spawn delay
health 20 # wait for 2 seconds before moving
coords 160 240
at 0

group 1 1
at 0

spawn delay
@script
void main()
{
      setindexedvar(0, -1); // background move with -1 pixels / centiseconds speed
}
@end_script
health 110 # move for 11 seconds
coords 160 240
at 0

spawn delay
@script
void main()
{
      setindexedvar(0, 0); // stop the background
}
@end_script
health 20 # 2 seconds wait
coords 160 240
at 0

# these groups are for controlling spawned enemies
group 3 3 # example
at 0

# spawned enemies here

group 1 1
at 0

spawn delay
health 20
coords 160 240
at 0

You will need to repeat this couple times + modify how long and how fast background moves for your need until you reach the top

HTH

[attachment deleted by admin]
 
Bloodbane said:
However, it turns out the gates above aren't low enough OR the ceiling isn't high enough causing background (black backgorund that is) to be shown

Nothing that a good image editor can't fix. But either way, this sounds like a better idea, considering the bugginess of direction in screwing up saves. I'd recommend it to anyone who is bothered with the classic direction bug.
 
I forgot to post that the used indexed variable should be cleared with endlevel.c to avoid latest value being used in next level

Anyways, since scrolling background entity takes velocity value directly, you can surprise player by doing something like elevator moves up (with some enemies spawn in between) then just before gate is reached, it moves down and boss appears ;)

I'd recommend it to anyone who is bothered with the classic direction bug.

I must remind you that this method is for single trip: after the background reaches the top part, you can't move it down again
If you want to make continuous scrolling, you need different method

Oh almost forget since the movement relies on delay time set by delay entity, you will need a more precise timing. Here it is:

name    delay
health 10
type    enemy
nomove  1
antigravity 100
offscreenkill 3000


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

    if(frame==1){
      changeentityproperty(self, "health", Health-1);
      if(Health <= 0){
        killentity(self);
      }
    }
@end_script
loop 1
delay 9
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
 
Bloodbane said:
I must remind you that this method is for single trip: after the background reaches the top part, you can't move it down again
If you want to make continuous scrolling, you need different method

To tell you, that's the main point of the elevator levels though, they're one way trips. You're right that if you want something more infinite, you may need another method there, but the fact that you can have more possibilities than the standard elevators is something to be excited at.  :)
 
Niiice!  ;D

Liked the stop at the end with the platform and the door opening.

You could place stops there though, just to heighten the suspense, some sparring fights in the mid and a boss fight or something in the end. Overall nice implementation!
 
Nice! so you're making Willow :)

I agree with the Dude that you should place some stops before elevator reaches the doors. To do that you need to break down elevator movement to couple steps. For instance, let's say that background needs to move down with -1 pixel per centisecond for 20 seconds so door will reach the platform

You can break it to 4 stops by having background moves down 5 seconds, stop, spawn enemies, then move again.

Oh yes, as I mentioned before you can modify velocity so if you think -1 pixel per centisecond is too fast, you can reduce it but don't forget to adjust the time as well
Let's say that background needs to move down with -1 pixel per centisecond for 20 seconds so door will reach the platform. You can slow it to -0.5 pixel per centisecond and the required will be doubled i.e 40 seconds

It's okay to use Flyman though I must remind you that it's tough subboss alone. If you want 'softer' enemies with similar AI, use MulanaBats instead.
 
Back
Top Bottom