grey79 Posted February 9, 2012 Share Posted February 9, 2012 (edited) 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 February 17, 2012 by grey79 Link to comment Share on other sites More sharing options...
Ocyris Posted February 9, 2012 Share Posted February 9, 2012 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 More sharing options...
grey79 Posted February 9, 2012 Author Share Posted February 9, 2012 Thanks, I'll check it out. Link to comment Share on other sites More sharing options...
grey79 Posted February 10, 2012 Author Share Posted February 10, 2012 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 More sharing options...
Ocyris Posted February 10, 2012 Share Posted February 10, 2012 Yes, if you're looking at one of my quests you go to the script tab click the script then hit the properties button. When you hit edit value you should be able to select the object you need. I helped another person with properties over here. Link to comment Share on other sites More sharing options...
grey79 Posted February 10, 2012 Author Share Posted February 10, 2012 (edited) 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 February 10, 2012 by grey79 Link to comment Share on other sites More sharing options...
Ocyris Posted February 10, 2012 Share Posted February 10, 2012 (edited) 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 February 10, 2012 by Ocyris Link to comment Share on other sites More sharing options...
grey79 Posted February 10, 2012 Author Share Posted February 10, 2012 Thanks for your help. I got it to work. Link to comment Share on other sites More sharing options...
Recommended Posts