Solved Problem with Using MPRate

Question that is answered or resolved.

maxman

Well-known member
I tried using this script I made, but when I execute it and run the game, it crashes as I press an attack button. Is there something wrong with changing the property of mprate?

C:
void mpRate(float Rate){
    void self = getlocalvar("self");
    changeentityproperty(self, "mprate", Rate);
}

Code:
name Terry
type player
health 100
nodieblink 1
speed 10
mprate 1
gfxshadow 1
icon data/chars/heroes/KOF_2K3_Terry_Sprite.7z/terry.png 1
diesound data/sounds/heroes/terry/06_terry_00009.wav

animationscript data/scripts/animation/default.c

Code:
anim attack
    offset 140 188
    delay 4
    #cancel 0 0 0 a2 freespecial24 #Special
    cancel 2 4 1 a2 freespecial12 # L H
    bbox 126 94 42 94
    @cmd mpRate 2
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/95_0.png
    attack 145 92 64 25 6 0 0 0 0 0
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/113_1.png
    attack 0
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/95_0.png
    @cmd mpRate 1
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/95_0.png

Code:
Total Ram: 4171603968 Bytes
 Free Ram: 911011840 Bytes
 Used Ram: 6303744 Bytes

debug:nativeWidth, nativeHeight, bpp, Hz  1366, 768, 24, 60
OpenBoR v3.0 Build 6391, Compile Date: Apr  8 2020

Game Selected: ./Paks/ROD MAXED OUT!.pak

FileCaching System Init......    Disabled
Initializing video............
Reading video settings from 'data/video.txt'.
Initialized video.............    480x272 (Mode: 1)

Loading menu.txt.............    Done!
Loading fonts................    1 2 3 4 5 6 7 8 Done!
Timer init...................    Done!
Initialize Sound..............  
Loading sprites..............    Done!
Loading level order..........    Done!
Loading model constants......    Done!
Loading script settings......    Done!
Loading scripts..............    Done!
Loading models...............

