select screen question

Gurtag said:
hey ppl, is there a way to spawn decoration on select screen? like torchs for example?
Hi Gurtag!
Some time ago I got this script in the forum and I don't remember what is the autor, but will share it with you.
This script will spawn any entity you want in select screen, need to be used in updated.c

Code:
if(openborvariant("in_titlescreen")){
	clearlocalvar();
}

if(openborvariant("in_selectscreen")){
//Spawn Select Screen background

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

I use "clearlocalvar" to reset the variable "selectCounter" but if you have other scripts that can't be reseted, you can exchange it by "setlocalvar("selectCounter", 0)"
 
thanks a lot for all the help guys, sorry my ignorance but what is updated.c? i only have script.c with only a few spawn01 functions in it, should i create the updated.c file and past that script in it Kratus? after that past it on select.txt?
 
Gurtag said:
thanks a lot for all the help guys, sorry my ignorance but what is updated.c? i only have script.c with only a few spawn01 functions in it, should i create the updated.c file and past that script in it Kratus? after that past it on select.txt?

No problem my friend Gurtag, I will help you:

- Create a file called "updated.c" and paste all script in this file;
Code:
void main()
{
	if(openborvariant("in_titlescreen")){
		clearlocalvar();
	}

	if(openborvariant("in_selectscreen")){
	//Spawn Select Screen background

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

- Create an entity that will be spawned in the select screen (like your torches). Add this entity in models.txt, I prefer to use "load" instead of "know" because I need this entity a lot of times, but it is up to you. If you use "know", need to add the command "loadmodel(entity)" before the "spawn()" command;

- Check if you have the file "script.txt" in the "data" folder. If don't have it, create and paste the command "alwaysupdate 1". This is necessary to work with updated.c file;

- From this point, the rest of the process depends on the entity that will be spawned. If the engine crashes during the select screen, don't forget to check the logs to see where the problem is;

I hope it helps!  ;)
 
Some time ago I got this script in the forum and I don't remember what is the autor
It was me :) I've written a full tutorial here http://www.chronocrash.com/forum/index.php?topic=3137.0
You can use it for spawn animations in any screen with that method.

hey ppl, is there a way to spawn decoration on select screen? like torchs for example?
You can either use the tutorial above, or you can simply spawn it inside the characters wait animation using custentity or subent.
There is a lock on the engine code, so you will only able to spawn an entity either using custentity/subent or either using a code in udpated.c, because scripts won't work on select screen.
 
O Ilusionista said:
Some time ago I got this script in the forum and I don't remember what is the autor
It was me :) I've written a full tutorial here http://www.chronocrash.com/forum/index.php?topic=3137.0
You can use it for spawn animations in any screen with that method.
Yes, now I remember! Is exactly in this post that I've learned how to make animated background in select screen. It's a fantastic job O Ilusionista. Thanks!!
 
thanks guys, tryed several times but no luck so far, followed all the steps i belive, created de updated.c file, pasted the script in it with the entity name i want to spawn and set the coords, put the alwaysupdate 1 line on scripts.txt on data folder, even tryed several script vercions from ilu´s tutorial tread and also tried with otter entities but cant get them to spawn for some reason, i also added sound on entity anim to know if they spawned out of position but 0, nothing, any idea of what could i be doing wrong?
 
Gurtag said:
thanks guys, tryed several times but no luck so far, followed all the steps i belive, created de updated.c file, pasted the script in it with the entity name i want to spawn and set the coords, put the alwaysupdate 1 line on scripts.txt on data folder, even tryed several script vercions from ilu´s tutorial tread and also tried with otter entities but cant get them to spawn for some reason, i also added sound on entity anim to know if they spawned out of position but 0, nothing, any idea of what could i be doing wrong?
What is happening in the game? Is crashing and closing or the entity is not spawned? I think that the only mistake is about the name of "scripts.txt" file, the correct name is "script.txt", don't have the letter "s" in the end.
 
Kratus said:
the name of "scripts.txt" file, the correct name is "script.txt", don't have the letter "s" in the end

::) that was it, my bad, i made select.gif all transparent but cant see the entity yet, tough i do hear the sound so it is there somewhere lol, will keep trying coord till it shows it´s ugly face  ;D
 
Gurtag said:
Kratus said:
the name of "scripts.txt" file, the correct name is "script.txt", don't have the letter "s" in the end

::) that was it, my bad, i made select.gif all transparent but cant see the entity yet, tough i do hear the sound so it is there somewhere lol, will keep trying coord till it shows it´s ugly face  ;D
Nice! Now, a little help to see if the "coords" are wrong, if you are using a resolution lower than 960x540 set the "video" option to 6 in the file "video.txt" and you can see where the entity is. After adjust the correct "coords", back the video option to your default resolution
 
thanks man, glad you like it, btw is posible to spawn otter/diferent entities for a second or more select screns? i have 3 selectscreen.txt files and would like to customize them diferently if it were posible.
 
Back
Top Bottom