Issue Information
-
#008275
-
0 - None Assigned
-
Confirmed
Issue Confirmations
-
Yes (1)No (0)
1) The Dual Monster Races never end. Whenever monsters reach the finish line, they aren't killed off and there's no announcement that they've finished the race.
Example: This Deviruchi clearly crossed the finish line, but nothing happens.
http://img.photobuck...zps083f3673.jpg
I'm not sure how to fix this, or if it's specific only to the server I'm playing.
2) Old bug that got carried over from a previous emulator. To win a Dual Monster Race, you have to pick the two monsters who will cross the finish line first, where order does NOT matter. However, in monster_race.txt:
The fix is simple though! Replace the previous line with:
Example: This Deviruchi clearly crossed the finish line, but nothing happens.
http://img.photobuck...zps083f3673.jpg
I'm not sure how to fix this, or if it's specific only to the server I'm playing.
2) Old bug that got carried over from a previous emulator. To win a Dual Monster Race, you have to pick the two monsters who will cross the finish line first, where order does NOT matter. However, in monster_race.txt:
if (monster_race_2_1 == $@mon_race_2_1 && monster_race_2_2 == $@mon_race_2_2) {This code enforces that order DOES matter; The monster you pick first MUST be first place, and the monster you pick second MUST be second place.
The fix is simple though! Replace the previous line with:
if (monster_race_2_1 == $@mon_race_2_1 && monster_race_2_2 == $@mon_race_2_2) || (monster_race_2_1 == $@mon_race_2_2 && monster_race_2_2 == $@mon_race_2_1) {A simple inclusion for both possibilities.
1) Confirms that the race won't end...(doubt that it happens on single race too)
changed status to: Confirmed
Found the problem, and it only strikes when monsters are activating the npc. All players have RID, but so do monsters. When they triggered the OnTouchNPC, and then function, first thing first it'd slide down on first command that would check for player's rid, and since it won't find any PLAYER with such rid, it'd stop script.
Long story short:
Add in script detachrid; after OnTouchNPC:
Better to get it fixed in the source, but I couldn't figure out how to with my limited knowledge.
Long story short:
Add in script detachrid; after OnTouchNPC:
OnTouchNPC: detachrid; set .@i, MN; if ( ! $@mon_race_2_1 ) { emotion e_lv; specialeffect EF_MVP; mapannounce "p_track02","Monster "+.@i+" has reached the Finish Line!",bc_map,"0x66FFCC"; set $@mon_race_2_1,.@i; donpcevent strnpcinfo(0)+"::OnDisable"; } else { emotion e_lv; specialeffect EF_MVP; mapannounce "p_track02","The race is over! Monster "+.@i+" has reached the Finish Line!",bc_map,"0x66FFCC"; set $@mon_race_2_2,.@i; donpcevent "#poring1::OnDisable"; donpcevent "#lunatic1::OnDisable"; donpcevent "#savagebebe1::OnDisable"; donpcevent "#desertwolf1::OnDisable"; donpcevent "#deviruchi1::OnDisable"; donpcevent "#baphomet1::OnDisable"; donpcevent "TrapGlobal#race02::OnDisable"; enablenpc "Medal Distributor#medal"; donpcevent "#race_timer2-3::OnEnable"; } end;
Better to get it fixed in the source, but I couldn't figure out how to with my limited knowledge.
OnTouch: -> Triggers when player comes near
OnTouchNPC: -> Triggers when monsters come near.
and that works fine(atleast when I tested)
I will try to optimize the script.
OnTouchNPC: -> Triggers when monsters come near.
and that works fine(atleast when I tested)
I will try to optimize the script.
It's not about triggering. Trigger it does, but when OnTouchNPC triggered with monster, script gets rid attached, which is of monster (monsters have rid too), so it TAKES COMMANDS LIKE THEY ARE TRIGGERED BY SOMEONE WITH RID, aka player. So with first check that will check for rid and use script->rid2sd, it will FAIL. Like getarraysize.
BUILDIN(getarraysize) { struct script_data* data; data = script_getdata(st, 2); if( !data_isreference(data) ) { ShowError("script:getarraysize: not a variable\n"); script->reportdata(data); script_pushnil(st); st->state = END; return false;// not a variable } script_pushint(st, script->array_highest_key(st,st->rid ? script->rid2sd(st) : NULL,reference_getname(data),reference_getref(data))); return true; }