Animated Title & Powerups

Bloodbane

Well-known member
TBH I'm using Map demo which I already used to show multiple stuffs before to show these animated title and powerups
Here's the download link: Map Demo

For simplicity, animated title only animates the red orbs. I could use different method to animate the orbs but I used this one to make it easier to duplicate in other mods  8)

Just like Map demo, don't forget to read playing notes to find other features this demo has
Oh speaking of which, you can find powerup items in training room and in certain levels in map mode. I'm sure you can figure out what each powerup does  ;)
 
It would be cool if you actually explains what happens and how people can customize it. Its not everyone who understand such type of scripts (I got it, but there are some people who won't).

I have two points to share:

1- instead of
if(openborvariant("in_selectscreen")==1)

Just use
if(openborvariant("in_selectscreen"))
Because the second version is a boolean check, and its reads faster by most coding language, as far as I know.

2- If you use your code at UPDATE.c and not UPDATED.c, when you see the credits screen after closing the engine, the animation will appear also on credit screen. This is a common issue of codes in update.c and this is why I use my update codes at updated.c, to prevent this.

Or check for the openborvariant "in_enginecreditsscreen", it was added some builds ago.
 
Bloodbane said:
TBH I'm using Map demo which I already used to show multiple stuffs before to show these animated title and powerups
Here's the download link: Map Demo

For simplicity, animated title only animates the red orbs. I could use different method to animate the orbs but I used this one to make it easier to duplicate in other mods  8)

Just like Map demo, don't forget to read playing notes to find other features this demo has
Oh speaking of which, you can find powerup items in training room and in certain levels in map mode. I'm sure you can figure out what each powerup does  ;)

Looks fantastic. Thanks for sharing.
 
Thanks for the tip Ilu, recently, OpenBoR closes right away so I almost never see the credits. But I'll try moving the code to updated.c to see if it still works ;)

if you actually explains what happens and how people can customize it. Its not everyone who understand such type of scripts

I'll wait until they ask cause couple details are tough to explain
 
Alright, I've updated this demo. Aside of moving animated title script to updated.c, I also added script set to reduce player's health if they fall to hole instead of losing life
There's a level called bridge to test that script in world map

Here's the link: https://www.mediafire.com/?86oggo8r91g23va

There are more features, you can read Playing Notes (included) for features list
 
Hi sorry to resurect this topic but I tried to use the Animated Title screen to loading screen (Map9demo).
Here is my update.c:
Code:
void main()
{//
    if(openborvariant("in_menuscreen")==1){
      setglobalvar("F1", NULL());
      setglobalvar("F2", NULL());
      setglobalvar("F3", NULL());
      setglobalvar("F4", NULL());
      setglobalvar("Kalah1", NULL());
      setglobalvar("Kalah2", NULL());
      setglobalvar("Kalah3", NULL());
      setglobalvar("Noma", NULL());
    } else if(openborvariant("in_level")==1){
      int K1 = getglobalvar("Kalah1");
      int K2 = getglobalvar("Kalah2");
      int K3 = getglobalvar("Kalah3");

//      drawstring(100,100,8, K1);
//      drawstring(100,120,9, K2);
//      drawstring(100,140,3, K3);
    }
}

void oncreate()
{
    setindexedvar(1, 0);

    void Loading1; void Loading2; void Loading3; void Loading4; void Loading5; 
    
    Loading1 = loadsprite("data/bgs/Loading1.gif");
    Loading2 = loadsprite("data/bgs/Loading2.gif");
    Loading3 = loadsprite("data/bgs/Loading3.gif");
    Loading4 = loadsprite("data/bgs/Loading4.gif");
    Loading5 = loadsprite("data/bgs/Loading5.gif");

    setglobalvar("Loading1", Loading1);
    setglobalvar("Loading2", Loading2);
    setglobalvar("Loading3", Loading3);
    setglobalvar("Loading4", Loading4);
    setglobalvar("Loading5", Loading5);
}

