Jump to content

Script to run when enters cell


assterixxx

Recommended Posts

Nothing big really. First off I want to kick in a DisablePlayerControls for a couple of secs, then I want to run a quest that populates dummys from aliases. Thats it. Guess I could have the dummy quest on a sm node with the DisablePlayerControls on that too, but I was looking for a more... right way of doing it - if you get what I mean.

 

Edit: And please don't suggest some OnInit event on the floor tile where I enter.

Edited by assterixxx
Link to comment
Share on other sites

Thanks for the reply Ghaunadaur. I wasn't really looking for what event to use, although it's a nice bonus! But isn't there a "real" place to attach that dang script? Putting it on a floor tile/room marker would make me feel so... dirty! Edited by assterixxx
Link to comment
Share on other sites

Thanks for the reply Ghaunadaur. I wasn't really looking for what event to use, although it's a nice bonus! But isn't there a "real" place to attach that dang script? Putting it on a floor tile/room marker would make me feel so... dirty!

 

It's not a bonus, it's the main thing to fire your script when you want it to. And what is a "real" place?

 

For instance, I'm using OnCellAttach() and OnCellDetach() events in a script for a light switch to register/unregister for update events. So far I can tell, it works reliable. The script is attached to a light, obviously.

 

-

Edited by Ghaunadaur
Link to comment
Share on other sites

I need a cold shower after hearing about that light switch... :tongue:

 

I just spent ½ a day looking for some place to attach a script to the cell itself, not to an object in the cell. That is just what seems logical in my little world. But don't mind me, last time I did any modding was for Warcraft III... There you had a "master" place to do stuff that related to the entire map, if that makes any sense...

 

But I appreciate the time you all took to answer my (obviously) dumb question.

Link to comment
Share on other sites

You could set up a quest alias for the player, then put a script on this alias that has an OnLocationChange() event, and check if the new location is the cell where you want to do your stuff.

 

ScriptName My_Player_Alias_Script extends ReferenceAlias

Location Property MySpecialCell auto
int Property stagenumber auto

Event OnLocationChange(Location akOldLoc, Location akNewLoc)
If akNewLoc == MySpecialCell
	Game.DisablePlayerControls()
	GetOwningQuest.SetStage(stagenumber)
	Game.EnablePlayerControls()
EndIf
EndEvent

 

Alternatively, you could possibly create a quest alias for an item in your special location, eg. a floor tile, then put a script on the floor tile's alias, with an OnCellAttach() event. This would save you having to "dirty" the actual object.

Edited by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

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