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

the engine isn't crashing so it might be working, but how do you explain the .wav in the animation as an indicator not playing at all ?
 
if you want, send me your mod by pm. I will take a look once I can.
Wait, the code is for the select screen. For title screen is a different code.
And for both is another story.
 
I'm planning to release a new demo in the next few days, i'm getting some last minute stuff done and will include the updated.c so you can have a look
 
thank you for the script ilu, but i have a problem with setlayer in the selectscreen.
the "bgfx" is always displayed in front of my "select screen.gif". (btw, i have one for the title screen and it works perfectly)




i followed your advice and force dierction and setlayer in the loop animation .I tried to put a big negative value on the setlayer, forced on each frame or change the type of entity and still don't work.
here's my bgfx code:
Code:
name	bgfx1
health	1
type	panel
speed 10
shadow 0
setlayer -2000
facing 1

palette none


anim	idle
	loop	1 1   
	offset	0 0
	delay	10
	@cmd	changeentityproperty getlocalvar("self") "direction" 1
	frame	data/bgs/bgfx1/1.gif
@cmd	changeentityproperty getlocalvar("self") "setlayer" -2000
frame	data/bgs/bgfx1/2.gif
frame	data/bgs/bgfx1/3.gif
frame	data/bgs/bgfx1/4.gif
frame	data/bgs/bgfx1/5.gif
frame	data/bgs/bgfx1/6.gif
frame	data/bgs/bgfx1/7.gif
frame	data/bgs/bgfx1/8.gif
frame	data/bgs/bgfx1/9.gif
frame	data/bgs/bgfx1/10.gif
frame	data/bgs/bgfx1/11.gif

if you have advices/ideas, don't hesitate  :P

EDIT: i found another way to get  around this problem.

i included the select screen in the animation, and kept the other "select.gif" for the background and transparency.
not exactly what i wanted, but it should be ok like that  :D
btw, i'm always curious of any other solution.
 
Hello everyone . I'm doing my game and I find it difficult to understand how to put animation on the title screen and character selection.
Could someone upload a demo game to see how to locate the scripts and thus be able to do it?
many thanks friends !!



Hola a todos. Estoy haciendo mi juego y me resulta difícil entender cómo poner la animación en la pantalla de título y la selección de personajes.
¿Podría alguien subir un juego de demostración para ver cómo ubicar los scripts y así poder hacerlo?
muchas gracias amigos !!
 
alemasper: Hi, I use these scripts both in title and select scenes. They are located in data/scripts/updated.c (bgfx2 for title screen and bgfx for select):

