Jump to content

Recommended Posts

Posted

I want to run a script to run every time I enter a cell. Nothing big, right? Where the he** do I attach it? I mean I could do a sm node in the Change Location Event, but isn't there a simpler way then to build a quest just to run a script?

 

Thanks

Posted

Depending on what you want the script to do, there are different ways to run the cell loading event.

 

So, what do you want the script to do when you enter a cell?

Posted (edited)

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
Posted (edited)
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
Posted
Maybe you could put a statue of Mara in the cell to attach your script to, since you are looking for something that is not dirty like a floor tile.
Posted
  Quote
...statue of Mara...

 

LAWL! That's just awesome.

But is that really the solution you big guys use? Attach a script to a random object? I guess I have to yield, then. But it still don't feel right...

Posted (edited)
  On 9/20/2012 at 4:56 PM, assterixxx said:

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
Posted

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.

Posted (edited)

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
  • Recently Browsing   0 members

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