Greetings!
I'm on the basics of scripting and i'm doing some tests with @cmd on entity file
What i'm trying to do is a little lession to simply write a message on the screen if the attack hits the opponent.
I don't really like to copy and paste scripts, so i've been reading and trying to learning how the scripts works on the engine, but is pretty hard for me doing all by myself.
The problem is, my conditional statement doesn't work and i don't know if is my logic, script code structure (or both) is wrong.
The Script:
I've already set my character with didhitscript:
And the main problem (when i set CMD):
For what i've been seen, i have to set the parameter like @CMD "script function name" "parameter"
if is a string, i have to put "", and if is int or float i can just put the numbers to set the variable, i am right?
I've already managed to get zoom function work this way but when i create my own function with this parameter and make a statement to activate it through the @cmd, the OpenBorLog shows "cannot find the function":
I've managed to get the script work without activating @cmd at the first time with this:
I Know is not too optimal, but i'm just learning and trying to make simple lessions to get a little bit complex later.
So, how can i make this function work activating this through @CMD ?!
I'll put my mod on dreamcast so i'm using the Build 3984 (I've tried everything on most recent builds but i'm getting the same issue)
I really appreciate the help guys! I've been learning a lot here. ;D
I'm on the basics of scripting and i'm doing some tests with @cmd on entity file
What i'm trying to do is a little lession to simply write a message on the screen if the attack hits the opponent.
I don't really like to copy and paste scripts, so i've been reading and trying to learning how the scripts works on the engine, but is pretty hard for me doing all by myself.
The problem is, my conditional statement doesn't work and i don't know if is my logic, script code structure (or both) is wrong.
The Script:
Code:
void teste(int t)
{
void self = getlocalvar ("self");
if(t == 1) {
drawstring (10, -60, 1, "Special");
}
}
I've already set my character with didhitscript:
Code:
didhitscript data/scripts/teste.c
name San
health 80
mp 100
speed 15
type player
shadow 2
diesound data/chars/san/die.wav
icon data/chars/san/icon.gif
And the main problem (when i set CMD):
Code:
anim attack1
attack 43 21 53 34 5 0 0 0 3 0
loop 0
delay 10
bbox 22 5 20 90
offset 32 92
@cmd teste 1
frame data/chars/san/a1-00.gif
if is a string, i have to put "", and if is int or float i can just put the numbers to set the variable, i am right?
I've already managed to get zoom function work this way but when i create my own function with this parameter and make a statement to activate it through the @cmd, the OpenBorLog shows "cannot find the function":
Code:
Script compile error: can't find function 'teste'
Script compile error in 'San': teste line 9, column 12
I've managed to get the script work without activating @cmd at the first time with this:
Code:
void main()
{
void self = getlocalvar ("self");
float z = getentityproperty(self, "z");
void ani = getentityproperty(self, "animationid");
if (ani == openborconstant("ANI_FREESPECIAL")) {
drawstring (10, z-60, 1, "Special");
}
}
I Know is not too optimal, but i'm just learning and trying to make simple lessions to get a little bit complex later.
So, how can i make this function work activating this through @CMD ?!
I'll put my mod on dreamcast so i'm using the Build 3984 (I've tried everything on most recent builds but i'm getting the same issue)
I really appreciate the help guys! I've been learning a lot here. ;D