15gudasc Posted March 3, 2012 Share Posted March 3, 2012 how do I make a script that spawns raiders when the player enters a trigger? I want it to spawn a raider or two for one of the final parts of a quest. What would the script look like? I couldn't find anything on the Geck Wiki. I know the first part would probably be something like this: scn spwnraiders01 begin ontriggerenter player if getstage 1akillingdeath < 90???????????????????????????endif end Please note I am very new to scripting. I'm learning a lot, but I simply couldn't find anything anywhere on this. Thank you for your help! =)Oh, and the mod I'm working on is called Thrashfield if you're interested! Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted March 3, 2012 Share Posted March 3, 2012 What you actually want to do is enable the spawns or creatures. So to make this easy we'll assume you're not using leveled actors, but ones specially for this particular encounter. What you'll do is have a trigger with a script like what you have (To save space and my typing, I'm going to leave out variable initialization and script names):BEGIN OnTriggerEnter set myLinked to getLinkedRef if getStage 1akillingdeath < 90 ;It's not advisable to name things with numbers first myLinked.Enable endif ENDAssuming that all you need the trigger to do is just enable the enemies, that should do it. Where the Linked Ref is a disabled XMarker or some other object. Then, for your XMarker, you set it up somewhere (usually over the area, though it doesn't really matter), a set it to be linked to your trigger. Once you've set that up you go to each of your NPCs and open up their object properties, and set them to be Disabled. Then you set their Enable Parent to be your XMarker. So, the way it all works together:The player enters the trigger, which checks the quest stage. It sees that the player is at the correct point and enables its Linked Ref.The XMarker gets enabled (it is still invisible in game).Because the NPCs are set to be enabled via a parent, once the XMarker is enabled, they get enabled. If you're still lost, look at how they did them in game. A very good example is the Viper ambush just to the East of Nipton. You can type "vert2viper" in the filter box to see all the associated parts of it, and look for it GECK. Their version uses named Refs, which is also a way to do it, but means you can't reuse the same script without rewriting it later. PS. In the future, you can put your code in [ code ] blocks (without spaces) and it'll format like mine. Alternatively, you can hit the dual angle brace icon in the editor thing above. Link to comment Share on other sites More sharing options...
Recommended Posts