Jump to content

Testing spawn grenade not working


Recommended Posts

Scriptname _gkx_spawngrenadescript extends objectreference

Group Messages

	Message Property MainMenu Auto
	Message Property Animals Auto
	Message Property Robots Auto
	Message Property Enemies Auto
	Message Property Monsters Auto
	Message Property Gangs Auto
	Message Property CountMenu Auto

EndGroup

Group Foes

	LeveledActor[] Property AnimalArray Auto
	LeveledActor[] Property RobotArray Auto
	LeveledActor[] Property EnemyArray Auto
	LeveledActor[] Property MonsterArray Auto
	LeveledActor[] Property GangArray Auto
	Int[] Property CountArray Auto

EndGroup

Struct FoeChoice

	LeveledActor Foe
	Int NumFoe

EndStruct

FoeChoice Temp1
FoeChoice Final
Int MainChoice
Bool Hold = False

FoeChoice Function SubMenu(Message MenuMsg, Message NumMsg, LeveledActor[] FoeArray, Int[] FoeCount)

	FoeChoice SpawnMe
	Int FoeIndex = MenuMsg.Show()
	SpawnMe.Foe = FoeArray[FoeIndex]
	Int NumChoice = NumMsg.Show()
	SpawnMe.NumFoe = FoeCount[NumChoice]
	Hold = False
	Return SpawnMe
	
EndFunction
	

Event OnInit()

	debug.notification("Marker placed.")
	Hold = True
	MainChoice = MainMenu.Show()
	If MainChoice == 0
		Temp1 = SubMenu(Animals, CountMenu, AnimalArray, CountArray)
	ElseIf MainChoice == 1
		Temp1 = SubMenu(Robots, CountMenu, RobotArray, CountArray)
	ElseIf MainChoice == 2
		Temp1 = SubMenu(Enemies, CountMenu, EnemyArray, CountArray)
	ElseIf MainChoice == 3
		Temp1 = SubMenu(Monsters, CountMenu, MonsterArray, CountArray)
	ElseIf MainChoice == 4
		Temp1 = SubMenu(Gangs, CountMenu, GangArray, CountArray)
	Else
		Return
	EndIf
	Final = Temp1
	While Hold == True
		Utility.Wait(0.5)
	EndWhile
	debug.notification("Placing [" + Final.NumFoe + "] enemies.")
	PlaceAtMe(Final.Foe, Final.NumFoe)
	Utility.Wait(2.0)
	Delete()

EndEvent

Using this script, I get:

 

[ Marker Placed. ]

[ Placing 0 Enemies ]

 

and no spawns.

 

Here's my properties

wcG6s7I.png

 

 

Any ideas?

Thanks in advance,

~GKX

Edited by GenghisKhanX
Link to comment
Share on other sites

Its a Struct syntax error that is not picked up by the compiler:

FoeChoice Temp1   = New FoeChoice
FoeChoice Final   = New FoeChoice
FoeChoice SpawnMe = New FoeChoice
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...