Why does this not work?

Post » Mon Jun 18, 2012 9:41 pm

I created a new trigger around a static.

I created this script

Scriptname MachinaAeronauticaScript extends ObjectReference
{Machina Aeronautica Message}
Event OnActivate(ObjectReference TriggerRef)
if TriggerRef == Game.GetPlayer()
Debug.Messagebox("This ancient Dwemer machinery is what makes this fort float. To bad it's broken so you can't fly it around like in ancient days.")
Endif
EndEvent


My intention was to be able to activate the box around the static and get the message. It doesn't do that. Where did I go wrong?
User avatar
Isaac Saetern
 
Posts: 3432
Joined: Mon Jun 25, 2007 6:46 pm

Post » Mon Jun 18, 2012 7:59 pm

I created a new trigger around a static.

I created this script

Scriptname MachinaAeronauticaScript extends ObjectReference
{Machina Aeronautica Message}
Event OnActivate(ObjectReference TriggerRef)
if TriggerRef == Game.GetPlayer()
Debug.Messagebox("This ancient Dwemer machinery is what makes this fort float. To bad it's broken so you can't fly it around like in ancient days.")
Endif
EndEvent


My intention was to be able to activate the box around the static and get the message. It doesn't do that. Where did I go wrong?

Did you set it so that the script uses the unique ID from the static object found in the game world? (not the ID for the base object but a unique ID for that 1 static object encountered in the game world)

:bunny:
User avatar
Roy Harris
 
Posts: 3463
Joined: Tue Sep 11, 2007 8:58 pm

Post » Mon Jun 18, 2012 5:03 pm

If you're using a trigger box, use event http://www.creationkit.com/OnTrigger_-_ObjectReference, http://www.creationkit.com/OnTriggerEnter_-_ObjectReference, or http://www.creationkit.com/OnTriggerLeave_-_ObjectReference. Triggers are not Activated, to my knowledge.
User avatar
Jerry Jr. Ortiz
 
Posts: 3457
Joined: Fri Nov 23, 2007 12:39 pm

Post » Tue Jun 19, 2012 1:16 am

Well I didn't do more than I posted so I guess I didn't.

How would I go about correcting the mistake?

And just to clarify this for me. WHAT do I actually activate the static or the box around it? I thought I couldn't activate statics and that the box was the activated thing and the static was just there to be pretty.
User avatar
kevin ball
 
Posts: 3399
Joined: Fri Jun 08, 2007 10:02 pm

Post » Tue Jun 19, 2012 1:21 am

Activators are anything in the world that can be "used"; beds, chests, levers, buttons. You are correct that statics cannot be activated.

Trigger boxes fire the events listed above when an Actor steps into them.
User avatar
Anthony Rand
 
Posts: 3439
Joined: Wed May 09, 2007 5:02 am

Post » Mon Jun 18, 2012 8:52 pm

If you're using a trigger box, use event http://www.creationkit.com/OnTrigger_-_ObjectReference, http://www.creationkit.com/OnTriggerEnter_-_ObjectReference, or http://www.creationkit.com/OnTriggerLeave_-_ObjectReference. Triggers are not Activated, to my knowledge.

Ah ok... but there are boxes in front of the racks etc that you can activate.. I need one like that, one I can activate. I'm pretty sure I don't want to use Ontriggerenter or ontriggerleave (though it would be a solution of sorts maybe) does on trigger mean I can activate it.
I would like to see the option to activate (or whatever the proper term) the item or the box around it. (like racks.)
User avatar
Eilidh Brian
 
Posts: 3504
Joined: Mon Jun 19, 2006 10:45 am

Post » Tue Jun 19, 2012 4:34 am

Activators are anything in the world that can be "used"; beds, chests, levers, buttons. You are correct that statics cannot be activated.

Trigger boxes fire the events listed above when an Actor steps into them.


So I can't activate the static.. I sort of knew that but can't I make some sort of "activator box" around/ infront of my static that I can activate?
User avatar
Daniel Holgate
 
Posts: 3538
Joined: Tue May 29, 2007 1:02 am

