gerg357 Posted August 16, 2016 Author Share Posted August 16, 2016 Script isn't spawning anything... Link to comment Share on other sites More sharing options...
lofgren Posted August 16, 2016 Share Posted August 16, 2016 Well there is only a 25% chance that it will spawn anything. Link to comment Share on other sites More sharing options...
gerg357 Posted August 16, 2016 Author Share Posted August 16, 2016 Sorry I mean it says in msg box it's spawned like bandit seen but it's not placing them at one of the random spawn points Link to comment Share on other sites More sharing options...
lofgren Posted August 16, 2016 Share Posted August 16, 2016 Are the spawn points in the loaded area? Link to comment Share on other sites More sharing options...
gerg357 Posted August 16, 2016 Author Share Posted August 16, 2016 They are not... but I can use them by name like spawnpoint1 and it will spawn something there at that marker.. but activator is in another location.. Link to comment Share on other sites More sharing options...
gerg357 Posted August 16, 2016 Author Share Posted August 16, 2016 It'll spawn something at the marker if I call it by name when I leave room then it's there waiting it's only when I try the code you give me is where I'm having issues what I want to do is spawn stuff at a random location which would be from a list that I use I thought formlist would be what I need... maybe an array would be better? Link to comment Share on other sites More sharing options...
lofgren Posted August 16, 2016 Share Posted August 16, 2016 When you put the spawn point directly into a property, it makes the reference persistent so that it can be found and used even when it is not loaded. Putting the objects in a formlist doesn't have the same effect. Switching to an array should solve the issue. Link to comment Share on other sites More sharing options...
gerg357 Posted August 16, 2016 Author Share Posted August 16, 2016 Thx for the info now I'm off to learn about arrays Link to comment Share on other sites More sharing options...
gerg357 Posted August 16, 2016 Author Share Posted August 16, 2016 this is what i got so far playing with arrays from what little i could find online i dunno how to add a array to ck im guessing they are just form lists?? Scriptname TownCheckScript extends ObjectReferenceActorBase Property EncBandit01Melee1HNordM AutoActorBase Property WEDL05Thug AutoActorBase Property EncVampire01BretonF AutoObjectReference Property SpawnPoint1 AutoObjectReference Property SpawnPoint2 AutoObjectReference Property SpawnPoint3 AutoObjectReference Property SpawnPoint4 AutoObjectReference Property SpawnPoint5 AutoObjectReference Property SpawnPoint6 AutoObjectReference Property SpawnPoint7 AutoObjectReference Property SpawnPoint8 AutoMessage Property checkfail AutoMessage Property OffPatrol AutoMessage Property bandits1 AutoMessage Property bandits2 AutoMessage Property bandits3 AutoMessage Property nobandits AutoObjectReference[] Property spawnpoints AutoMessage Property thugs1 AutoMessage Property thugs2 AutoMessage Property thugs3 AutoMessage Property nothugs AutoMessage Property vampires1 AutoMessage Property vampires2 AutoMessage Property vampires3 AutoMessage Property novampires AutoMessage Property timesup Autofloat CheckTime ; the only status variable neededGlobalVariable Property OnPatrol AutoEvent OnActivate(ObjectReference akActionRef) if akActionRef != Game.GetPlayer() ; do not let other NPCs trigger this return endifif OnPatrol.GetValue() == 1 if CheckTime == 0.0 ; starting a shift CheckTime = 2.0 + Utility.GetCurrentGameTime() * 24.0 ; converts days to hours int spawns = spawnpoints.Length int randomm = Utility.RandomInt(0, spawns) int random = Utility.RandomInt(0, 6) ; Generates a random number between 0 and 2ObjectReference points = spawnpoints[randomm] If random == 0 int random1 = Utility.RandomInt(0, 6) ; Generates a random number between 0 and 2 If random1 == 0 points.PlaceActorAtMe(EncBandit01Melee1HNordM,1) bandits1.Show() ElseIf random1 == 1 bandits2.Show() points.PlaceActorAtMe(EncBandit01Melee1HNordM,2) points.PlaceActorAtMe(EncBandit01Melee1HNordM,2) ElseIf random1 == 3 bandits3.Show() points.PlaceActorAtMe(EncBandit01Melee1HNordM,3) points.PlaceActorAtMe(EncBandit01Melee1HNordM,3) points.PlaceActorAtMe(EncBandit01Melee1HNordM,3) Else nobandits.Show() EndIf ElseIf random == 1 int random2 = Utility.RandomInt(0, 6) ; Generates a random number between 0 and 2 If random2 == 0 points.PlaceActorAtMe(WEDL05Thug,1) thugs1.Show() ElseIf random2 == 1 thugs2.Show() points.PlaceActorAtMe(WEDL05Thug,2) points.PlaceActorAtMe(WEDL05Thug,2) ElseIf random2 == 3 thugs3.Show() points.PlaceActorAtMe(WEDL05Thug,3) points.PlaceActorAtMe(WEDL05Thug,3) points.PlaceActorAtMe(WEDL05Thug,3) Else nothugs.Show() EndIf ElseIf random == 3 int random3 = Utility.RandomInt(0, 6) ; Generates a random number between 0 and 2 If random3 == 0 points.PlaceActorAtMe(EncVampire01BretonF,1) vampires1.Show() ElseIf random3 == 1 vampires2.Show() points.PlaceActorAtMe(EncVampire01BretonF,2) points.PlaceActorAtMe(EncVampire01BretonF,2) ElseIf random3 == 3 vampires3.Show() points.PlaceActorAtMe(EncVampire01BretonF,3) points.PlaceActorAtMe(EncVampire01BretonF,3) points.PlaceActorAtMe(EncVampire01BretonF,3) Else novampires.Show() EndIf Else nobandits.Show() EndIf elseif Utility.GetCurrentGameTime() * 24.0 >= CheckTime ; have worked long enough CheckTime = 0.0 ; reset for next time timesup.Show() else ; not done yet! The message can show how many hours are left checkfail.Show() endifelseOffPatrol.Show()endif endEvent it is now spawning them in the room im using it in and not at the spawn points i was hoping i had this right but apparently not... any ideas whats wrong? Link to comment Share on other sites More sharing options...
lofgren Posted August 16, 2016 Share Posted August 16, 2016 You fill an array the same way you fill other properties, through the property dialogue on the object the script is attached to. Link to comment Share on other sites More sharing options...
Recommended Posts