Spaztrooper Posted December 20, 2013 Share Posted December 20, 2013 I am new to the GECK and just started learning scripting. My question: If the player were to activate an object how could I make an event or object appear because of that action? Ex: I activate a button and sandbags appear around a town. Much appreciated, Spaz Link to comment Share on other sites More sharing options...
MartinPurvis Posted December 20, 2013 Share Posted December 20, 2013 You would attach a script with an OnActivate block to the object. So in its most basic form... SCN activationscpt Begin OnActivate Player ;only applies to the player Player.additem Caps001 5 ;adds five caps to players inventory End That script would add 5 caps every time the player interacts with the object. Still stuck? Go through the G.E.C.K. tutorials until you understand. Link to comment Share on other sites More sharing options...
Spaztrooper Posted December 20, 2013 Author Share Posted December 20, 2013 You would attach a script with an OnActivate block to the object. So in its most basic form... SCN activationscpt Begin OnActivate Player ;only applies to the player Player.additem Caps001 5 ;adds five caps to players inventory End I understand this but I guess what I should have asked is: How do I use this type of script (activating an object) to add objects (cars, houses, turrets) to the map not the players inventory. Would I use the objects ID and some how link it to where I want it to appear?... Link to comment Share on other sites More sharing options...
MartinPurvis Posted December 20, 2013 Share Posted December 20, 2013 Well one way to do it is to place the object where you want it in the G.E.C.K. and double click it, give its reference a name (for example, objectAREF) and tick initially disabled. So you would change the script to... SCN activationscpt short doOnce Begin OnActivate Player ;only applies to the player if (doOnce == 0) && (objectAREF.GetDisabled == 1) objectAREF.enable ;makes your object appear in game set doOnce to 1 else return endif End Link to comment Share on other sites More sharing options...
Spaztrooper Posted December 20, 2013 Author Share Posted December 20, 2013 SCN activationscpt short doOnce Begin OnActivate Player ;only applies to the player if (doOnce == 0) && (objectAREF.GetDisabled == 1) objectAREF.enable ;makes your object appear in game set doOnce to 1 else return endif End I do believe this will help! Thanks. Link to comment Share on other sites More sharing options...
MartinPurvis Posted December 20, 2013 Share Posted December 20, 2013 Good luck dude! Link to comment Share on other sites More sharing options...
Recommended Posts