Here is the next development of the script, but I am now in need of some help:
;Artificial Intelligence Script
;Header
desc = Spawn Waves of Enemy Type Based on Kill Count
;Triggers
;Global Variable 1 is defined as the 'kill count' of the player
;Global Variable 2 is defined as the number of enemies remaining in the Level
;Global Variable 3 is defined as the number of enemies spawned
;Local Variable 3 is defined as the number of enemies to be spawned
;Global Variable 4 is defined as the location of the player (enemies are numbered according to the zone)
;Set up variables
:state=0:globalvar=1,setvar=0
:state=0:globalvar=2,setvar=10
:state=0:globalvar=3,setvar=0
:state=0:globalvar=4,setvar=0
:state=0:state=1
;Check enemies remaining in level
:state=1:globalvar=2
:state=1,vargreater=0:state=2
;Check current wave is eliminated
:state=2:globalvar=3
:state=2,varless=1:state=3
;Set number of enemies to spawn (change this if more than 1 enemy to be spawned at once)
:state=3:globalvar=2
:state=3,varless=2:localvar=3,setvar=1
:state=3:globalvar=2
:state=3,vargreater=1:localvar=3,setvar=1
:state=3:state=4
;Spawn enemies based on kill count in location based on player position
:state=4:globalvar=4
:state=4,varequal=1:state=10
:state=4,varequal=2:state=20
;Player in zone 1, spawn in zone 2
:state=10:globalvar=3,incvar=1
:state=10:localvar=3,decvar=1
:state=10:globalvar=1
:state=10,vargreater=7:settargetname=EnemyHard02,activatetarget=1,state=1
:state=10,vargreater=3:settargetname=EnemyMed02,activatetarget=1,state=1
:state=10,varless=4:settargetname=EnemyEasy02,activatetarget=1,state=1
;Player in zone 2, spawn in zone 1
:state=20:globalvar=3,incvar=1
:state=20:localvar=3,decvar=1
:state=20:globalvar=1
:state=20,vargreater=7:settargetname=EnemyHard01,activatetarget=1,state=1
:state=20,vargreater=3:settargetname=EnemyMed01,activatetarget=1,state=1
:state=20,varless=4:settargetname=EnemyEasy01,activatetarget=1,state=1
;End of Script
The script prevents all enemies from spawning until the player steps into the trigger zone.
Then it spawns an Easy enemy in zone 1. After killing this enemy, another Easy enemy is spawned in zone 2, but after killing this enemy is killed another Easy enemy is meant to spawn back in zone 1, but this does not happen. Can anyone help?
I've attached a pdf of how I tested the feature.
[url="http://raptr.com/No_Turn_Right?src=em_forum"]
[/url]