Joystick: "UNKNOWN" connected at port: 0 at 2025-01-30 18:38:00
Cacheing 'Flash' from data/chars/misc/flash.txt
Cacheing 'Axel' from data/chars/heroes/Axel/axel.txt
Cacheing 'Mai_Frost' from data/chars/mai/mai.txt
Cacheing 'Terry' from data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt
Cacheing 'Aki' from data/chars/Aki/Aki.txt
Cacheing 'Shinryu' from data/chars/heroes/KOF_099_Jhun_Sprite.7z/shinryu.txt
Cacheing 'Clark' from data/chars/heroes/clark/clark.txt
Cacheing 'Athena' from data/chars/heroes/athena/xi/athenaxi.txt
Cacheing 'Kim' from data/chars/kim/kim.txt
Cacheing 'Evy' from data/chars/Vanessa/Vanessa.txt
Cacheing 'Hanzo' from data/chars/heroes/hanzo/hanzo.txt
Cacheing 'reweap' from data/chars/misc/reweap.txt
Cacheing 'Athena94' from data/chars/heroes/athena/94/athena94.txt
Cacheing 'Atena95' from data/chars/heroes/athena/95/atena95.txt
Cacheing 'Aten94' from data/chars/heroes/athena/aten94.txt
Cacheing 'Aten95' from data/chars/heroes/athena/aten95.txt
Cacheing 'coll1' from data/bgs/select/col1.txt
Cacheing 'coll1b' from data/bgs/select/col1b.txt
Cacheing 'coll2' from data/bgs/select/col2.txt
Cacheing 'coll2b' from data/bgs/select/col2b.txt
Cacheing 'coll3' from data/bgs/select/col3.txt
Cacheing 'coll3b' from data/bgs/select/col3b.txt
Cacheing 'coll4' from data/bgs/select/col4.txt
Cacheing 'coll4b' from data/bgs/select/col4b.txt
Cacheing 'coll5' from data/bgs/select/col5.txt
Cacheing 'coll5b' from data/bgs/select/col5b.txt
Cacheing 'TerrySel' from data/bgs/select/terrysel.txt
Cacheing 'powave' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/powave.txt
Cacheing 'burnknuc' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/burnknuc.txt
Cacheing 'bkdust' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/bkdust.txt
Cacheing 'powdunk' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/powdunk.txt
Cacheing 'pgeyser' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/pgeyser.txt
Cacheing 'JoeD' from data/chars/joe/joed.txt
Cacheing 'JoeNPC' from data/chars/joe/joenpc.txt
Cacheing 'ShermieNPC' from data/chars/shermie/shermienpc.txt
Cacheing 'K'NPC' from data/chars/k/knpc.txt
Cacheing 'Hotdog' from data/chars/misc/hotdog.txt
Cacheing 'Pizza' from data/chars/misc/pizza.txt
Cacheing '1upR' from data/chars/misc/1upR.txt
Cacheing '1upG' from data/chars/misc/1upG.txt
Cacheing '1upB' from data/chars/misc/1upB.txt
Cacheing '1up' from data/chars/misc/1up.txt
Cacheing 'Money' from data/chars/misc/money.txt
Cacheing 'Time' from data/chars/misc/time.txt
Cacheing 'Gold' from data/chars/misc/gold.txt
Cacheing 'Box' from data/chars/misc/box.txt
Cacheing 'Table' from data/chars/misc/table.txt
Cacheing 'Chair' from data/chars/misc/chair.txt
Cacheing 'Fence' from data/chars/misc/fence.txt
Cacheing 'Drum' from data/chars/misc/drum.txt
Cacheing 'Phone' from data/chars/misc/Pbooth.txt
Cacheing 'Joe' from data/chars/joe/joe.txt
Cacheing 'Jones' from data/chars/jones/jones.txt
Cacheing 'K'' from data/chars/k/k.txt
Cacheing 'Cheng' from data/chars/Cheng/Cheng.txt
Cacheing 'Eiji' from data/chars/eiji/eiji.txt
Cacheing 'Lin' from data/chars/lin/lin.txt
Cacheing 'Shermie' from data/chars/enemies/shermie/shermie.txt
Cacheing 'Hwa' from data/chars/hwa/hwa.txt
Cacheing 'Max' from data/chars/max/max.txt
Cacheing 'Genjuro' from data/chars/genjuro/genjuro.txt
Cacheing 'Choi' from data/chars/choi/choi.txt
Cacheing 'Billy' from data/chars/billy/billy.txt
Cacheing 'Seth' from data/chars/seth/seth.txt
Cacheing 'Whip' from data/chars/whip/whip.txt
Cacheing 'Gato' from data/chars/gato/gato.txt
Cacheing 'Geese' from data/chars/Geese/Geese.txt
Cacheing 'no1' from data/chars/no1/no1.txt
Cacheing 'robot' from data/chars/robot/robot.txt
Cacheing 'Knife' from data/chars/misc/knife.txt
Cacheing 'Shot' from data/chars/misc/shot.txt
Cacheing 'Star' from data/chars/misc/star.txt
Cacheing 'light' from data/chars/misc/light.txt
Cacheing 'heli' from data/chars/misc/heli.txt
Cacheing 'rain' from data/chars/misc/rain.txt
Cacheing 'bridge' from data/chars/misc/bridge.txt
Cacheing 'Lucky' from data/chars/bosses/lucky/lucky.txt
Cacheing 'Garcia' from data/chars/enemies/garcia/garcia.txt
Cacheing 'Ruhut' from data/chars/enemies/ruhut/ruhut.txt
Cacheing 'TerryPortA' from data/chars/heroes/kof_2k3_terry_sprite.7z/terryporta.txt
Cacheing 'TerryPortB' from data/chars/heroes/kof_2k3_terry_sprite.7z/terryportb.txt
Cacheing 'TerryPortC' from data/chars/heroes/kof_2k3_terry_sprite.7z/terryportc.txt
Cacheing 'Mike' from data/chars/mike/src_mike.txt
Cacheing 'PhoneB1' from data/chars/misc/phoneb/phone.txt
Cacheing 'PhoneB' from data/chars/misc/phoneb/phoneb.txt
Cacheing 'PhoneA' from data/chars/misc/phoneb/phonea.txt
Cacheing 'birds' from data/chars/misc/birds/birds.txt
Cacheing 'scrSel' from data/bgs/select/scrSel.txt
Cacheing 'selection' from data/bgs/select/selection.txt
Cacheing 'bgmgrid' from data/bgs/select/bgmgrid.txt
Cacheing 'selectR' from data/bgs/select/selectr.txt
Cacheing 'selectG' from data/bgs/select/selectg.txt
Cacheing 'selectB' from data/bgs/select/selectb.txt
Cacheing 'arrowl' from data/chars/misc/arrowl.txt
Cacheing 'pillar' from data/bgs/3rave2/pillar.txt
Cacheing 'St2_Disco1' from data/bgs/3rave2/rave/disco1.txt
Cacheing 'St2_Disco2' from data/bgs/3rave2/rave/disco2.txt
Cacheing 'St2_Laser' from data/bgs/3rave2/rave/laser.txt
Cacheing 'St2_People' from data/bgs/3rave2/rave/people.txt

