![]() |
Random Target - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +------ Forum: Bugs Reports (https://mirage-engine.uk/forums/forumdisplay.php?fid=9) +------ Thread: Random Target (/showthread.php?tid=3132) |
Random Target - Xlithan - 11-09-2009 Ok. Currently, the monster attacks the first person that enters the room, and only choose one target per hit. I want the monster to randomly pick a target out of all the players in the room. This is the part of the code in the GameAI sub that gives the NPC a target. If anybody could add the bit of code needed to randomly select the target that would be great. Code: If NpcNum > 0 Then Re: Random Target - Xlithan - 22-09-2009 ![]() Re: Random Target - Joost - 07-10-2009 Code: If NpcNum > 0 Then Re: Random Target - GIAKEN - 07-10-2009 I think we're all waiting for him to bump the topic a bit more. Re: Random Target - Xlithan - 08-10-2009 Hmm, can't seem to understand arrays. I've read up but still unsure how I'd add each player id into the array.... |