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

Mr.Q! said:
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.

It's easier than it sounds. But you need to pay attention and always try to force yourself to learn more and more.
There are different level of coders. To be a coder is easy - to be a GOOD coder is another thing.

There will be always people better than you, but you must try.
Here is a starting guide to script http://www.chronocrash.com/forum/index.php?topic=3519
 
Ok, i want to try this in my WIP mod, so I downloaded your demo, then:

-copy the misc/bgfx folder into my WIP mod, same folder route
-load the stuff in that folder in models.txt
-copy/paste your demo "updated.c" script into my script folder

Is that all? am I missing sth?
 
copy/paste your demo "updated.c" script into my script folder
I highly don't suggest you to do that. There are a lot of codes on that file that are tied to my mod.
Copy the code I've pasted at the first post and save it as updated.c

And
"You need to set ALWAYSUPDATE 1 in scripts.txt."
 
O Ilusionista said:
copy/paste your demo "updated.c" script into my script folder
I highly don't suggest you to do that. There are a lot of codes on that file that are tied to my mod.
Copy the code I've pasted at the first post and save it as updated.c

And
"You need to set ALWAYSUPDATE 1 in scripts.txt."

Just did everything I mentioned, also copied the code at the 1st post as updated.c like you suggested, and I get Failed to parse script file: 'data/scripts/updated.c'! ?

EDIT: If I copy your updated.c from your demo, instead of just using the code in the 1st post, it works, lol
 
Which build are you using? This works only after a certain build.
The code I posted here is the same of my mod, just removed what is tied to my mod.

BwwD had posted the version he is using on the previous page, take a look.
 
Here. I tested on your mod and it works

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("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
}

}
The version above works for the title screen, instead of the select screen.

This works for the select screen:
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_selectscreen")) &&(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
}

}
 
Copied this last code you just posted for select screen and it works :D will try the title screen one later when I come up with something for it heh
 
I've updated the first post. I've tested on a new mod and it works :)

Code:
void main(){

if(openborvariant("in_titlescreen"))
	{	
		void counter = getlocalvar("counter"); 
		counter = setlocalvar("counter",0);
	}
	
if(openborvariant("in_selectscreen"))
	{	
  
		void counter = getlocalvar("counter"); 
		void vSpawn;
		while(counter!=1)
		{
			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
			}

	}
}
 
Is it just me, or is it limited to something around 10 frames in the bgfx txt? whenever I try to put something like 15 frames, just the first 10 are showing
 
It's not me, just tried & verified, it only loads until the 9th frame.

EDIT: It did, but it was your bgfx animation info, "loop 1 1 9"...
I never had used more that one single digit for loops in anims! this is crazy.


Tried the in titlescreen one, but nothing happens.

 
"loop 1 1 9"...
I never had used more that one single digit for loops in anims! this is crazy.

See, it was you :) joking aside, those extra numbers are the loop frame start and loop frame end. Its on the manual and in OpenBorstats for quite long time.
 
In case you didn't know about the loop with last 2 digits:

loop {bi} {start} {end}

  • ~Determines how loop effect is applied in current animation
  • ~{bi} toggles looping on or off.
    • 0 = looping off
    • 1 = looping on
  • ~{start} determines the number of frame the animation loops to. Defaults to 0 or 1st frame.
  • ~{end} determines the number of frame which starts the loop. If left blank, the animation will loop at the end of animation.
  • ~Some animations should NOT be set to loop (loop temporary at least). Examples include most attacks and injured animations.
 
To further explain the two digits:

Code:
loop 1 1 9
frame 0
frame 1
frame 2
frame 3
frame 4
frame 5
frame 6
frame 7
frame 8


{start} Starts in the any frame you want. On my exemple above, it will start in the frame 1 (because I have a code in the first frame which I don't want to be looped).
{end} Ends in the frame you specific but, opposite of all other settings in OpenBOR, you should use the frame count and not the frame number. On the example bellow, we have 9 frames.
If you want the loop reach the end, you should not use "loop 1 1 8" but "loop 1 1 9". If you use OpenBORstats, you can use the number it display bellow the frame in the animation editor.
In other words, it tells that the loop will end in the frame you set, so the loop will be valid until the frame before.

Here is my code:
anim idle
loop 1 1 9
offset 1 1
delay 3
@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

Notice that I have script in the first frame (frame 0 - bg1.gif) that I don't need to make the engine to execute it in each loop. But in the second frame (bg2.gif), I have a code that I DO need to be executed in each loop (because the engine will ignore this in the second time the entity is spawned). Now see the last frame - its the same sprite of the frame 0 (bg1.gif), to make the loop smooth.

If you set the wrong loop frame, you can have weird results specially when you have a LANDFRAME. Take a look at Spiderwoman's shock animation (I will omit the scripts to make it easier to undestand):

anim shock
loop 1 1 5
landframe 5

delay 3
offset 240 217
frame data/chars/spider-woman/hit08.gif
drawmethod tintmode 2
drawmethod tintcolor 0_0_0
sound data/sounds/shock.wav
frame data/chars/spider-woman/hit08.gif
nodrawmethod
frame data/chars/spider-woman/hit08.gif
drawmethod tintmode 1
drawmethod tintcolor 255_255_255
frame data/chars/spider-woman/hit08.gif
nodrawmethod
frame data/chars/spider-woman/hit08.gif
delay 10
frame data/chars/spider-woman/hit10.gif
frame data/chars/spider-woman/hit11b.gif

Notice that I have a loop in the middle of the animation and I am using a landframe. She waves her hair while in the air, looping the animation, and ends when she touches the ground.
The loop end should be the same frame of landframe.

I hope this is easy to understand.

Tried the in titlescreen one, but nothing happens.
The code for menu and title are different. If you want to use a different entity for title and menu screens, you would need to customize the code.
If you are trying to learn scripts, my suggest is - try to understand the script and not just copy and paste. This will help you to build your own scripts later.
 
O Ilusionista said:
Loop digits & Title screen code

Hmmm I see! there was a script to do that for loops, I'm glad it's actually somethig built on the engine by now. About the code, I tried giving a different entity to work with, and also the same one I used for the char select screen, it was just for experimental purposes, but nothing happened, I mean it didn't get the same result like the char select screen, it was just the regular title screen and nothing else. I was expecting to see the same effects only to know it works so I could make a new one.
 
and also the same one I used for the char select screen, it was just for experimental purposes, but nothing happened

Check the entity position, mine is located at 0 position, because my axis (on that entity) is located at the top left
Code:
	changeentityproperty(subent, "position", 1,0,-1); //for safe, set again the position

If you want to make sure its working, make it play a sound into the loop. You should hear it if is working.
 
Sure:

Code:
name	bgfx2
health	10
type	panel
speed   5
shadow  0
setlayer -2000
facing  1

anim	idle
	loop	1
	offset	1 1
	delay	70
	@cmd	changeentityproperty getlocalvar("self") "direction" 1
	sound   data/sounds/dragonf.wav
	frame	data/chars/misc/bgfx2/bg01.gif
	delay	15
	@cmd	changeentityproperty getlocalvar("self") "setlayer" -2000
	frame	data/chars/misc/bgfx2/bg02.gif
	frame	data/chars/misc/bgfx2/bg03.gif
	delay	70
	frame	data/chars/misc/bgfx2/bg04.gif
	delay	15
	frame	data/chars/misc/bgfx2/bg03.gif
	frame	data/chars/misc/bgfx2/bg02.gif

I'm using the bgfx of yours as a template.

 
Back
Top Bottom