Loaded 'Flash' from data/chars/misc/flash.txt
Loaded 'Axel' from data/chars/heroes/Axel/axel.txt
Loaded 'Mai_Frost' from data/chars/mai/mai.txt
sound_load_sample can't load sample from file 'data/sounds/mai.wav'!
sound_load_sample can't load sample from file 'data/sounds/mai.wav'!
Loaded 'Terry' from data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt
Loaded 'TerryPortA' from data/chars/heroes/kof_2k3_terry_sprite.7z/terryporta.txt
Loaded 'TerryPortB' from data/chars/heroes/kof_2k3_terry_sprite.7z/terryportb.txt
Loaded 'TerryPortC' from data/chars/heroes/kof_2k3_terry_sprite.7z/terryportc.txt
Command 'if(openborvariant("in_selectscreen")){' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'void' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'int' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'int' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'int' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'int' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'void' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'void' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'void' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'void' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '/*' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'for(){' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '}' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '*/' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'if(getlocalvar("remapsfx")' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '/*if(' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '(press' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '||' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command ')' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '{' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'playsample(sfx01,' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'setlocalvar("remapsfx",' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '}*/' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'if(map' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'playsample(sfx01,' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'setlocalvar("remapsfx",' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '}' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'if(map' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'playsample(sfx02,' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'setlocalvar("remapsfx",' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '}' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'if(map' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'playsample(sfx03,' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'setlocalvar("remapsfx",' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '}' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '}' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'if(getlocalvar("remapsfx")' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command 'setlocalvar("remapsfx",' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '}' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '}' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Command '@end_script' not understood in file 'data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt'!
Loaded 'powave' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/powave.txt
Loaded 'burnknuc' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/burnknuc.txt
Loaded 'bkdust' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/bkdust.txt
Loaded 'powdunk' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/powdunk.txt
Loaded 'pgeyser' from data/chars/heroes/kof_2k3_terry_sprite.7z/effects/pgeyser.txt
Loaded 'Aki' from data/chars/Aki/Aki.txt
Loaded 'Shinryu' from data/chars/heroes/KOF_099_Jhun_Sprite.7z/shinryu.txt
Loaded 'Clark' from data/chars/heroes/clark/clark.txt
WARNING: data/chars/heroes/clark/clark.txt tries to load a non-numeric value at cancel, where a number is expected!
erroneus string: a
Loaded 'Athena' from data/chars/heroes/athena/xi/athenaxi.txt
Loaded 'aten94' from data/chars/heroes/athena/aten94.txt
Loaded 'aten95' from data/chars/heroes/athena/aten95.txt
Loaded 'Kim' from data/chars/kim/kim.txt
sound_load_sample can't load sample from file 'data/sounds/diepla.wav'!
Loaded 'Evy' from data/chars/Vanessa/Vanessa.txt
Loaded 'Hanzo' from data/chars/heroes/hanzo/hanzo.txt
Loaded 'Athena94' from data/chars/heroes/athena/94/athena94.txt
Command 'if(frame==1){' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'void' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'int' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'int' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'int' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'if(hps==null()){' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'hps' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command '}' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'changeentityproperty(self,"maxhealth",' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'changeentityproperty(self,"health",' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'setglobalvar("hp"' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command '}' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command '@end_script' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'if(frame==1){' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'void' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'int' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'changeentityproperty(self,"maxhealth",' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command 'changeentityproperty(self,"health",' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command '}' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Command '@end_script' not understood in file 'data/chars/heroes/athena/94/athena94.txt'!
Loaded 'Atena95' from data/chars/heroes/athena/95/atena95.txt
Loaded 'coll1' from data/bgs/select/col1.txt
Loaded 'coll1b' from data/bgs/select/col1b.txt
Loaded 'coll2' from data/bgs/select/col2.txt
Loaded 'coll2b' from data/bgs/select/col2b.txt
Loaded 'coll3' from data/bgs/select/col3.txt
Loaded 'coll3b' from data/bgs/select/col3b.txt
Loaded 'coll4' from data/bgs/select/col4.txt
Loaded 'coll4b' from data/bgs/select/col4b.txt
Loaded 'coll5' from data/bgs/select/col5.txt
Loaded 'coll5b' from data/bgs/select/col5b.txt
Loaded 'TerrySel' from data/bgs/select/terrysel.txt

