Castlevania Soul Transform?

Crimsondeath

Well-known member
Hi to everyone, I'm not sure if this is the right section to ask scripts, but I'm making a Castlevania mod with OpenBOR using the Collaboration Demo posted by BloodBane (here, I asked his permission before xd), I'm pretty good modifying scripts but I sucks creating mine x.x, so I need a "soul transform" script like in Castlevania Symphony of the night, something like this:

tOXfuqK.png


Could be done with freespecials? Just need a script to transform the character in another player entity when a Key is pressed ("Attack 2" for example).

Thanks :D
 
@Bloodbane Thanks :D I should have tried with weapons before, I'm sorry :-[ .

I could create cloud and wolf transformations successfully :D but bat transformation only flyes in horizontal, I need vertical flying for that transformation, I tried to modify the file for the players keys and I loaded just for that transformation but nothing happens x.x.

Edit: By the way Do you know a good script for MP consumption, while using a weapon? or there is one option in the OpenBOR manual for that x.x?
 
I need vertical flying for that transformation

I have proper function for that. Do you know how to use @cmd and set animation script?
This is the function for controllable flying for 2D mods:

Code:
void keyfly(float V)
{// Move hero if direction button is pressed
      void self = getlocalvar("self");
      int iPIndex = getentityproperty(self,"playerindex"); //Get player index
      int a = getentityproperty(self,"a"); //Get player's altitude
	float xdir = 0;
	float ydir = 0;

      if (playerkeys(iPIndex, 0, "moveleft")){// Left is pressed?
	  xdir = -V;
	} else if(playerkeys(iPIndex, 0, "moveright")){// Right is pressed?
	  xdir = V;
      }

	if(playerkeys(iPIndex, 0, "moveup") && (a <= 360)){// Up is pressed?
	  ydir = V;
	} else if(playerkeys(iPIndex, 0, "movedown") && (a >= 0)){// Down is pressed?
	  ydir = -V;
      }

	changeentityproperty(self, "velocity", xdir, 0, ydir);
}

Do you know a good script for MP consumption, while using a weapon?

MP consumption script is easy but let me confirm this: do you want to force weapon change when MP drops certain limit?
 
Hi, I'm sorry for answer late (I just have the weekend to test properly the game xd), I tried to set the keyfly code but I don't know how to do it or where I have to paste it x.x.

The weapon MP consumption is for the Bat Soul transformation (and also the Cloud transformation), while the character is transformed his MP drops gradually (1 point each second while Bat Transform and 5 points for Cloud Transform) until 0, or do you recommend a limit? :0.

Thanks and greetings
 
I guess you don't know how to use animationscript. Alright, since you're using Castlevania Collab demo, I'll use example from there :)

If you open say Jon.txt, you'll see this line in the header:

Code:
animationscript	 data/scripts/player.c

That means, Jonathan is using scripts from player.c which allows him to use script @cmd such as:

Code:
	@cmd  limiter 15

limiter function is a function which will force player to play IDLE if current MP is below defined value, 15 in above example

The weapon MP consumption is for the Bat Soul transformation

Ah, that means you should use limiter function above. If Alucard already has animationscript declared, you can add that @cmd above and set desired value

Oh that function only do the checking not the actual mp consumption. For MP consumption, you'd need this function:

Code:
	@cmd  mpcost 15

This function simply consumes 15 unit MP when run

while the character is transformed his MP drops gradually (1 point each second while Bat Transform and 5 points for Cloud Transform) until 0, or do you recommend a limit?

Well, it's your mod so it's your call about the limit

I'd need to code script to force player to retransform if MP drops. Give me time :)
 
@Bloodbane:
Bloodbane said:
I guess you don't know how to use animationscript. Alright, since you're using Castlevania Collab demo, I'll use example from there :)

Nope really I'm pretty bad with game coding x.x, what I tried to do was something like this:

On soul_bat.txt (which is the bat soul transformation file)
Code:
animationscript	 data/scripts/player.c
keyscript	 data/chars/fran/franbatkey.c <--- here was the keyfly function
takedamagescript data/scripts/invis.c

