• 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.

Lock/unlock screen between some frames

I found this by chance, searching on Google. It is curious that there was support at one time and it must have been lost.

r3357 | utunnels | 2011-07-25 09:44:13 -0400 (Mon, 25 Jul 2011) | 1 line
Changed paths:
M /engine/openborscript.c

Add scrollspeed to getlevelproperty.
 
It's a pretty exhaustive job for such a big game. I'd prefer to use another method if possible
But this method will work almost like accessing the levelproperty scrollspeed...
but ALSO in some stages it changes dynamically.
.... then you add a SINGLE LINE on your script to track it in every change you made

setglobalvar("bgSpeed","x");

Seriously, its just one extra line.

frame bla/bla/bla.gif
@cmd changelevelproperty "bgspeed" 3
@cmd setglobalvar "bgSpeed" 3
frame bla/bla/bla.gif
frame bla/bla/bla.gif
frame bla/bla/bla.gif
frame bla/bla/bla.gif
 
Change scrollspeed 0 doesn't work for me because I have no way to get the original scrollspeed value to restore it later. I've been searching the forum but can't find it, although I know there is a simple script for it. Can anyone tell me which one it is?

I need something as:
@Toranks

I don't know exactly if this is the effect you want but I posted the concept I'm using in the SORX, locking the level scrolling by freezing the xpos variant mainly when the cops are called by players.

This code must be placed in the character's update entity event or directly in the updated.c file.
C:
void main()
{
    if(getglobalvar("xposLock") != NULL()){
        changeopenborvariant("xpos", getglobalvar("xposLock"));
    }
}

This code must be placed in the character's animation event and called in the desired animations.
C:
void xposLock(int lock)
{
    if(lock == 1){
        setglobalvar("xposLock", openborvariant("xpos"));
    }
    else
    {
        setglobalvar("xposLock", NULL());
    }
}

And this is how I used in the video, 0 to unlock and 1 to lock.
C:
anim attack1
    fastattack 1
    jugglecost 4
    forcedirection -1
    otg 1
    loop    0
    delay    4
    offset    62 125
    bbox    50 55 23 74
    @cmd hitfx "data/sounds/sor3_hit.wav"
    @cmd sound "data/sounds/sor3_attack.wav"
    @cmd xposLock 0
    #attack 62 61 9999 999 2000 1 1 0 5 999 #DEBUG TEST
    frame    data/chars/heroes/axel/a100.png
    attack 62 61 42 13 2 0 0 0 5 12
    frame    data/chars/heroes/axel/a101.png
    attack 0 0 0 0 0 0 0 0 0 0
    frame    data/chars/heroes/axel/a100.png
    
anim jumpforward #JUMP FORWARD
    fastattack 1
    jugglecost 4
    forcedirection -1
    otg 1
    loop    0
    delay    8
    offset    62 125
    bbox    54 52 25 45
    @cmd hitfx "data/sounds/sor3_hit2.wav"
    @cmd sound "data/sounds/sor3_attack.wav"
    @cmd xposLock 1
    frame    data/chars/heroes/axel/fjumpatk00.png
    attack 52 75 57 27 4 1 0 0 20 12
    bbox    43 52 25 45
    @cmd voice "data/voices/sor3_axel_attack.wav"
    frame    data/chars/heroes/axel/fjumpatk01.png

Here's an example:
 
I don't know exactly if this is the effect you want but I posted the concept I'm using in the SORX, locking the level scrolling by freezing the xpos variant mainly when the cops are called by players.
Nice. Reading the manual, it features a ypos too, so maybe this code could be changed to lock in the y position too?

  • "ypos", - Level coords in y position, count from the top of panels.
 
Nice. Reading the manual, it features a ypos too, so maybe this code could be changed to lock in the y position too?
Yes it works, I'm using the same concept for ypos in the Super Mario template, I was planning to lock/unlock for some high platforms.
 
¡¡Exactly that!! In fact, my freespecial is very similar to the call to cops freespecial (attacking all enemies on screen).
I'm going to try to put it into practice and let you know how it went.
Many thanks!
 
Back
Top Bottom