Loading models...............    Done!
Object engine init...........    Done!
Input init...................  
1 joystick(s) found!
UNKNOWN - 2 axes, 10 buttons, 0 hat(s)
Done!
Create blending tables.......    Done!
Save settings so far........    Done!



Can't play music file 'data/music/remix'

Can't play music file 'data/music/<VT_EMPTY>   Unitialized/title.bor'

Can't play music file 'data/music/remix'

Can't play music file 'data/music/menu'

Can't play music file 'data/music/remix'

Can't play music file 'data/music/<VT_EMPTY>   Unitialized/select.bor'
Loaded 'scrSel' from data/bgs/select/scrSel.txt
Loaded 'selection' from data/bgs/select/selection.txt
Loaded 'bgmgrid' from data/bgs/select/bgmgrid.txt
Loaded 'selectr' from data/bgs/select/selectr.txt
Loaded 'selectg' from data/bgs/select/selectg.txt
Loaded 'selectb' from data/bgs/select/selectb.txt

Can't play music file 'data/music/remix'

Can't play music file 'data/music/menu'

Can't play music file 'data/music/remix'
Loaded 'scrSel'Level Loading:   'data/levels/rave02.txt'
Total Ram: 4171603968 Bytes
 Free Ram: 369504256 Bytes
 Used Ram: 51507200 Bytes

Loaded '1up' from data/chars/misc/1up.txt
Loaded 'table' from data/chars/misc/table.txt
Loaded 'money' from data/chars/misc/money.txt
Loaded 'chair' from data/chars/misc/chair.txt
Loaded 'hotdog' from data/chars/misc/hotdog.txt
Loaded 'St2_People' from data/bgs/3rave2/rave/people.txt
Loaded 'pillar' from data/bgs/3rave2/pillar.txt
Loaded 'shermie' from data/chars/enemies/shermie/shermie.txt

Level Loaded:    'data/levels/rave02.txt'
Total Ram: 4171603968 Bytes
 Free Ram: 380915712 Bytes
 Used Ram: 55582720 Bytes
Total sprites mapped: 1246

Script function 'changeentityproperty' returned an exception, check the manual for details.
 parameters: #131641528, 109, 2,
 
********** An Error Occurred **********
*            Shutting Down            *

There's an exception while executing script 'Terry' data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txtTotal Ram: 4171603968 Bytes
 Free Ram: 426213376 Bytes
 Used Ram: 55631872 Bytes

Release level data...........
Level Unloading: 'data/levels/rave02.txt'
Total Ram: 4171603968 Bytes
 Free Ram: 426213376 Bytes
 Used Ram: 55631872 Bytes

RAM Status:
Total Ram: 4171603968 Bytes
 Free Ram: 426618880 Bytes
 Used Ram: 54071296 Bytes

Done!

Release graphics data........    Done!
Release game data............

Unload 'Flash' ............Done.
Unload 'Axel' ............Done.
Unload 'Mai_Frost' ............Done.
Unload 'Terry' ............Done.
Unload 'TerryPortA' ............Done.
Unload 'TerryPortB' ............Done.
Unload 'TerryPortC' ............Done.
Unload 'powave' ............Done.
Unload 'burnknuc' ............Done.
Unload 'bkdust' ............Done.
Unload 'powdunk' ............Done.
Unload 'PGeyser' ............Done.
Unload 'Aki' ............Done.
Unload 'Shinryu' ............Done.
Unload 'Clark' ............Done.
Unload 'Athena' ............Done.
Unload 'Aten94' ............Done.
Unload 'Aten95' ............Done.
Unload 'Kim' ............Done.
Unload 'Evy' ............Done.
Unload 'Hanzo' ............Done.
Unload 'Athena94' ............Done.
Unload 'Atena95' ............Done.
Unload 'coll1' ............Done.
Unload 'coll1b' ............Done.
Unload 'coll2' ............Done.
Unload 'coll2b' ............Done.
Unload 'coll3' ............Done.
Unload 'coll3b' ............Done.
Unload 'coll4' ............Done.
Unload 'coll4b' ............Done.
Unload 'coll5' ............Done.
Unload 'coll5b' ............Done.
Unload 'TerrySel' ............Done.
Unload 'scrSel' ............Done.
Unload 'selection' ............Done.
Unload 'bgmgrid' ............Done.
Unload 'selectR' ............Done.
Unload 'selectG' ............Done.
Unload 'selectB' ............Done.
Unload '1up' ............Done.
Unload 'Table' ............Done.
Unload 'Money' ............Done.
Unload 'Chair' ............Done.
Unload 'Hotdog' ............Done.
Unload 'St2_People' ............Done.
Unload 'pillar' ............Done.
Unload 'Shermie' ............Done.

