[SCRIPT] Charge Attack in Megaman style

KaiSSeR_SK: You can post your Testchar.txt. Do you have the 2 following scripts in your data/scripts ?:
Code:
animationscript data/scripts/As.c
script data/scripts/CA.c
 
kimono said:
KaiSSeR_SK: You can post your Testchar.txt. Do you have the 2 following scripts in your data/scripts ?:
Code:
animationscript data/scripts/As.c
script data/scripts/CA.c

Hi! In animationscript i have a different one... Let me compare both and experiment a little with it... THX AGAIN!

First try: Made backups, replace scripts, modify entity's header... CRASH! Same error in log... O_o
 
Looks like there's another error message somewhere in log file. You have to find it and post it here

If you can't find it, you can upload it somewhere for us to see
 
Bloodbane said:
Looks like there's another error message somewhere in log file. You have to find it and post it here

If you can't find it, you can upload it somewhere for us to see

This is the error message I've found.

Code:
openbor Script function 'openborvariant' returned an exception, check the manual for details. parameters: 21,

Using this OPENBOR version.
Code:
OpenBOR v3.0 Build 6391, Compile Date: Apr  8 2020
Presented by the OpenBOR Team.
www.chronocrash.com
OpenBOR is the open source continuation of Beats of Rage by Senile Team.

Special thanks to SEGA and SNK.

Edit:

Uploaded a "light" test version. Light because it's been removed heavy files like intro and many others.
My mod is based in a maked one (easy way to begin with OB) , like other people do I suppose...  that's where the problems will come from. This is a working version in case you want to see how it works normally. The charge attack script files (AS.c and CA.c) must be inside scripts folder. Extract the .pak file to access to the main files also removed to make the rar less heavy. Feel free to erase any useless file or text line... Thx

reuploaded by third time with the cleanest version possible

https://drive.google.com/open?id=1nLHAcZNeuqUqORjRziyPg4nngwi0AWMG

What i want to do in my mod is: I got 2 attack buttons (punch/kick) and only can do one charged attack with basic program, but with this script i could do more...
 
O Ilusionista said:
Topic merged. Tutorial topics can be necrobumped freely

Ok! Thanks!

Finally I've found the solution! If anyone else wants to use betterbold's Megaman project version, here is the solution. After many hours of reading scripting tutorials and a lot of trial and error I saw that the error occurred when going to enter the select screen. So I have solved it by putting in the header a conditional "in_level" that checks that you are within a level already loaded. Here the example:

Code:
void main() {
	if(openborvariant("in_level")){ //Here is the conditional!
	  
  void self = getlocalvar("self");

  charge_attack(self,"attack2",rgbcolor(0x00,0x26,0x88),rgbcolor(0x43,0x00,0xDA),rgbcolor(0x00,0xDA,0x0F),openborvariant("game_speed")*6,"ANI_FREESPECIAL17","ANI_FREESPECIAL21","ANI_FREESPECIAL13","data/sounds/dummy.wav",openborvariant("game_speed")*0.2,"cflash",0,0,0);
	}
}

Lots of thanks to all the people who helped me, and I hope this can serve someone.
 
Hi all again! Testing the game I've found a new issue. If you are holding a direction key and moving/walking, when release the attack charge button, the animation plays while keeps moving in the same direction  :-\

The idea is to stop the movement a moment before executing the "performattack" command in the script. I thought that maybe with a little pause before it could work. Or, if it is not too complicated, check the movement speed before "performattack" and if it is different from 0 change it and execute the attack. Are only ideas, sugestions, but I dont have idea about scripting. If you have any better solution... :p

Thanks in advance.

SOLVED! As I said, I am very curious and I like to experiment on my own, so, again reading tutorials and testing and failing, I have come to this conclusion. It may not be the most correct, but it works! : p

At the animation's header:
Code:
@script
  void self = getlocalvar("self");
  void KP = getplayerproperty(0,"keys"); //KP checks if any KEY PRESSED
  if(frame==0){if(KP>=1) changeentityproperty(self,"velocity",0,0,0); } // At frame 0 if 1 or more keys are pressed, stops moving
@end_script

One mor time, I hope this can be useful for someone ^_^.
 
So after some trail and errors, I was able to get the script to work.  But my problem now is when I do the air version of the charge shots, my character does the ground version animation in the air instead.  I tried tweaking the script a bit and adding different freespecials but that didn't fix the problem.
 
Back
Top Bottom