• 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

Toranks

Active member
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:

frame bla/bla/bla.gif
@cmd lockscreen
frame bla/bla/bla.gif
frame bla/bla/bla.gif
frame bla/bla/bla.gif
frame bla/bla/bla.gif
@cmd unlockscreen
frame bla/bla/bla.gif
 
@Toranks

sometimes i have had to search using google , the search function here has problems if a word is too short.

try something like "locksscreen" site:chronocrash.com

anyway, what is it that you would like to lock the screen during animation, is it to lock the scrolling?
is it pause on an elevator stage?

if its the elevator thing, believe it or not the wait command ina level.txt freezes everything and after the wait it continues....
even tho the manual says otherwise
 
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,

To make sure I understand, you want to lock the screen at the start of an animation and then unlock it in the same animation?

DC
 
I usually use scrollx to replace wait cause the former allows scrolling back a bit while not being able to progress forward.

If you're using scripted camera, you could tell the camera to stop for a while until you're done.
But anyways, I've found 2 openborvariants called "scrollmaxx" and "scrollminx" which you could modify with script for this purpose.

because I have no way to get the original scrollspeed value to restore it later

Well, from my experience I almost never change scrollspeed in a game (not just a level) so it shouldn't be too hard to pick a value to restore later. So if you usually use scrollspeed 5, then restore scrollspeed to 5 when you want to reallow scrolling.
 
I wrote a simple inline script to check the theory inside of a player animation.

@script
if(frame==1){
changelevelproperty("scrollspeed", 0);
}
if(frame==5){
changelevelproperty("scrollspeed", 3);
}
@end_script

I set my stages default scroll speed to 3. If no one writes a better @cmd script I'll do it when I have more time.

writing with mobile phone so I apologise if there's any typo's.
 
The problem with scrollspeed is that I have different values at different stages and it is necessary by design. I also use scrollx a lot. I'll see if I can take advantage of scrollmaxx and scrollminx.
 
different scroll speeds at different parts of the stage? so you need something that can check the previous scroll speed before it stopped?
 
different scroll speeds at different parts of the stage? so you need something that can check the previous scroll speed before it stopped?
Different scrollspeed in different stages, although sometimes it changes within the same stage. I already investigated and there is no way to get the current scrollspeed value to save and restore it.
 
The only way I could think around it is....

The animation checks the current scroll speed and then plays another animation (same animation but different freespecial) which ends in the previous checked scrollspeed after being stopped, in theory.
 
The problem with scrollspeed is that I have different values at different stages and it is necessary by design. I also use scrollx a lot. I'll see if I can take advantage of scrollmaxx and scrollminx.
you can store the initial scrollspeed on a variable and get its value later.

I use the same method that @danno posted above and you can change it on the fly if you want too. And you don't even need to create a new entity for that, as you can use it right on the level text, adding the code to any entity you may have already:


spawn Linda
@script void main() {
changelevelproperty("scrollspeed", 3);
} @end_script
map 0
coords 620 199 0
at 0

See at 8:40 - the stage scroll speed just changes when I reach a certain X position:

 
different scroll speeds at different parts of the stage? so you need something that can check the previous scroll speed before it stopped?


The only way I could think around it is....

The animation checks the current scroll speed and then plays another animation (same animation but different freespecial) which ends in the previous checked scrollspeed after being stopped, in theory.
he could have a decoration or npc entity spawn at the beginning of the stage, this entity has no gravity , always stays at the center of the screen, and it checks stage coordinates , if using inline scripts the looped animation has to be fast to the centisecond when certain coordinates are found it changes animation and this new animation constantly checks for the next set of coordinates, scroll speed changes, no need to store previous speeds, bacause the entity controls all the speeds the stage is going to use.

if a speed needs to match the previous stage speed, just take the last value the previous stage entity used.

then only thing that would require a true scrollspeed check is if Torank's characters somehow atually affected the scrollspeed of a stage, then it would make sense to have something check scrollspeed and react dynamically.

I undesrtand @O Ilusionista MAY have made a more advanced method of dynamically changing a stage's lights (in order to alter the how the shadows are cast)
kind of like what i did on the Aztec stage , where character shadows match the elongation and angle of the stage's pre-rendered shadows.

a better version of this allows for the shadows to change if you scroll back and forth, and maybe O ilusionista managed this.

Anyway same thing , whatever method accomplishes the light change in the way i described, can also affect scrollspeed....
 
Anyway same thing , whatever method accomplishes the light change in the way i described, can also affect scrollspeed....
Not in this case: I've changed the stage light/shadow using a native function on the stage:

light -200 80
at 750

light -100 80
at 800

light 0 80
at 850

light 100 80
at 900

light 200 80
at 950

As you move on the stage, the shadow angle will shift accordingly. I just added different values at different positions to make it smoother.

But you can change the scrollspeed using the trick above:

spawn Linda
@script void main() {
changelevelproperty("scrollspeed", 3);
} @end_script
map 0
coords 620 199 0
at 0

But you have a point: it would be cool to be able to change the scrollspeed as easy as we can for the light.
On the next build, many things are open to script - and maybe all stage properties too.
 
On the next build, many things are open to script - and maybe all stage properties too.

Not yet unfortunately, but it will be ASAP in subsequent releases, and those will come much faster since I'm going back to a more incremental model. Level property access was one of the things I had to cut to avoid another delay. :(

DC
 
Not in this case: I've changed the stage light/shadow using a native function on the stage:


As you move on the stage, the shadow angle will shift accordingly. I just added different values at different positions to make it smoother.
GaaHH!!

blast, i thought you had made a better scripted method.

if im not mistaken, the native method we used can only work one way, if we scroll back the light will not change.

that is why either we go with a granular animation script or entity like the stuff in the stages on rocket viper to control those type of stage propertie changes within their animations, or a screen locked/follower "coordinate detector" that will do those changes.....
 
I've been researching your suggestions, but they didn't work for me, since my camera lock belongs to the freespecial of one of the characters, not to any entity or property on the maps, and adding a separate entity on all maps, or saving a variable on every map and every scrollspeed change (and there is A LOT) is not a feasible option. However, while I was reading about cameraoffset that said DC, which I still don't quite understand what it means, I came across this:

1701046179872.png
DC said above that obtaining the properties was still a pending issue for the next version, so where does this come from? getlevelproperty is exclusive to some version? @Kratus ? This can solve my entire problem

There is one thing I didn't understand, which @danno said above:

"The animation checks the current scroll speed and then plays another animation"

Check the current scroll speed... How?
 
getlevelproperty is exclusive to some version? @Kratus ? This can solve my entire problem
in fact, you can read it, but the result is always zero (dunno if this were changed later).

saving a variable on every map and every scrollspeed change
Why? And you don't need to record EVERY scrollspeed, just the first one.

You just need to paste few lines of code on the very first entity you have on the stage:

spawn Linda
@script void main() {
void bgSpeed;
setglobalvar("bgSpeed","x");

} @end_script
map 0
coords 620 199 0
at 0

Replace "x" by the scroll speed of your stage, like:
setglobalvar("bgSpeed","3");

Whenever you need to retrieve it, you just need to access it:

int speed = getglobalvar("bgSpeed");

I advice you to clean this variable inside the endlevel.c script
 
I have already mentioned it, the scrollspeed is different not only in each stage, but ALSO in some stages it changes dynamically. It's a pretty exhaustive job for such a big game. I'd prefer to use another method if possible, although ultimately if nothing works I'll have to do that.
 
Back
Top Bottom