Release game data............    Done!
Release timer................    Done!
Release input hardware.......    Done!
Release sound system.........    Done!
Release FileCaching System...    Done!

**************** Done *****************

There's an exception while executing script 'Terry' data/chars/heroes/kof_2k3_terry_sprite.7z/terry.txt
 
Solution
Reverting to mprate 1 with takedamagescript is easy, but reverting back to 1 for anim idle after certain attacks/moves/specials is hard. How can I revert its mprate back to 1 after it reaches to anim idle or finishes its last attack in an animation before moving to anim idle? Is there a way I could allow normal attacks to hit with default mprate 1 instead of retaining mprate 2 in all attacking animations after some certain attacking animations? For example, I have mprate 2 set in runattack and follow1 anims from my script of ondoattack and what I want is to revert back to mprate 1 in all normal attack animations. But after I finish with certain animations and start doing all attacking animation including grabattack, mprate 2 stays...
This is one separate character's ondoattack script which I'm using but I want to include it with another ondoattack.

ondoattack data/chars/hero01/hero01attack.c
In this line, it should be "ondoattackscript", not "ondoattack".

1741217686364.png

I don't know if I understood correctly, but it seems that you are trying to mix two "void main()" functions through "import" directive.
I suggest taking a look at the SOR2X scripts. In short, you must call in the character header the file where's the "void main()" is, and all the imported script library
should be named and called one by one inside the "void main".

main.c file:
Code:
#import "data/scripts/file.c"

void main()
{
    script1();
    script2();
    script3();
    script4();
}

library file.c (or you can change to .h, devs commonly use it too):
Code:
void script1()
{
    doSomething1();
}

void script2()
{
    doSomething2();
}

void script3()
{
    doSomething3();
}

void script4()
{
    doSomething4();
}

About the log file, it does not provide too much info. I suggest rebuilding the import directive first, and then add each script one by one until the crash happens.
This way you can locate and isolate where the issue is in order to fix it.
 
In this line, it should be "ondoattackscript", not "ondoattack".
Oops. I meant "ondoattackscript" in the line. I forgot to put the word "script" to "ondoattack" part.

I tried exactly that, but it's not working. I do not know how they cause a crash like this. I imported the function names into one file as you said.

Here are the following codes I use:

C:
#import "data/chars/hero01/hero01atkmain.c"

void main(){
    hero01Atk();
    multiHits();
    hitVar();
}

hero01atkmain.c:
C:
void hero01Atk(){
    void self = getlocalvar("self");
    void ani = getentityproperty(self, "animationid");
    int recover;

    if(ani == openborconstant("ANI_FREESPECIAL35") || ani == openborconstant("ANI_FREESPECIAL36") || ani == openborconstant("ANI_FREESPECIAL37")){
        recover = 2;
        changeentityproperty(self, "mpset", NULL(), NULL(), NULL(), recover, NULL(), NULL());
    }else{
        recover = 1;
        changeentityproperty(self, "mpset", NULL(), NULL(), NULL(), recover, NULL(), NULL());
    }
}

void multiHits()
{//Script to avoid "multihits" glitch, same as the original SOR2 (NOT USED FOR NOW...)

    //WORKS FOR ATTACKER ONLY
    if(!getlocalvar("which")){
        void self        = getlocalvar("self");
        void other        = getlocalvar("other");
        void atkType    = getlocalvar("attacktype");
        int atkId        = getentityproperty(self, "attackid");

        //AVOID SOME ATTACK TYPES
        if(    atkType != openborconstant("ATK_LAND")        &&
            atkType != openborconstant("ATK_LIFESPAN")    &&
            atkType != openborconstant("ATK_PIT")        &&
            atkType != openborconstant("ATK_TIMEOVER")    ){

            //THE CURRENT ATTACKBOX ID IS SAME AS THE PREVIOUS USED ONE?? DISABLE THE ENGINE HIT HANDLING
            if(atkId == getentityvar(self, "atkId"+other)){changeopenborvariant("lasthitc", 0);}

            //SAVE THE "LAST ATTACKBOX ID" + "CURRENT PLAYER" + "DAMAGED ENTITY"
            setentityvar(self, "atkId"+other, atkId);
        }
    }

    hitVar();
}