Post » Tue Jun 19, 2012 2:15 am

So I can't activate the static.. I sort of knew that but can't I make some sort of "activator box" around/ infront of my static that I can activate?

A "GetRadius" function may have worked but that was with the GECK (if the player is close enough the script commands are executed).

The Creation Kit may be different.
User avatar
Etta Hargrave
 
Posts: 3452
Joined: Fri Sep 01, 2006 1:27 am

Post » Tue Jun 19, 2012 3:27 am

So I can't activate the static.. I sort of knew that but can't I make some sort of "activator box" around/ infront of my static that I can activate?

If you want the player to Activate the object instead of triggering when they're near it, it would probably be simpler to create a new Activator object and use the same .nif file as the static you're already trying to use. Place that into the world instead and attach a script with the OnActivate event block.
User avatar
Chica Cheve
 
Posts: 3411
Joined: Sun Aug 27, 2006 10:42 pm

Post » Tue Jun 19, 2012 5:14 am

Good point. Where are the nif files stored, when I duplicate another activator and want to replace the nif file I can't copy paste the static nif's location for some reason
User avatar
Nikki Lawrence
 
Posts: 3317
Joined: Sat Jul 01, 2006 2:27 am

Post » Mon Jun 18, 2012 8:49 pm

SO for models classed as activators you don't need a box either (all those boxes are trigger boxed or do others exist?)
User avatar
Natasha Callaghan
 
Posts: 3523
Joined: Sat Dec 09, 2006 7:44 pm

Post » Mon Jun 18, 2012 6:02 pm

They're stored in the .bsa archives used by Skyrim.

There's a workaround: go to the static whose .nif you would like to use. Copy down the file path. For instance, "\clutter\Containers\Satchel.nif".

Then, navigate to your skyrim folder, and open the Data folder. Inside this folder, re-create the file-path of the .nif you want to use. (in this example, I would create a "clutter" folder, then inside of it, create a "Containers" folder). Create a blank .nif file with the same name by creating a new text file, and renaming it "name.nif" (in this case, "Satchel.nif").

Now, in the CK, on your Activator, go to Browse, and navigate to the file path where you created the "dummy" .nif file. If you did this correctly, when you select the dummy file, the actual model should show up. If not, check your spelling and ensure the path and filename match correctly.

After this you must delete the dummy .nif file or you will get missing model errors (red !'s) in-game.
User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Mon Jun 18, 2012 4:43 pm

Btw due to this talk i DID already fix another problem I had with an activator. I'll try this .nif switching trick now.
User avatar
Nicole Mark
 
Posts: 3384
Joined: Wed Apr 25, 2007 7:33 pm

Post » Tue Jun 19, 2012 3:59 am

I want to throw in another problem I've got here I think the basis of the problem is about the same, me not understanding about how you relate items and scripts correctly (I think the script is correct).

this is the current script

[size="1"]Scriptname TeleportscriptAezeal extends ObjectReference [/size][size="1"]ObjectReference Property MyMarker auto[/size][size="1"]Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)[/size][size="1"]if (akNewContainer == Game.GetPlayer())[/size][size="1"]akNewContainer.MoveTo(MyMarker) [/size][size="1"]EndIf[/size][size="1"]EndEvent [/size]

but I used this one

[size="1"]Scriptname Aezealkeyscript2 extends ObjectReference [/size][size="1"]Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) [/size][size="1"]if akSourceContainer == Game.GetPlayer() [/size][size="1"]akSourceContainer.MoveTo(MyMarker) [/size][size="1"]endIf [/size][size="1"]endEvent [/size][size="1"]ObjectReference Property MyMarker auto[/size]

too and that last one was give to me by someone who was sure it would work.

I just added that to an item and I set the property for -my marker- to the correct x-marker

Where is THIS one going wrong? It SHOULD teleport me each time I pick the item up.
User avatar
Emma Copeland
 
Posts: 3383
Joined: Sat Jul 01, 2006 12:37 am

Post » Mon Jun 18, 2012 9:39 pm

the nif trick isn't working btw
User avatar
Mandi Norton
 
Posts: 3451
Joined: Tue Jan 30, 2007 2:43 pm

