Jump to content

Scripters: Is there a global cell or something you can hook on too?


grey79

Recommended Posts

So basically I need my script to be run when the game runs.

Not when an object is clicked.

And not when I move into a trigger.

 

Anyone know how to do that?

 

Can I attach my script to the player somehow maybe?

 

EDIT:

Found this later.

You can attach a script to the player actor.

Search for "Player" under actors.

Edited by grey79
Link to comment
Share on other sites

Here's something I did:

 

I need to add a perk the first time a player uses my mod so I made a new quest. The initial stage immediately advanced the quest to the next stage which then ran a script to add the perk to the player.

 

You can see yourself in my mod in my sig, both the destruction and illusion esps have a quest that starts with ocy in the editorid.

Link to comment
Share on other sites

Have you figured out how to initialize a property with a complex object?

All the examples seem to only show simple types like float and string.

 

The compiler doesn't like this much:

ObjectReference property riftenMapMarker = "MapMarker 3400CED" auto

Link to comment
Share on other sites

Should have been more clear.

I know of what you speak, but the problem is when you change a property in your script you have to reselect it from the GUI - something I was hoping to avoid by supplying the reference IN the script.

:)

 

EDIT

 

Can you post the source of the initializing part of your script?

I've attached it to a quest like yours - but nothing happens.

Edited by grey79
Link to comment
Share on other sites

Forgot I didn't include the source

 

The first fragments are the startup stage(0) and the second fragment is the complete stage(100)

 

Destruction:

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 4
Scriptname QF_OCY_Dest00_02001565 Extends Quest Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
SetStage(100)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_2
Function Fragment_2()
;BEGIN CODE
if(!player.hasperk(DestructionScalePerk))
    player.addperk(DestructionScalePerk)
Endif
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Actor Property Player  Auto  

Perk Property DestructionScalePerk  Auto   

 

Illusion:

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 6
Scriptname QF_OCY_Illu00_010012C6 Extends Quest Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
SetStage(100)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_1
Function Fragment_1()
;BEGIN CODE
if(!Player.hasperk(IllusionScalePerk))
    Player.addperk(IllusionScalePerk)
Endif
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Actor Property Player  Auto  

Perk Property IllusionScalePerk  Auto

Edited by Ocyris
Link to comment
Share on other sites

  • Recently Browsing   0 members

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