Bruce
Active member
Thanks alot masmalik681, that would help me alot in learning more.I will upload a small demo using the script so you can use it as a guide.
I greatly appreciate everyone in this site for helping us out.
Thanks alot masmalik681, that would help me alot in learning more.I will upload a small demo using the script so you can use it as a guide.
Thank you, I found a problem. After entering the game again after returning to the main menu, the SP timer will not be counted for the first time, and it will be counted after a while.@Bruce here you go as promised updated the first post with a tech demo showing the sp meter in effect.
I have to apologise the scripts I posted seemed sound in theory but I had to change them a lot to get them working I moved everything to the ondrawscript including the key inputs. If you have any questions don't hesitate to ask.
I added your script to my existing game, and it did display SP on the screen, thank you very much.@Bruce here you go as promised updated the first post with a tech demo showing the sp meter in effect.
I have to apologise the scripts I posted seemed sound in theory but I had to change them a lot to get them working I moved everything to the ondrawscript including the key inputs. If you have any questions don't hesitate to ask.
Regarding using sp, I re-edited a simple script, the player script "animationscript data/scripts/scripts.c"I added your script to my existing game, and it did display SP on the screen, thank you very much.
when I tried @cmd frame2ani "freespecial4" 2 "attack2" to my char.c
it gave me the error message: "Script compile error: can't find function 'frame2ani'"
on your ondrawscript, it says
void sp_atk( char ani, int sp_cost, char input1, char input2, char input3, char input4 )
I've also tried @cmd sp_atk "freespecial4" 2 "attack2"
it also gave me the error message: "Script compile error: can't find function 'sp_atk'"
How do you use the function?
Thank you very much for your help.
void costsp(int DamageSP, void Ani)
{
void self = getlocalvar("self");
void sp = getentityvar(self,"sp");
int sp=sp - DamageSP;
if(sp>=0){
setentityvar( self, "sp", sp);
}else{
changeentityproperty(self, "animation", openborconstant(Ani));
}
}
anim freespecial2
loop 0
delay 10
offset 72 131
bbox 63 102 16 29
fastattack 1
@cmd costsp 5 "ANI_FOLLOW1"
followanim 1
followcond 2
hitfx data/sounds/hit03.wav
frame data/chars/pla01/0sp1.gif
delay 10
frame data/chars/pla01/0sp2.gif
bbox 63 102 9 29
move 6
delay 2
attack 70 110 16 20 6 0 0 0 0
frame data/chars/pla01/0a103.gif
I added your script to my existing game, and it did display SP on the screen, thank you very much.
when I tried @cmd frame2ani "freespecial4" 2 "attack2" to my char.c
it gave me the error message: "Script compile error: can't find function 'frame2ani'"
on your ondrawscript, it says
void sp_atk( char ani, int sp_cost, char input1, char input2, char input3, char input4 )
I've also tried @cmd sp_atk "freespecial4" 2 "attack2"
it also gave me the error message: "Script compile error: can't find function 'sp_atk'"
How do you use the function?
Thank you very much for your help.
//KEYSCRIPTS
void ani = getentityproperty(self,"animationid");
if (ani == openborconstant("ANI_IDLE") || ani == openborconstant("ANI_WALK") || ani == openborconstant("ANI_ATTACK1") )
{// these are the animations that can be canceled
sp_atk("freespecial",10,"f","a"); //if you press forward and attack when you have 10SP or more perform freespecial
}
Thank you, returning to the main menu to enter the game again will not delay the recovery, but entering the next level will still be delayed.updated the first post with a fix to the delay on the sp meter starting when re-entering a stage.
@Bruce open ondraw.c and edit this part for moves. you can set what animations can be cancelled and what button inputs are required. but its just single direction pressing so "d" "f" "a" is not like ryus fireball motion its diagonal forward and down with attack.
C-like://KEYSCRIPTS void ani = getentityproperty(self,"animationid"); if (ani == openborconstant("ANI_IDLE") || ani == openborconstant("ANI_WALK") || ani == openborconstant("ANI_ATTACK1") ) {// these are the animations that can be canceled sp_atk("freespecial",10,"f","a"); //if you press forward and attack when you have 10SP or more perform freespecial }
Thanks a lot, the script worked perfectly. @msmalik681@pudu I have updated to v3 in the first post. Now there is a fix for a small issue where you have to have a greater value then the cost to perform the move. Fixed the timer when moving stages this demo has 1 enemy and 2 stages so it should be easy for you to test it.
Thank you very much for the CostSp script. I am actually using your script!Regarding using sp, I re-edited a simple script, the player script "animationscript data/scripts/scripts.c"
Place the following script code in scripts.c
Finally add @cmd costsp 5 "ANI_FOLLOW1" to the animation,Note: FOLLOW1 is the animation after insufficient spCode:void costsp(int DamageSP, void Ani) { void self = getlocalvar("self"); void sp = getentityvar(self,"sp"); int sp=sp - DamageSP; if(sp>=0){ setentityvar( self, "sp", sp); }else{ changeentityproperty(self, "animation", openborconstant(Ani)); } }
Code:anim freespecial2 loop 0 delay 10 offset 72 131 bbox 63 102 16 29 fastattack 1 @cmd costsp 5 "ANI_FOLLOW1" followanim 1 followcond 2 hitfx data/sounds/hit03.wav frame data/chars/pla01/0sp1.gif delay 10 frame data/chars/pla01/0sp2.gif bbox 63 102 9 29 move 6 delay 2 attack 70 110 16 20 6 0 0 0 0 frame data/chars/pla01/0a103.gif
Thanks a lot, the script worked perfectly. @msmalik681
It is working perfect! THANK YOU!@pudu I have updated to v3 in the first post. Now there is a fix for a small issue where you have to have a greater value then the cost to perform the move. Fixed the timer when moving stages this demo has 1 enemy and 2 stages so it should be easy for you to test it.
//PLAYER SP RECOVERY by {//msmalik681 & edited by Bruce (script for SP meter and moves control)
if(openborvariant("in_level")){
void self = getlocalvar("self");
int sp = getentityvar(self,"sp");
int max_sp = 99; //set the max to what you like
int time = openborvariant("elapsed_time");
int i, x;
if(!sp){ setentityvar(self,"sp",0); }
if(!getentityvar(self,"timer")){ // this controls how quick the sp recovers
setentityvar(self,"timer",time+400); //change value to control how fast or slow sp recovers
}
void player;
for(i = 0; i < 4; i++){
player = getplayerproperty(i, "ent");
if(player != NULL()){
int player_index = getentityproperty(player, "playerindex");
if (getglobalvar("rush_p" + player_index) > 1){
if (openborvariant("elapsed_time") - getglobalvar("rush_time_counter_p" + player_index) <= 0){
if(time > getentityvar(player,"timer") && sp < max_sp){ //sp recovery control
setentityvar(player,"sp",getentityvar(player,"sp")+1); //recover 1 sp
setentityvar(player,"timer",NULL()); //reset timer
}
}else if(openborvariant("elapsed_time") - getglobalvar("rush_time_counter_p" + player_index) > 0){
setglobalvar("rush_p" + i, 0);
}
}
//SP DISPLAY ON SCREEN
if( player_index == 0){ x=115;} //player 1
else if( player_index == 1){ x=375;} //player 2
else if( player_index == 2){ x=635;} //player 3
else if( player_index == 3){ x=895;} //player 4
if(sp) { drawstring(x, 50, 3, "SP: " + getentityvar(player,"sp")); }
else { drawstring(x, 50, 3, "SP: " + getentityvar(player,"sp")); }
// Y, front type (0 = font1, 1 = font2, etc..)
}
}
}
You sound like Eddie Brock "We are Venom!" lolWe can not thank you enough for helping us out.
Thanks. I followed the manual, but my summon always comes down from the top. Is there a way to have the summon appeared at the specific offset (location)?You sound like Eddie Brock "We are Venom!" lol
So to summon something your could have a SP move that has a spawnframe see the manual for more details.
How do I use the anim Pain, anim Attack, etc. in Anim freespecial__?You sound like Eddie Brock "We are Venom!" lol
So to summon something your could have a SP move that has a spawnframe see the manual for more details.
What I like to do is: