Characters getting New Special Moves as you play?

Liu-Kang

Member
I've been wondering what's the best and or most viable way of characters unlocking new special moves as your beatemup goes by? :) Whether it's only for the character you're playing as or every character at some point unlocking an input/move locked in their text file or elsewhere.
 
There are two ways that I know for this:
1. Use weaponmodel
Make different models for each locked state e.g model1 has one move unlocked, model2 has two moves and so on
Then in level texts, use setweap command to define which model is used IOW how many moves are unlocked
2. Use script to unlock/lock moves
Use script to lock certain moves. The script also allows the move to be performed when certain global variable is set
Then in level texts, use script to unlock desired moves

Both method unlocks moves for all characters BTW

#1 is easiest cause it doesn't use script however it require lots of character texts just for extra moves
#2 is more complex to use (with script) however it only require one character text
 
There's no tutorial for those unfortunately. The best I could do now is to give you example from Cherry On Top, a game I've made some time ago for Food Jam

Cherro (the hero of the game) has this in his text:
Code:
anim	attack1
@script
    if(frame==1){
      void self = getlocalvar("self");
      int Shoot = getglobalvar("Rashut");

      if(Shoot != 583){
        setidle(self, openborconstant("ANI_IDLE"));
      }
    }
@end_script
	delay	1
	offset	20 56
	bbox	3 16 34 41
	frame	data/chars/cherro/idle.png
	delay	10
	@cmd	keyint "ANI_FOLLOW1" 0 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 0 "D" 0
	@cmd	keyflip
	frame	data/chars/cherro/shoot1.png
	sound	data/sounds/shoot.wav
	@cmd	shooterW "Biji" 23 30 2 0
	frame	data/chars/cherro/shoot2.png
	delay	20
	frame	data/chars/cherro/idle.png

The script cancels his attack if global variable "Rashut" isn't set with proper value. To set that variable, he must take certain powerup. In other words, he must take shoot powerup to allow him to shoot

That's one way to set global variable. There are many ways to do it :)
 
msmalik681 said:
Another scripted method is to use key scripts to check for the special move input and if the special move has been unlocked by a entityvar !

Yeah, but using keyscripts it will be checked in every single key press/release, while in the animation script it will be checked only on that specific animation.
 
Yes I was thinking if you press down, forward and attack and then return to idle it would seem strange .  I guess the check on the freespecial can perform attack if the move is not unlocked so yeah my mistake lol
 
Bloodbane said:
There's no tutorial for those unfortunately. The best I could do now is to give you example from Cherry On Top, a game I've made some time ago for Food Jam

Cherro (the hero of the game) has this in his text:
Code:
anim	attack1
@script
    if(frame==1){
      void self = getlocalvar("self");
      int Shoot = getglobalvar("Rashut");

      if(Shoot != 583){
        setidle(self, openborconstant("ANI_IDLE"));
      }
    }
@end_script
	delay	1
	offset	20 56
	bbox	3 16 34 41
	frame	data/chars/cherro/idle.png
	delay	10
	@cmd	keyint "ANI_FOLLOW1" 0 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 0 "D" 0
	@cmd	keyflip
	frame	data/chars/cherro/shoot1.png
	sound	data/sounds/shoot.wav
	@cmd	shooterW "Biji" 23 30 2 0
	frame	data/chars/cherro/shoot2.png
	delay	20
	frame	data/chars/cherro/idle.png

The script cancels his attack if global variable "Rashut" isn't set with proper value. To set that variable, he must take certain powerup. In other words, he must take shoot powerup to allow him to shoot

That's one way to set global variable. There are many ways to do it :)

So far the script is restricting him from using the move which is what I wanted, but how in a level file would I set the globalvar to allow him to use the special move? It isn't a move that needs ammo like you described, would I need to rework the script to work with just a regular old special move?
 
To set global variable in a level, you simply need to declare this script:
Code:
spawn	Empty
@script
void main()
{
    setglobalvar("Shoot", 6);
}
@end_script
coords	320 460
at	0

When empty is spawned at scrollpos 0, global variable by name Shoot is given value 6
Since the script is unrelated to empty entity, the script can be declared at any entity spawn
 
Back
Top Bottom