X-Marker (One object activates another)

Post » Sat Nov 17, 2012 10:38 am

Ok... I know this is easy for some of you, so that’s why I’m here..

I’m a total noob when it comes to scripting, but I need to get this done, because my mod is a total must for me ;-)

Scenario:

I have an object ( a sign ) I want this object to be active, so I can click it and get an option. if i click YES a new object will appear next to the sign, and the sign will disappear. I know all this can be done with an X-marker.

I want the sign only to give me the yes/no option if i have a certain object in my inventory, else it will say " you don’t have the object bla bla bla "

This should all be possible with the same system that gives you furniture upgrade option, but I really don’t know where to start.

If there is someone with the brains to help me I will be forever grateful.

Thank you in advance

Nico
User avatar
Je suis
 
Posts: 3350
Joined: Sat Mar 17, 2007 7:44 pm

Post » Sat Nov 17, 2012 11:51 am

Sounds like you want to make the sign the enable parent of the other thing and set the other thing to "enable state opposite of parent".

Then when you disable the sign, the other thing will appear.

You could do it with an x-marker if you wanted. Parent both items to the xmarker and set one to "opposite of parent" then enabling or disabling the marker will make one of the child refs appear and the other one vanish.
User avatar
Matthew Warren
 
Posts: 3463
Joined: Fri Oct 19, 2007 11:37 pm

Post » Sat Nov 17, 2012 7:21 am

Sounds like you want to make the sign the enable parent of the other thing and set the other thing to "enable state opposite of parent".

Then when you disable the sign, the other thing will appear.

You could do it with an x-marker if you wanted. Parent both items to the xmarker and set one to "opposite of parent" then enabling or disabling the marker will make one of the child refs appear and the other one vanish.

Yep that was my idea....it was the scripting i was confused about.. no idea on how to make it aktivate/deactivate... i made the sign activator..but thats it
User avatar
Sabrina Schwarz
 
Posts: 3538
Joined: Fri Jul 14, 2006 10:02 am

Post » Sat Nov 17, 2012 11:20 am

Give the script an objectreference property. Set the value for the script in the CK and point it at the marker. Let's say you call it marker_ref.

then in the actual script you can say marker_ref.Disable() and marker_ref.Enable to toggle the marker.
User avatar
lillian luna
 
Posts: 3432
Joined: Thu Aug 31, 2006 9:43 pm

Post » Sat Nov 17, 2012 5:32 am

ObjectReference property MyPlayerRef AutoObjectReference property MyMarker AutoEvent OnActivate(ObjectReference akActionRef)  if akActionRef == MyPlayerRef   MyMarker.Disable()  endifEndEvent

Attach that to the sign, and assign the properties of MyPlayerRef to the player and MyMarker to your marker.

The hard part is getting the above mentioned opposite enable state of parent.

When you place your X Marker, select both the Sign and the object you want to appear. In the Cell window right click on them and select "set enable parent." and then select "find in reference window." From there click on your X Marker. Once thats done, go to the thing you want to appear and in the render window right click and it "edit", then go to the Enable Parent tab and highlight the "Set Enable State Opposite of Parent." Checkbox. Then save your work and try it out.
User avatar
Emma-Jane Merrin
 
Posts: 3477
Joined: Fri Aug 08, 2008 1:52 am

Post » Sat Nov 17, 2012 2:52 am

ObjectReference property MyPlayerRef AutoObjectReference property MyMarker AutoEvent OnActivate(ObjectReference akActionRef)  if akActionRef == MyPlayerRef   MyMarker.Disable()  endifEndEvent

Attach that to the sign, and assign the properties of MyPlayerRef to the player and MyMarker to your marker.

The hard part is getting the above mentioned opposite enable state of parent.

When you place your X Marker, select both the Sign and the object you want to appear. In the Cell window right click on them and select "set enable parent." and then select "find in reference window." From there click on your X Marker. Once thats done, go to the thing you want to appear and in the render window right click and it "edit", then go to the Enable Parent tab and highlight the "Set Enable State Opposite of Parent." Checkbox. Then save your work and try it out.

Do you need the player property? It would still work without it wouldn't it?

Probably a noob question, but so far I've only ever done activating through quest aliases/stages.

Edit: I think I get what you've done in that script. Instead of calling Game.GetPlayer, you're calling the property. My original question still stands though :P
User avatar
sally R
 
Posts: 3503
Joined: Mon Sep 25, 2006 10:34 pm

Post » Sat Nov 17, 2012 8:08 am

Do you need the player property? It would still work without it wouldn't it?

Probably a noob question, but so far I've only ever done activating through quest aliases/stages.

Edit: I think I get what you've done in that script. Instead of calling Game.GetPlayer, you're calling the property. My original question still stands though :tongue:
Do you need the player property? It would still work without it wouldn't it?

Probably a noob question, but so far I've only ever done activating through quest aliases/stages.

Edit: I think I get what you've done in that script. Instead of calling Game.GetPlayer, you're calling the property. My original question still stands though :tongue:

Yes it needs the property !!

I got it working !! i used a Hammer for testing..it will now activate the Marker if i have the hammer in my inventory, or disable it if i drop the hammer, all done with GetItemCount(itemref) == 0/1

Thank you all for your help.
User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm


Return to V - Skyrim