If credits= 0 question

PS_VITA

Active member
Hi,
In a vs mode I'm creating I want to exit the vs stage if one of the player dies first.

I tried multiple scripts and the best script I came up was by using if P1 or P2 credits =0 then kill the fake invisible enemy entity that's on the stage so that I can proceed to the next stage or back to the menu.

However does anyone know of a better way or doing this? Is there a less than zero credits (meaning game over) function that I can use?

Is there a proper function to simply exit the stage that I can try.
 
Last edited:
You know for VS mode ⚔️, I'll always recommend using Referee system 🧓. In this system, both fighters are registered and monitored by a referee at all times. After one fighter is defeated, the referee will enforce victory animation the winner, announce the winner and importantly ends current level to go to next level.

Do you need example of this system?
 
Alright, here's link to demo showing what I meant by referee system : Versus module

It's open for updates of course but the basic features I've posted above is there :cool:
@Bloodbane On your vs module for the select animation I noticed you have a script that's pretty cool because it stops the vs mode from starting unless you press start for the second player.

In a game that has a story mode and a vs mode similar to yours, how would you allow for the select animation to allow for a one player experience on the story mode yet retain the vs mode select animation that prevents the vs mode from starting unless P2 confirms?
 
how would you allow for the select animation to allow for a one player experience on the story mode yet retain the vs mode select animation that prevents the vs mode from starting unless P2 confirms?

It's defined in the script and combined with script in player's SELECT animation.
In update.c:
C:
void main()
{//
    if(openborvariant("in_menuscreen")==1){
      setglobalvar("Plays", 0);
      setglobalvar("Win1", 0);
      setglobalvar("Win2", 0);
    } else if(openborvariant("in_selectscreen")){
      void set = openborvariant("current_set");

      if(set==0){
        setglobalvar("Plays", 2);
      } else if(set==1){
        changeplayerproperty(1, "newkeys", 0);
      }
    }
}

set == 0 means 1st level set in levels.txt.
In this if bracket, global variable "Plays" is set to 2. Setting this causes script in player's SELECT screen to loop endlessly until 2nd player joins.

In that update.c, only in set 0 (1st level set) Plays is set to 2, which means other level sets don't require 2 players to start the mode.
So if you want to this effect to applied to certain sets, you only need to modify that set == 0 to include those sets.

BTW, here's script from Guile.txt:
C:
anim    select
@script
  if(frame==2){
    int Plays = openborvariant("count_players");
    int Code = getglobalvar("Plays");

    if(Plays < 2 && Code == 2){
      void self = getlocalvar("self"); //Get calling entity.

      updateframe(self, 1);
    }
  }
@end_script
    delay    6
    offset    35 98
    frame    data/chars/Guile/atk01.gif
    delay    5
    frame    data/chars/Guile/atk02.gif
    frame    data/chars/Guile/atk02.gif
    delay    6
    frame    data/chars/Guile/atk03.gif

The script loops 2nd frame to 3rd frame over n over preventing animation from ending and thus delaying player choice until 2nd player joins.
 
It's defined in the script and combined with script in player's SELECT animation.
In update.c:
C:
void main()
{//
    if(openborvariant("in_menuscreen")==1){
      setglobalvar("Plays", 0);
      setglobalvar("Win1", 0);
      setglobalvar("Win2", 0);
    } else if(openborvariant("in_selectscreen")){
      void set = openborvariant("current_set");

      if(set==0){
        setglobalvar("Plays", 2);
      } else if(set==1){
        changeplayerproperty(1, "newkeys", 0);
      }
    }
}

set == 0 means 1st level set in levels.txt.
In this if bracket, global variable "Plays" is set to 2. Setting this causes script in player's SELECT screen to loop endlessly until 2nd player joins.

In that update.c, only in set 0 (1st level set) Plays is set to 2, which means other level sets don't require 2 players to start the mode.
So if you want to this effect to applied to certain sets, you only need to modify that set == 0 to include those sets.

BTW, here's script from Guile.txt:
C:
anim    select
@script
  if(frame==2){
    int Plays = openborvariant("count_players");
    int Code = getglobalvar("Plays");

    if(Plays < 2 && Code == 2){
      void self = getlocalvar("self"); //Get calling entity.

      updateframe(self, 1);
    }
  }
@end_script
    delay    6
    offset    35 98
    frame    data/chars/Guile/atk01.gif
    delay    5
    frame    data/chars/Guile/atk02.gif
    frame    data/chars/Guile/atk02.gif
    delay    6
    frame    data/chars/Guile/atk03.gif

The script loops 2nd frame to 3rd frame over n over preventing animation from ending and thus delaying player choice until 2nd player joins.
Thanks for the explanation @Bloodbane !
 
Back
Top Bottom