A game I'm working on is a rouge-like turnbased sort of system that's evolved into a dice-roll-to-move type of gameplay.
The gameplay proceeds as follows:
1) You roll a die and it's a value from 1-6.
2) You are then able to walk your hero that many spaces and then end your turn.
3) Now every single NPC on the map get's their turn to move. They move one at a time. The code for this is called in the autorun and looks like this:
Code: Select all
script, moveNPCs, begin
variable(npc)
for(npc, -1, -300, -1) do(
if(get NPC id(npc) >= 0) then(
# this NPC exists
variable(i)
for(i, 0, 1) do(
set NPC speed(npc, 4)
wait
suspend NPCs
wait for NPC(npc)
set NPC speed(npc, 0)
resume NPCs
)
)
)
end
What I'd prefer is if I could somehow set some sort of data inside the editor which represents each NPC's movement range. I want every NPC to have it's own movement range. For example, guards always move 3 tiles, robots always move 4 tiles, etc... Is there anyway I can simply set each NPCs movement range in the editor and then pull that number into my code to modify how many times the for-loop iterates?