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

For this tutorial, we use script.txt, not script.c. And you should need to put it under the DATA folder.
And no, it doesn't need main or anything like that.
Understood, thanks alot.
For now, I am just going through your tutorial index list one by one to see which one I can use in my new game. I will start working on it in November or so.
 
Understood, thanks alot.
For now, I am just going through your tutorial index list one by one to see which one I can use in my new game. I will start working on it in November or so.
I just started applying this script to my updated.c for the title screen animation, but somehow it keeps on adding an entity on the screen everytime the engine goes from the intro to the title screen.
Is there something missing such as killentity with globalvar?
I added the globalvar for spawned entity and kill it with the killentity function, and it seemed to prevent from the addition.

Thank you
 
I added the globalvar for spawned entity and kill it with the killentity function, and it seemed to prevent from the addition.
You don't need a globalvar for that. This is handled by this loop:

C-like:
if(openborvariant("in_titlescreen"))
    {  
        void counter = getlocalvar("counter");
        counter = setlocalvar("counter",0);
    }
 
You don't need a globalvar for that. This is handled by this loop:

C-like:
if(openborvariant("in_titlescreen"))
    {
        void counter = getlocalvar("counter");
        counter = setlocalvar("counter",0);
    }
What I meant was
I want the spawned entity to disappear completely in the intro, then reappears whenever the engine is back to the title screen again.
Basically, it disappears when the engine runs the intro.txt, then appears during the title screen, and repeat..
I had this in the intro script, but this code does not killentity I don't think, basically the spawned entity is still in the memory.

Code:
        void counter = getlocalvar("counter");

        counter = setlocalvar("counter",0);

BTW, is there a way to detect the player currently in the options menu?
I had this but it does not detect it for some reasons,
Code:
openborvariant("in_options")

Thank you
 
I want the spawned entity to disappear completely in the intro, then reappears whenever the engine is back to the title screen again.
Then you have to change the code - this code is spawning an entity on the select screen, not in the title screen.

Here is an update version I am using on my MMPR project - I have different entities for TITLE and SELECT screen:
 
Then you have to change the code - this code is spawning an entity on the select screen, not in the title screen.

Here is an update version I am using on my MMPR project - I have different entities for TITLE and SELECT screen:
I had this code in the title screen:
Code:
    {   
 
        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
            }

    }

and this code in the intro and menu screens:
Code:
        void counter = getlocalvar("counter");
        counter = setlocalvar("counter",0);

It kept on adding 1 entity to the title screen everytime the engine switches from title screen to the intro screen then back to the title screen.
Basically, there would be 5 entities on the title screen after it switches back and forth 5 times.
I had to add the globalvar and killentity to stop it from happening.

isn't this function clearspawnentry(); supposed to kill the previous spawned entity?
I don't know why it is not working for me.

Thank you
 
Back
Top Bottom