Or add the script as an include on player.c:
Code:
#include "data/scripts/library/spawn.h"
#include "data/scripts/library/basic.h"
#include "data/scripts/fscript.c"
#include "data/scripts/keyfly.c"
I used the fscript.c as animationscript on my Neon Lightning Force mod too and it works good for the burn and shock pain animation.

Now I pasted the code like this in the character header (fran.txt):
Code:
animationscript	 data/scripts/player.c <--- Now here is the keyfly function
keyscript	 data/chars/fran/franbatkey.c 
takedamagescript data/scripts/invis.c

And on the soul_bat.txt walk animation:
Code:
anim	walk
	loop	1
	delay	10
	offset	55 63
	bbox	47 18 15 45
	@cmd	keyfly
	frame	data/chars/fran/batwalk1.gif
	frame	data/chars/fran/batwalk2.gif
	frame	data/chars/fran/batwalk3.gif
	frame	data/chars/fran/batwalk4.gif

I also tried with "@cmd  KeyFly U" "@cmd  KeyFly D" and didn't work x.x.

I found a "keymove" function on the player.c  :0 but I think it works automatically, so I tried to run the "keyfly" function without "@cmd" and nothing :'(  .
 
Or add the script as an include on player.c:

No, no. that's not right.
keyfly is only a single function, you don't need to use include. Copy and pasting it into animation script is enough to add that function

I'm not sure why you need keyscript for bat form but I can say for sure that keyfly doesn't work there

And on the soul_bat.txt walk animation:
Code:
anim	walk
	loop	1
	delay	10
	offset	55 63
	bbox	47 18 15 45
	@cmd	keyfly
	frame	data/chars/fran/batwalk1.gif
	frame	data/chars/fran/batwalk2.gif
	frame	data/chars/fran/batwalk3.gif
	frame	data/chars/fran/batwalk4.gif

I also tried with "@cmd  KeyFly U" "@cmd  KeyFly D" and didn't work x.x.

You should declare keyfly like this:
Code:
anim	walk
	loop	1
	delay	10
	offset	55 63
	bbox	47 18 15 45
	@cmd	keyfly 1
	frame	data/chars/fran/batwalk1.gif
	@cmd	keyfly 1
	frame	data/chars/fran/batwalk2.gif
	@cmd	keyfly 1
	frame	data/chars/fran/batwalk3.gif
	@cmd	keyfly 1
	frame	data/chars/fran/batwalk4.gif

I don't think you need WALK animation for the bat IOW IDLE animation with keyfly function should be enough
Oh yes, keyfly 1 means when direction key is held, character will fly in respective direction with 1 pixel/centisecond speed
 
@Bloodbane: I declared as you said and it works at last, thanks :D. I'll be waiting for your code script to force player to retransform if the MP drops :) .

I wish to show you how the game progress so I posted a video on youtube here, the video is with another player, the classic vampire hunter, I hope to do another video with this "alucard" style character when is completed.

Thanks
 
I'll be waiting for your code script to force player to retransform if the MP drops

Here you go:

Code:
anim	walk
@script
    void self = getlocalvar("self");
    int MP = getentityproperty(self,"mp");

    if(frame >= 1){
      if(MP < 10){
        changeentityproperty(self, "velocity", 0, 0, 0); // this is not necessary in IDLE
        performattack(self, openborconstant("ANI_FOLLOW1"));
      } else {
        changeentityproperty(self, "mp", MP-1);
      }
    }
@end_script
...

This script simply checks current MP. If it's lower than 10, play FOLLOW1 animation, if it's higher, reduce by 1 unit (for the MP cost during transformed mode)
FOLLOW1 is the retransforming animation. You could have any animation for this as long it has weaponframe command in it :)
The script above can be applied in IDLE animation too, though one line is not necessary (as noted above)

I wish to show you how the game progress so I posted a video on youtube here,

Looks good. I think the boss' electric attack needs to be fixed cause it's hardly aimed at player
 
@Bloodbane: Great :D It runs perfectly. Thank you very much ;D.
I don't have a video now to show how good it runs but soon I'm going to finish the Stage 2 so I'll do another official demonstration.

@O Ilusionista & @msmalik681 Thanks both of you, and thanks to the comunity for helping me with gamecreation :D
 
Back
Top Bottom