void ondestroy(){
    void Loading1 = getglobalvar("Loading1");
    void Loading2 = getglobalvar("Loading2");
    void Loading3 = getglobalvar("Loading3");
    void Loading4 = getglobalvar("Loading4");
    void Loading5 = getglobalvar("Loading5");

    free(Loading1);
    free(Loading2);
    free(Loading3);
    free(Loading4);
    free(Loading5);

    setglobalvar("Loading1", NULL());
    setglobalvar("Loading2", NULL());
    setglobalvar("Loading3", NULL());
    setglobalvar("Loading4", NULL());
    setglobalvar("Loading5", NULL());
}
and the loading.c:
Code:
void main(){
    int Shown = getindexedvar(0);

      if(Play == 1){
        setindexedvar(1, Play+1);
	(openborvariant("in_load_game")==1
      int TC = getglobalvar("TC");
      int Time = getglobalvar("Time");
      void Loading1 = getglobalvar("loading1");
      void Loading2 = getglobalvar("loading2");
      void Loading3 = getglobalvar("loading3");
      void Loading4 = getglobalvar("loading4");
      void Loading5 = getglobalvar("loading5");
      void Gambar;

      if(Time == NULL() || Time >= 40){ // 20 centiseconds
        Time = 0;

        if(TC == NULL() || TC > 6){
          TC = 1;
        }

        if(TC == 1){
          Gambar = Loading1;
        } else if(TC == 2){
          Gambar = Loading2;
        } else if(TC == 3){
          Gambar = Loading3;
        } else if(TC == 4){
          Gambar = Loading4;
        } else if(TC == 5){
          Gambar = Loading5;
        }
        setglobalvar("TC", TC + 1);
      }

      drawsprite(Gambar, 0, 0, -2500);
      setglobalvar("Time", Time+1);
    }
}
Here is the result I attempted to reach in loading screen:
15zo6wz.gif

Can anyone tell me what are my errors (I'm a beginner with scripting :) )?
 
Ah, something I forgot to tell you on the PM:
Loading screen doesn't have a constant update rate (depends of how much things are been loaded at the same time) and maybe you will have hickups.

You can try to use an entity too, but you would need to first load it before anything else.
 
O Ilusionista: Thanks for teaching me the bases of the scripts routine. Can you show me how can I call an entity (I suppose I must put him an idle anim) in the loading screen?
 
The way to call an entity for the select screen (which can changed to other screens) is here http://www.chronocrash.com/forum/index.php?topic=3137.0
To call it on loading screen, you would need to use the code into loading.c and it [/i]should[/i] work, but I never tried to make it.
 
Bloodbane said:
Alright, I've updated this demo. Aside of moving animated title script to updated.c, I also added script set to reduce player's health if they fall to hole instead of losing life
There's a level called bridge to test that script in world map

Here's the link: https://www.mediafire.com/?86oggo8r91g23va

There are more features, you can read Playing Notes (included) for features list

Hi Bloodbane , could you assist me please? I have tried your jeblos.c and jeblosA.c scripts a few times over the years but I can't quite make them work. I can avoid losing lives when falling through a hole,, but my char always comes back at full health no matter what I do.

Just in case, this is how I call the scripts in the char file:

Code:
onmoveascript	data/scripts/jeblosA.c 
ondeathscript	data/scripts/jeblos.c
 
Sure :)

I can avoid losing lives when falling through a hole,, but my char always comes back at full health no matter what I do.

Hmmm... the survive from falling to hole script system involves some scripts. First are the two scripts you've quoted above. Then there's endlevel.c which resets global variable used in the system.
endlevel.c
Code:
void main()
{
    setglobalvar("0HPs", NULL());
    setglobalvar("1HPs", NULL());
    setglobalvar("2HPs", NULL());
    setglobalvar("3HPs", NULL());
}

There are other lines in endlevel.c but only those which are relevant
And there's script in player's SPAWN animation:
Code:
anim spawn
@script
 if(frame == 1){
   void self = getlocalvar("self");
   int PIndex = getentityproperty(self,"playerindex");
   int HPs = getglobalvar(PIndex+"HPs");

   if(HPs!=NULL()){
     changeentityproperty(self, "health", HPs);
     setglobalvar(PIndex+"HPs", NULL());
   }
 }
@end_script
...

This is the script which sets correct starting health after falling to hole

Do you have the last two scripts i.e endlevel.c and the one in SPAWN animation?
 
Bloodbane said:
Sure :)

I can avoid losing lives when falling through a hole,, but my char always comes back at full health no matter what I do.

Hmmm... the survive from falling to hole script system involves some scripts. First are the two scripts you've quoted above. Then there's endlevel.c which resets global variable used in the system.
endlevel.c
Code:
void main()
{
    setglobalvar("0HPs", NULL());
    setglobalvar("1HPs", NULL());
    setglobalvar("2HPs", NULL());
    setglobalvar("3HPs", NULL());
}

There are other lines in endlevel.c but only those which are relevant
And there's script in player's SPAWN animation:
Code:
anim spawn
@script
 if(frame == 1){
   void self = getlocalvar("self");
   int PIndex = getentityproperty(self,"playerindex");
   int HPs = getglobalvar(PIndex+"HPs");

   if(HPs!=NULL()){
     changeentityproperty(self, "health", HPs);
     setglobalvar(PIndex+"HPs", NULL());
   }
 }
@end_script
...

This is the script which sets correct starting health after falling to hole

Do you have the last two scripts i.e endlevel.c and the one in SPAWN animation?

Dude, thank you so much! I hadn't noticed that I had to update the spawn anims and update.c. Now it works perfectly!!!

Hey, do you know if I can also use update.c to solve my issue of the engine granting credits to players after they game over?
 
You're welcome :D

do you know if I can also use update.c to solve my issue of the engine granting credits to players after they game over?

I never heard of that bug before  ???
 
Bloodbane said:
You're welcome :D

do you know if I can also use update.c to solve my issue of the engine granting credits to players after they game over?

I never heard of that bug before  ???

Sorry, I should have specified. I discussed this issue in another thread: http://www.chronocrash.com/forum/index.php?topic=4297.0

This is what I explained there:

Short version: Game allows players to continue/join the game again even after losing all credits. This is a problem.

Long version: I want to disable continues in my game. In levels.txt, I am providing 1 credit:
Quote
lives 7
credits 1
noshare 1
But after getting a Game Over, players can press start and reappear in the next level, even when they have no credits left! How can I prevent this?

The issue comes up only in multiplayer (as far as I know), in two different ways:

CASE 1
* Player dies during level and HUD shows "game over". They can't respawn at this stage.
* Next stage is the map screen. Defeated player still can't join back in, even when this is a level in which players can join
* Next comes character selection screen, and in here defeated player CAN return, will all his lifes restored.

So, in "normal" gameplay, players can return only in char selection screen (select.txt)

CASE 2:
* Loading a saved game. Players that were defeated before saving, can join anytime even in map level.
So, in loaded savestated, players can join in any stage that doesn't have nojoin 1.

What the heck?
To reiterate, I want to prevent defeated players from return at any moment. No continues :)

So maybe I could use endlevel.c to return all active players credits to 0?
 
Back
Top Bottom