Jump to content

Recommended Posts

Posted

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

Posted

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.
Posted

 

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?...

Posted

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
Posted
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.

  • Recently Browsing   0 members

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