void hitVar()
{//Check variables before allow the "HITFX" function to runs in the didhit event
 
    //WORKS FOR ATTACKER ONLY
    if(!getlocalvar("which")){
        void self        = getlocalvar("self");
        void other        = getlocalvar("other");
        void atkType    = getlocalvar("attacktype");
        int atkId        = getlocalvar("attackid");
        float time        = openborvariant("elapsed_time")/2;
     
        //AVOID SOME ATTACK TYPES
        if(    atkType != openborconstant("ATK_NORMAL7")    &&
            atkType != openborconstant("ATK_NORMAL10")    &&
            atkType != openborconstant("ATK_LAND")        &&
            atkType != openborconstant("ATK_LIFESPAN")    &&
            atkType != openborconstant("ATK_PIT")        &&
            atkType != openborconstant("ATK_TIMEOVER")    ){

            //REGISTER THE CURRENT "ATKID+TIME+OTHER" TO AVOID TWO OR MORE SOUNDS AT SAME TIME
            //EVERY "OTHER" IS REGISTERED INTO A UNIQUE VARIABLE
            if(getentityvar(self, "other"+atkId+time) == NULL()){setentityvar(self, "other"+atkId+time, other);}

            //COMPARE THE PREVIOUS SAVED "OTHER" WITH THE CURRENT "OTHER", CONFIRM IF HAS TWO OR MORE AT SAME TIME
            //IF THE "TIME" IS DIFFERENT FOR EACH "OTHER", PROCEED WITH MULTIPLE SOUNDS NORMALLY
            if(other == getentityvar(self, "other"+atkId+time)){setentityvar(self, "hitConfirm", 1);}
        }
    }
}

I'm trying to do this for an individual character. Is there anything wrong in regard to current attack hits?

EDIT:
I am totally sorry. I was quite wrong about this because I forgot to delete the animation script of "mpRate" in the animation. I already deleted mpRate from animation script, but I forgot to delete this part @cmd mpRate 1.5 from this animation.

Code:
anim freespecial35
    cancel        3 12 2 d f d f a1  freespecial50
    cancel        3 12 2 d f d f a2  freespecial52
    cancel        3 12 2 d f d f a4  freespecial53
    loop        0
    delay         6
    offset        93 171
    bbox        79 106 30 65
    fastattack    1
    hitflash     Qflash
    frame        data/chars/hero01/b101.gif
    frame        data/chars/hero01/b102.gif
    delay        3
    frame        data/chars/hero01/ll01.gif
sound   data/chars/ncchun/achun03.wav
@cmd hitfx   "data/sounds/beatsfa306b.wav"
    attack2        90 120 57 41 3 0 0 0 12 10
    forcedirection  -1
    dropv           0.3 0 0
    nokill        1
    frame        data/chars/hero01/ll02.gif
    attack2        0
    frame        data/chars/hero01/ll01.gif
    attack         90 107 65 27 3 0 0 0 12 10
    forcedirection  -1
    dropv           0.2 0 0
    frame        data/chars/hero01/ll03.gif
    attack         0
    frame        data/chars/hero01/ll04.gif
sound   data/chars/hero01/hitsa03.wav
    attack2     90 122 55 54 3 0 0 0 12 10
    forcedirection  -1
    dropv           0.3 0 0
    nokill        0
    frame        data/chars/hero01/ll05.gif
    attack2        0
    frame        data/chars/hero01/ll06.gif
@cmd hitfx   "data/sounds/beatsfa306.wav"
    attack      90 122 55 54 3 1 0 0 12 10
    forcedirection  -1
    dropv           0.8 2 0
    frame        data/chars/hero01/ll07.gif
    delay        7
    attack         0
    frame        data/chars/hero01/b102.gif
    #@cmd mpRate 1.5
    frame        data/chars/hero01/b101.gif

Disregard what I posted last after we got our problem solved.

Thank you very much for your help, Kratus. I will revert back to where I was supposed to do without having mpRate animation script in some animations. mpRate in animation script which I forgot to remove from an animation was the main culprit for the crash. After removing it from animation script, it works well.
 
Last edited:
Back
Top Bottom