the Sim Settlements forums!

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

An interesting use of a Player ReferecneAlias

msalaba

Well-Known Member
Community Rockstar
Messages
1,551
I saw this interesting tid bit posted by Halstrom over at Lover's Lab. Seems like it could have uses beyond what is described.

You can also create an Alias in the quest based on the Player and add your scripts to that, you don't needt to register OnPlayerGameLoad then, it allows you to use pretty much every function then otherwise you may finding stuff you can't do in quest scripts or actor scripts without causing dirty edits.

Scriptname SynthPlayer:Synth4Power extends ReferenceAlias

Code:
Scriptname SynthPlayer:Synth4Power extends ReferenceAlias

{Power Management}

Group Misc
    Quest Property qMQ101 Auto Const
EndGroup

;-----------------------------------------------------------------------------------------------------------------------------

Actor rActor
String sScriptName = "Power"
Int iBootup
Int iDebugSetting

;-----------------------------------------------------------------------------------------------------------------------------

Event OnInit()
    Utility.Wait(1.0)
    rActor = Game.GetPlayer()
    fPowerLevel = 80.0
    fnInit()
    StartTimer(fFrequencyTimer, iTimerID)
EndEvent

Event OnPlayerLoadGame()
    fnInit()
EndEvent

Function fnInit()
    fPrevTime = Utility.GetCurrentGameTime()
EndFunction

Can you call ObjectReference events in a ReferenceAlias script? i.e. Player grabs item, set next quest stage.
I'm not well versed in aliases, but if it can work this way, it would be really useful!
 
Top