Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Activate on furniture


claptovaughn
 Share

Recommended Posts

I'm trying to make a script that causes a spell to be cast on the player once they get up from a particular chair. I've decided to start slow so for now I'm just trying to make it give a debug message upon getting up from the chair. Here is what I've written so far:
 

Scriptname ChairMessage extends ObjectReference


{Test Script}

Event OnGetUp(ObjectReference akFurniture)
Debug.MessageBox("Good Bye")
endEvent



When I test it...it does nothing. What am I missing? 

Link to comment
Share on other sites

I have not used this, but here is what I understand from the wiki:

 

What is the script attached to?

Its an actor script, which means you would have to place it on the player for it to work on the player. And 'akFurniture' would be populated with the furniture item the player just got up from. That means, it would fire off when the player gets up from any furniture. You would have to check for your furniture item.

 

I usually steer clear from this sort of thing, preferring the 'onActivate' event instead, and just cast the spell on them when they sit, instead of get up.

Link to comment
Share on other sites

The script is attached to a chair. I want the player to receive a spell (or in this case, simply get a message) from that one chair only. 

 

Yeah, I figured using onactivate on the chair would be simpler, but for purely aesthetic reasons I wanted the spell to hit only once they get up. I'll go back to onactivate, then.

 

Another question, can I cast calm on myself with a cloak effect? So it essentially calms every hostile around me within a certain radius? I'm just curious if the game even allows this at all, because I don't recall ever seeing a calm spell with an area-of-effect. Or can furniture cast calm in a radius?

Edited by claptovaughn
Link to comment
Share on other sites

In the meantime, I'm still trying to figure out how to cast a spell from activating an object.

 

In this next test, I'm just trying to get the chair to paralyze me upon activating (sitting on) it. 

 

 

 

Scriptname paralyze extends ObjectReference
{Test Script}

Spell property PARALYZE Auto

EVENT OnActivate(ObjectReference akActionRef)
; Cast a spell on player
paralyze.Cast(Self, akActionRef)

endEvent

 

 

I'm using paralyze simply because I found this script on another board and couldn't find any examples of the spells I actually wanted to use. It doesn't work for me however. 

Link to comment
Share on other sites

I get this error message when I try to compile:

 

 

Starting 1 compile threads for 1 files...
Compiling "Paralyze"...
F:\Games\Skyrim Modding\Data\Scripts\Source\temp\Paralyze.psc(3,16): cannot name a variable or property the same as a known type or script
F:\Games\Skyrim Modding\Data\Scripts\Source\temp\Paralyze.psc(7,9): Cast is not a function or does not exist
F:\Games\Skyrim Modding\Data\Scripts\Source\temp\Paralyze.psc(7,9): cannot call the member function Cast alone or on a type, must call it on a variable
No output generated for Paralyze, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on Paralyze


This is the script I wrote:

 

 

Scriptname Paralyze extends ObjectReference

Spell property PARALYZE Auto

EVENT OnActivate(ObjectReference akActionRef)
; Cast a spell on player
paralyze.Cast(akActionRef, akActionRef)

endEvent

Edited by claptovaughn
Link to comment
Share on other sites

You cannot 'rename' a script. You have to create a new script if your going to change the script name. And delete the old one.

 

Your getting cast errors because it cannot use the spell name of 'paralyze' because of the previous error.

Edited by WillieSea
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...