Post » Mon Jun 18, 2012 10:15 pm

You can specify that a trigger box is activated by the player, and link it to an activator, but this is currently bugged. The only way you can do it is by copying an existing reference with that property -- setting it yourself doesn't work.

But unless you really need an invisible activator, it's probably better just to make a normal one that you can place in the world. Create an activator, and just use the model for the static.

What about the dummy nif trick isn't working? Does the file not show up in the dialogue box, or does it just not display the model correctly?
User avatar
Max Van Morrison
 
Posts: 3503
Joined: Sat Jul 07, 2007 4:48 pm

Post » Mon Jun 18, 2012 4:30 pm

Late to the party, but if you check "Player Activation" on the Primitive tab of a trigger/activator, it should become clickable, as long as the object has a name. Not sure if that's what you're looking for.
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Mon Jun 18, 2012 8:21 pm

I\ll look into that primitive tab.. player activation sounds like what I need :D

about that .nif trick. I can't check now but I thought it just said: can't find file or something.(I double checked spelling so that shouldn't be it)
User avatar
Mr.Broom30
 
Posts: 3433
Joined: Thu Nov 08, 2007 2:05 pm

Post » Mon Jun 18, 2012 11:59 pm

Aezeal: do you have file extensions turned on in Windows? If not, you're actually naming the file name.nif.txt. Verify that you have file extensions turned on. If it still doesn't work, your path / filename is wrong.
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Post » Tue Jun 19, 2012 1:29 am

That is what I first created.. but then I saved it in wordpad as .nif selecting all extentions option and it show as a .nif file
I do have to save it in the date folder in the steamapp/skyrim folder right?
User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm

Post » Mon Jun 18, 2012 3:19 pm

Late to the party, but if you check "Player Activation" on the Primitive tab of a trigger/activator, it should become clickable, as long as the object has a name. Not sure if that's what you're looking for.

Joel, it's been mentioned a couple times on the forum, including in the big CK bug list, but what you suggest does not currently work in the build available to us end-users. The checkbox is there, but does not work.
User avatar
NAkeshIa BENNETT
 
Posts: 3519
Joined: Fri Jun 16, 2006 12:23 pm

Post » Tue Jun 19, 2012 5:18 am

Solution found: the reason it didn't work was because the activator didn't have a name. (only a base ID name).

Thnx to Joel, even though he was talking about trigger boxes and the primitive tab: the name was the thing.
User avatar
Strawberry
 
Posts: 3446
Joined: Thu Jul 05, 2007 11:08 am

Post » Mon Jun 18, 2012 10:45 pm

I don't know if you still need help with your script but I can point to what is wrong.

Scriptname Aezealkeyscript2 extends ObjectReference Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if akSourceContainer == Game.GetPlayer() akSourceContainer.MoveTo(MyMarker) endIf endEvent ObjectReference Property MyMarker auto

akSourceContainer, as name suggests, returns an actor or object that is the source of the item. I.e. it may be a box you took the key from or an NPC that gave it to player. So this script won't work.

In order to make it work you would have to add the script to the player himself, and then remove the "if akSourceContainer == Game.GetPlayer()". As you may have already figured out, a script added only to the player that works when an item is added to the inventory will logically only work when it is the player's inventory.

But I don't think you should add scripts to the player.

Use the first script. It's from wiki, I think. And it's correct.



PS. An interesting twist would be to teleport the player when he places an item -- the key -- inside a box. It makes some sense, as the key could activate some mechanism. So, in this case, we WOULD use an OnAddItem event. It would look like this:
Spoiler
Scriptname TeleportKey extends ObjectReferenceObjectReference Property Key  AutoObjectReference Property XMarker  AutoEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) 	if akSourceContainer == Game.GetPlayer() && akItemReference == Key 	; if any key of that type -- any teleport key -- would do, we would use akBaseItem.		Game.GetPlayer().MoveTo(XMarker)	endifEndEvent
User avatar
Adam Kriner
 
Posts: 3448
Joined: Mon Aug 06, 2007 2:30 am


Return to V - Skyrim