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

Animated screens - the easy way.

Merso, in my case, rain animation is very tall so I had to move the axis. Have you tried with any other entity?
By thw way, you need to KNOW the entity in models.txt first.
 
O Ilusionista said:
Merso, in my case, rain animation is very tall so I had to move the axis. Have you tried with any other entity?
By thw way, you need to KNOW the entity in models.txt first.

Thank you for replying so quick. I have tried with two different entities, that work fine somewhere else in the game (so they're properly listed in models.txt, as "know"). I have also twaked the spawn coords to 0,0,0, and then back to how they're posted on this thread.
Right now the game doesn't even load. The program closes right after the OpenBor screen.
 
O Ilusionista said:
Do you have ALWAYSUPDATE 1 in scriots.txt?

Yes. Well, the file is called "script.txt" in singular. Just in case, I went ahead and created a duplicate of the file, and named it "scripts.txt", in plural. Still crashes.
 
Merso, look at this:
void main(){
  if(getglobalvar("zoomentity"))
  {
      zoom();     
  }
}

void main(){
if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
  {  counter = setlocalvar("counter",0);
}

      if(openborvariant("in_selectscreen")) // Check if the game is in select screen
  { 

      void counter= getlocalvar("counter");  // Set a variable to trigger the spawn on and off
      while(counter!=1) // Check the variable to avoid double spawn
      {
        void subent;
        loadmodel("fadeoutwhite"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
        setspawnentry("name", "fadeoutwhite"); // define the entity to be spawn
        setspawnentry("coords", 50,50,0); // set the position of the entity
        subent=spawn();  //  spawn the entity
        changeentityproperty(subent, "position", 50,50,0); //for safe, set again the position
        counter = setlocalvar("counter",1); // turn on the variable, blocking a new spawn to be made
        }
  }

}

You have two mains in this script. You need to use just one main and merge them into this:
Code:
void main(){
if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
   {   counter = setlocalvar("counter",0);
}

      if(openborvariant("in_selectscreen")) // Check if the game is in select screen
   {   
 
      void counter= getlocalvar("counter");  // Set a variable to trigger the spawn on and off
      while(counter!=1) // Check the variable to avoid double spawn
      {
         void subent;
         loadmodel("fadeoutwhite"); // name of the entity to be loaded
         clearspawnentry(); // clean the spawn entry
         setspawnentry("name", "fadeoutwhite"); // define the entity to be spawn
         setspawnentry("coords", 50,50,0); // set the position of the entity
         subent=spawn();  //  spawn the entity
         changeentityproperty(subent, "position", 50,50,0); //for safe, set again the position
         counter = setlocalvar("counter",1); // turn on the variable, blocking a new spawn to be made
         }
   }

   if(getglobalvar("zoomentity"))
   {
      zoom();       
   }
}
 
Thank you Bloodbane for cleaning up my script. It's still not working for me but I very much appreciate the effort.
 
Ummm... there's another error message somewhere above that line, try finding it and post it here

OTOH I've tried replicating this bug but there's no crash and at same time, nothing is spawned in select screen either  ???
 
I modified it and this works, ill check your update in a second :)
Code:
void main(){
    void counter= getlocalvar("counter");  // Set a variable to trigger the spawn on and off
if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
  {    counter = setlocalvar("counter",0); }
if((openborvariant("in_titlescreen")) &&(counter!=1)) // Check the variable to avoid double spawn
		{	void subent;
			loadmodel("fi"); // name of the entity to be loaded
                      clearspawnentry(); // clean the spawn entry
			setspawnentry("name", "fi"); // define the entity to be spawn
			setspawnentry("coords", 450,450,0); // set the position of the entity
			subent=spawn();  //  spawn the entity
			changeentityproperty(subent, "position", 450,450,0); //for safe, set again the position
	counter = setlocalvar("counter",1); // turn on the variable, blocking a new spawn to be made
}

}

Ok basically quite similar, thanks, works great ! :)
 
Just watch out for the position. And if you are using it for a animated background, you will need to force the direction and the layer constantly, or sometimes the engine will display it in front of everything.

This is my bgfx
name bgfx
health 1
type panel
speed 10
shadow 0
setlayer -2000
facing 1

And at the idle animation, I force the layer and direction
anim idle
loop 1 1 9
offset 1 1
delay 3
subentity cover
summonframe 0 0 0 0 1
@cmd changeentityproperty getlocalvar("self") "direction" 1
frame data/chars/misc/bgfx/bg1.gif
@cmd changeentityproperty getlocalvar("self") "setlayer" -2000
frame data/chars/misc/bgfx/bg2.gif
frame data/chars/misc/bgfx/bg3.gif
frame data/chars/misc/bgfx/bg4.gif
frame data/chars/misc/bgfx/bg5.gif
frame data/chars/misc/bgfx/bg6.gif
frame data/chars/misc/bgfx/bg7.gif
frame data/chars/misc/bgfx/bg8.gif
frame data/chars/misc/bgfx/bg1.gif

See that the setlayer is placed INSIDE the loop.  If you don't do this, sometimes, the entity will be displayed in front of everything on next time you enter on the select screen.
 
I will try this method based in your demo, thanks for sharing :)

Is there any way to animate a screen transition between the title screen to the char select screen?...Scriptless?
 
Mr.Q! said:
I will try this method based in your demo, thanks for sharing :)
The version I posted here is simpler to follow, thought.

Is there any way to animate a screen transition between the title screen to the char select screen?...Scriptless?
Scriptless? Hum...from title to select I think yes, but not the other direction, But the scripted version gives you way more control.

 
O Ilusionista said:
Script solutions

I just can't learn script, like, at all, and belive me I've tried  ;D I would need something like a teacher who stands right next to me and start telling me from the very 1st step, so I just copy others' scripts and I work from there.
 
Back
Top Bottom