Hey guys. I'm trying to make a "semi-official" custom implementation of the Wave Mode memorial dungeon from scratch and I'm having trouble getting unitwalk to work the way I want it to.
First of all it seems like it will invariably fail if the path is too long, for example it works if I set the unitwalk coordinates to 50,70 or 50,65 it works. But if I set them to 50,50 it fails and returns a false, and for some reason it still triggers the event label a stupid amount of times(see image). This can probably be fixed by chaining together multiple event labels to make the monsters walk a short distance and then make it walk another short distance, but it seems like a stupid work around for a problem that shouldn't exist in the first place.
The second problem is that if you hit a monster it will stop walking and not attempt to start walking again(see image). I don't know if this is intended behavior or not but I can't find a work around for this.
It should also be noted that I didn't try to use the unitwalk to GID function, so it's possible that that one works better. But I was wondering if anyone knows any work arounds and if this is intended behavior or if it's bugged. Thanks.
Edit: Forgot to include the script, I'm retarded. Here it is:
1@def01,1,1,1 script WaveModeForestSystem -1,{
OnInstanceInit:
set 'WaveNum,1; //Number of waves completed
set 'MonsterBreach,0; //Number of monsters that breached the defense
set 'GID,0; //GID of monster units to make them walk over the bridge
disablenpc instance_npcname(strnpcinfo(0));
end;
OnStartTimer:
initnpctimer;
end;
OnTimer10000:
mapannounce instance_mapname("1@def01"),"-- Wave " + 'WaveNum + " --",bc_map;
switch('WaveNum % 70)
{
case 1:
for(set .@i,0; .@i < 20; ++.@i)
{
set 'GID,bg_monster(0,instance_mapname("1@def01"),50,77,"Poring",2401);
unitwalk 'GID,50,50,instance_npcname(strnpcinfo(0))+"::OnMonsterBreached";
sleep 50;
}
break;
default:
mapannounce instance_mapname("1@def01"),"Something went wrong",bc_map;
end;
break;
}
'WaveNum++;
end;
OnMonsterBreached:
'MonsterBreach++;
if('MonsterBreach != 1)
mapannounce instance_mapname("1@def01"),'MonsterBreach+" monsters have escaped.",bc_map;
else
mapannounce instance_mapname("1@def01"),"1 monster has escaped.",bc_map;
end;
}
Question
MasterOfMuppets
Hey guys. I'm trying to make a "semi-official" custom implementation of the Wave Mode memorial dungeon from scratch and I'm having trouble getting unitwalk to work the way I want it to.
First of all it seems like it will invariably fail if the path is too long, for example it works if I set the unitwalk coordinates to 50,70 or 50,65 it works. But if I set them to 50,50 it fails and returns a false, and for some reason it still triggers the event label a stupid amount of times(see image). This can probably be fixed by chaining together multiple event labels to make the monsters walk a short distance and then make it walk another short distance, but it seems like a stupid work around for a problem that shouldn't exist in the first place.
The second problem is that if you hit a monster it will stop walking and not attempt to start walking again(see image). I don't know if this is intended behavior or not but I can't find a work around for this.
It should also be noted that I didn't try to use the unitwalk to GID function, so it's possible that that one works better. But I was wondering if anyone knows any work arounds and if this is intended behavior or if it's bugged. Thanks.
Edit: Forgot to include the script, I'm retarded. Here it is:
1@def01,1,1,1 script WaveModeForestSystem -1,{ OnInstanceInit: set 'WaveNum,1; //Number of waves completed set 'MonsterBreach,0; //Number of monsters that breached the defense set 'GID,0; //GID of monster units to make them walk over the bridge disablenpc instance_npcname(strnpcinfo(0)); end; OnStartTimer: initnpctimer; end; OnTimer10000: mapannounce instance_mapname("1@def01"),"-- Wave " + 'WaveNum + " --",bc_map; switch('WaveNum % 70) { case 1: for(set .@i,0; .@i < 20; ++.@i) { set 'GID,bg_monster(0,instance_mapname("1@def01"),50,77,"Poring",2401); unitwalk 'GID,50,50,instance_npcname(strnpcinfo(0))+"::OnMonsterBreached"; sleep 50; } break; default: mapannounce instance_mapname("1@def01"),"Something went wrong",bc_map; end; break; } 'WaveNum++; end; OnMonsterBreached: 'MonsterBreach++; if('MonsterBreach != 1) mapannounce instance_mapname("1@def01"),'MonsterBreach+" monsters have escaped.",bc_map; else mapannounce instance_mapname("1@def01"),"1 monster has escaped.",bc_map; end; }
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.