AlexDC22
Well-known member
sorry about the title, really unsure what to call it.. basically what the video shows... not sure how to achieve this without script and scripting have yielded me nothing at all since i suck at scripting...
this attempt at a script throws no errors but it crashes before level loads.
log showing where it crashes
and my obstacle file
any help would be appreciated been trying for a few hours and is getting annoying >_> lol
thanks
this attempt at a script throws no errors but it crashes before level loads.
C:
void main()
{
int self = getlocalvar("self");
int health = getentityproperty(self, "health");
if (health > 30) {
changeentityproperty(self, "animation", openborconstant("ANI_IDLE"));
changeentityproperty(self, "sprite", "data/chars/misc/Obstacles/t1.png");
} else if (health > 20) {
changeentityproperty(self, "animation", openborconstant("ANI_IDLE"));
changeentityproperty(self, "sprite", "data/chars/misc/Obstacles/t2.png");
} else if (health > 10) {
changeentityproperty(self, "animation", openborconstant("ANI_IDLE"));
changeentityproperty(self, "sprite", "data/chars/misc/Obstacles/t3.png");
} else if (health > 0) {
changeentityproperty(self, "animation", openborconstant("ANI_IDLE"));
changeentityproperty(self, "sprite", "data/chars/misc/Obstacles/t4.png");
} else {
performattack(self);
changeentityproperty(self, "animation", openborconstant("ANI_DIE"));
changeentityproperty(self, "sprite", "data/chars/misc/Obstacles/t4.png");
}
}
void takedamage(int damage)
{
int self = getlocalvar("self");
int health = getentityproperty(self, "health");
health -= damage;
changeentityproperty(self, "health", health);
main();
}
log showing where it crashes
Code:
Level Loading: 'DATA/LEVELS/level1.TXT'
Total Ram: 42871939072 Bytes ( 40885 MB )
Free Ram: 25588539392 Bytes ( 24403 MB )
Used Ram: 99995648 Bytes ( 95 MB )
Loading 'phoneb' from data/chars/misc/phoneb.txt
...done!
Loading 'devil_akuma' from data/chars/akuma/dakuma.txt
Loading 'hadoken' from data/chars/misc/hadoken.txt
...done!
Loading 'akumaspec' from data/chars/misc/akumaspec.txt
...done!
Loading 'death' from data/chars/misc/death.txt
...done!
Loading 'ends' from data/chars/misc/ends.txt
...done!
...done!
Level Loaded: 'DATA/LEVELS/level1.TXT'
Total Ram: 42871939072 Bytes ( 40885 MB )
Free Ram: 25585586176 Bytes ( 24400 MB )
Used Ram: 104595456 Bytes ( 99 MB )
Total sprites mapped: 2196
and my obstacle file
Code:
name phoneb
health 40
noatflash 1
flash noatflash
nolife 1
diesound data/sounds/glass.wav
gfxshadow 1
type obstacle
candamage player
animationscript data/scripts/obstacle_script.c
anim idle
delay 10
offset 60 183
bbox 24 16 86 176
platform -25 -25 100 100 20 140
frame data/chars/misc/Obstacles/t1.png
frame data/chars/misc/Obstacles/t2.png
frame data/chars/misc/Obstacles/t3.png
frame data/chars/misc/Obstacles/t4.png
anim Death
delay 99
offset 60 183
frame data/chars/misc/Obstacles/t4.png
any help would be appreciated been trying for a few hours and is getting annoying >_> lol
thanks