Code:
void main(){//MAIN START
   if(getglobalvar("zoomentity"))
   {
      zoom();        
   }
   
void counter= getlocalvar("counter");  // Set a variable to trigger the spawn on and off (title)
void counter2= getlocalvar("counter2");  // Set a variable to trigger the spawn on and off (select)
void counter3= getlocalvar("counter3");  // Set a variable to trigger the spawn on and off (select)
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("bgfx2"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
		setspawnentry("name", "bgfx2"); // define the entity to be spawn
		setspawnentry("coords", 1,0,-1); // set the position of the entity
		subent=spawn();  //  spawn the entity
		changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
		counter = setlocalvar("counter",1); // turn on the variable, blocking a new spawn to be made
	} 

if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
  {counter2 = setlocalvar("counter2",0); }
	if((openborvariant("in_selectscreen")) &&(counter2!=1)) // Check the variable to avoid double spawn
		{void subent;
		loadmodel("bgfx"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
		setspawnentry("name", "bgfx"); // define the entity to be spawn
		setspawnentry("coords", 1,0,-1); // set the position of the entity
		subent=spawn();  //  spawn the entity
		changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
		counter2 = setlocalvar("counter2",1); // turn on the variable, blocking a new spawn to be made
	}	

if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
  {counter3 = setlocalvar("counter3",0); }
	if((openborvariant("in_options")) &&(counter3!=1)) // Check the variable to avoid double spawn
		{void subent;
		loadmodel("options"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
		setspawnentry("name", "options"); // define the entity to be spawn
		setspawnentry("coords", 1,0,-1); // set the position of the entity
		subent=spawn();  //  spawn the entity
		changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
		counter3 = setlocalvar("counter3",1); // turn on the variable, blocking a new spawn to be made
	}	

}// MAIN END

bgfx and bgfx2 are in data/chars/misc/bgfx folder and declared in models.txt. You can see how it works at the demo here:
https://drive.google.com/open?id=1kLs2Q9DgDdmTiuuIopRQme_5gdNuQAcI
I will upload an update of this project in the forum in the following days. Any clue of what kind of project do you prepare? :)
 
Hello !! Thank you very much for your help, friends. great now I will get to work on this animation.
Kimono regarding your question I'm the one developing the game Double Dragon Masters of Sou_Setsu_Ken

https://www.youtube.com/watch?v=qE4KvAmQ2hE



Hola !! Muchas gracias por su ayuda, amigos. genial ahora voy a trabajar en esta animación.
Kimono con respecto a tu pregunta Soy el que desarrolla el juego Double Dragon Masters of Sou_Setsu_Ken


 
kimono said:
alemasper: Hi, I use these scripts both in title and select scenes. They are located in data/scripts/updated.c (bgfx2 for title screen and bgfx for select):

Code:
void main(){//MAIN START
   if(getglobalvar("zoomentity"))
   {
      zoom();        
   }
   
void counter= getlocalvar("counter");  // Set a variable to trigger the spawn on and off (title)
void counter2= getlocalvar("counter2");  // Set a variable to trigger the spawn on and off (select)
void counter3= getlocalvar("counter3");  // Set a variable to trigger the spawn on and off (select)
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("bgfx2"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
		setspawnentry("name", "bgfx2"); // define the entity to be spawn
		setspawnentry("coords", 1,0,-1); // set the position of the entity
		subent=spawn();  //  spawn the entity
		changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
		counter = setlocalvar("counter",1); // turn on the variable, blocking a new spawn to be made
	} 

if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
  {counter2 = setlocalvar("counter2",0); }
	if((openborvariant("in_selectscreen")) &&(counter2!=1)) // Check the variable to avoid double spawn
		{void subent;
		loadmodel("bgfx"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
		setspawnentry("name", "bgfx"); // define the entity to be spawn
		setspawnentry("coords", 1,0,-1); // set the position of the entity
		subent=spawn();  //  spawn the entity
		changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
		counter2 = setlocalvar("counter2",1); // turn on the variable, blocking a new spawn to be made
	}	

if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
  {counter3 = setlocalvar("counter3",0); }
	if((openborvariant("in_options")) &&(counter3!=1)) // Check the variable to avoid double spawn
		{void subent;
		loadmodel("options"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
		setspawnentry("name", "options"); // define the entity to be spawn
		setspawnentry("coords", 1,0,-1); // set the position of the entity
		subent=spawn();  //  spawn the entity
		changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
		counter3 = setlocalvar("counter3",1); // turn on the variable, blocking a new spawn to be made
	}	

}// MAIN END

bgfx and bgfx2 are in data/chars/misc/bgfx folder and declared in models.txt. You can see how it works at the demo here:
https://drive.google.com/open?id=1kLs2Q9DgDdmTiuuIopRQme_5gdNuQAcI
I will upload an update of this project in the forum in the following days. Any clue of what kind of project do you prepare? :)



Hello!
Great work with this!
I have been doing some tests with this and it is very interesting.
What I could never achieve is that "in_menuscreen" works for me.

I even tried this script from kimono, which executes the different screens, so in each one I chose to spawn a different entity.
And the only thing that happens is that the entity "in_titlescreen" also appears in "in_selectscreen".

Here is my complete updated.c:
Code:
#include "data/scripts/AniTitle.c"
#include "data/scripts/story/story_define.h"
#include "data/scripts/story.c"
#include "data/scripts/gettick.c"
#include "data/scripts/playsound.c"




void zoom()
{
   void vscreen = openborvariant("vscreen");
   int maxz=openborvariant("PLAYER_MAX_Z")+1000;
   int zoom_value=getglobalvar("zoomvalue");
   int zoom_x=getglobalvar("zoomx");
   int zoom_y=getglobalvar("zoomy");
   void ent=getglobalvar("zoomentity");
   int px=getentityproperty(ent,"x") +  zoom_x - openborvariant("xpos");
   int py=getentityproperty(ent,"z") + zoom_y - openborvariant("ypos") - getentityproperty(ent,"a");
   void zoom_scr = getglobalvar("zoomscreen");
   if(!zoom_scr){
      zoom_scr = allocscreen(openborvariant("hResolution"),openborvariant("vResolution"));
      setglobalvar("zoomscreen",zoom_scr);
   }
   clearscreen(zoom_scr);

   //draw what we need 
   drawspriteq(zoom_scr,0,openborconstant("MIN_INT"),maxz,0,0);
   //setup drawMethod
   //setdrawmethod(NULL(), 0); // ADDED - Nullify the trail effect
   changedrawmethod(NULL(),"reset",1);
   changedrawmethod(NULL(),"enabled",1);
   changedrawmethod(NULL(),"scalex",zoom_value);
   changedrawmethod(NULL(),"scaley",zoom_value);
   changedrawmethod(NULL(),"centerx",px);
   changedrawmethod(NULL(),"centery",py);
   //Draw the resized customized screen to main screen.
   drawscreen(zoom_scr,px,py, maxz+1);
   changedrawmethod(NULL(),"enabled", 0);
   drawspriteq(vscreen, 0, maxz+1,maxz+1, 0, 0);
   drawspriteq(vscreen, 0, maxz+2,openborconstant("MAX_INT"), 0, 0);
    changedrawmethod(NULL(),"reset",1);
   clearspriteq();
}




void main(){//MAIN START

void counter= getlocalvar("counter");  // Set a variable to trigger the spawn on and off (title)
void counter2= getlocalvar("counter2");  // Set a variable to trigger the spawn on and off (select)
void counter3= getlocalvar("counter3");  // Set a variable to trigger the spawn on and off (select)
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("bgfx2"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
		setspawnentry("name", "bgfx2"); // define the entity to be spawn
		setspawnentry("coords", 1,0,-1); // set the position of the entity
		subent=spawn();  //  spawn the entity
		changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
		counter = setlocalvar("counter",1); // turn on the variable, blocking a new spawn to be made
	}

if(openborvariant("in_titlescreen")) // Check if the game is in menu screen
  {counter2 = setlocalvar("counter2",0); }
	if((openborvariant("in_menuscreen")) &&(counter2!=1)) // Check the variable to avoid double spawn
		{void subent;
		loadmodel("bgfx"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
		setspawnentry("name", "bgfx"); // define the entity to be spawn
		setspawnentry("coords", 1,0,-1); // set the position of the entity
		subent=spawn();  //  spawn the entity
		changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
		counter2 = setlocalvar("counter2",1); // turn on the variable, blocking a new spawn to be made
	}	

if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
  {counter3 = setlocalvar("counter3",0); }
	if((openborvariant("in_options")) &&(counter3!=1)) // Check the variable to avoid double spawn
		{void subent;
		loadmodel("bgfx3"); // name of the entity to be loaded
        clearspawnentry(); // clean the spawn entry
		setspawnentry("name", "bgfx3"); // define the entity to be spawn
		setspawnentry("coords", 1,0,-1); // set the position of the entity
		subent=spawn();  //  spawn the entity
		changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
		counter3 = setlocalvar("counter3",1); // turn on the variable, blocking a new spawn to be made
	}
   if(getglobalvar("zoomentity"))
   {
      zoom();      
   }
      mainLoop();
   processRushCount();
}
// MAIN END


Maybe someone can notice something that I still can't see ...  :-\
 
I finally got it to work for me in "in_menuscreen".

But I found a problem:

If we wait a moment in the menu, when the game returns to the titlescreen, the "bgfx" appears in the titlescreen, when at first it did not appear.

:-\

Code:
void main(){

    void counter= getlocalvar("counter");  // Set a variable to trigger the spawn on and off
if(openborvariant("in_titlescreen")) // Check if the game is in menu screen
  {    counter = setlocalvar("counter",0); }
if((openborvariant("in_menuscreen")) &&(counter!=1)) // Check the variable to avoid double spawn
		{	void subent;
			loadmodel("bgfx"); // name of the entity to be loaded
                      clearspawnentry(); // clean the spawn entry
			setspawnentry("name", "bgfx"); // define the entity to be spawn
			setspawnentry("coords", 240,380,0); // set the position of the entity
			subent=spawn();  //  spawn the entity
			changeentityproperty(subent, "position", 240,380,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();      
   }
   processRushCount();
      mainLoop();
}
 
Love using this. What's funny is that I didn't even see this post and saw your code and reused the code from that. Cool that you actually had it posted in here. I definitely love all the progress you make with the Avenger game. I actually have learned a lot just from your development in this game.
 
Hey everyone,

I had alot of trouble getting both an animated titlescreen and selectscreen..But this worked for me (titlescreen is bgfx, selectscreen is ss2)

void main(){
void counter= getlocalvar("counter"); // Set a variable to trigger the spawn on and off (title)
void counter2= getlocalvar("counter2"); // Set a variable to trigger the spawn on and off (select)
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("bgfx"); // name of the entity to be loaded
clearspawnentry(); // clean the spawn entry
setspawnentry("name", "bgfx"); // define the entity to be spawn
setspawnentry("coords", 1,0,-1); // set the position of the entity
subent=spawn(); // spawn the entity
changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
counter = setlocalvar("counter",1); // turn on the variable, blocking a new spawn to be made
}

if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
{counter2 = setlocalvar("counter2",0); }
if((openborvariant("in_selectscreen")) &&(counter2!=1)) // Check the variable to avoid double spawn
{void subent;
loadmodel("ss2"); // name of the entity to be loaded
clearspawnentry(); // clean the spawn entry
setspawnentry("name", "ss2"); // define the entity to be spawn
setspawnentry("coords", 1,0,-1); // set the position of the entity
subent=spawn(); // spawn the entity
changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position
counter2 = setlocalvar("counter2",1); // turn on the variable, blocking a new spawn to be made
}


}// MAIN END
 
Last edited:
Am I supposed to create a file called "scripts" and type in ALWAYSUPDATE 1 and nothing else inside?
Take a look at the manual OpenBORManual - DCEmulation

How do I load the bgfx at anytime in the certain stage?
Once you load something, it will stay in the memory until you let it go, so there is no need to load it on stages.
If you wanna just display it during a stage, just spawn it like a normal entity.

It works like a normal entity during stages. Only for other cases (like select screen and other screens) you would need script.
 
Back
Top Bottom