clintmich Posted April 8, 2012 Share Posted April 8, 2012 I am having trouble getting this script to compile. It should be a simple script. I want this script to run once the player enters a triggerbox and in doing so, it increases the NPC rank to ally. Here's what I have:--------------------------------------------------------------------------------------------------Actor Property Elkman Auto Actor Property Player Auto Int Property aiRank Auto Event OnTriggerEnter(ObjectReference Player) Debug.Trace(Player + " entered trigger!")EndEventFunction SetRelationshipRank(Actor Elkman, int aiRank) nativeElkman.SetRelationshipRank(Game.GetPlayer(), 3) EndFunction --------------------------------------------------------------------------------------------------------- I get this result instead of a successful compile.c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\zxzxzxzxelkmanscript.psc(13,6): no viable alternative at input '.'No output generated for zxzxzxzxelkmanscript, compilation failed. If there's any scripters out there who knows how to fix this problem, please respond. Thanks Link to comment Share on other sites More sharing options...
tunaisafish Posted April 8, 2012 Share Posted April 8, 2012 The debug output contains line numbers, so always supply the full script. I accounted for the missing header and it looked like the failure was after defining a new Function. You don't need to define the function, but just call it on an Actor like is done below on Elkman. The Events are called by the engine and will set the parameters for you. In this case it assigns akActionRef to whatever entered the trigger.It's a good idea to use the same variable names for the events as supplied. You don't need to create additional properties for them. ScriptName zxzxzxzxelkmanscript extends ObjectReference Actor Property Elkman Auto ; Set this in the CK Int Property aiRank = 3 AutoReadOnly ; A constant we use later in the script. 3 == Allies Event OnTriggerEnter(ObjectReference akActionRef) if (akActionRef != Game.GetPlayer()) Return ; Ignore all actors except the player EndIf Debug.Trace("Player entered trigger!") Elkman.SetRelationshipRank(akActionRef As Actor, aiRank) EndEvent Link to comment Share on other sites More sharing options...
clintmich Posted April 8, 2012 Author Share Posted April 8, 2012 Ah, Thank you! The script you provided worked like a charm. This is the second time you have come to my rescue tunaisafish! I Already gave kudos the last time. I'd give it again if I could. Cheers Link to comment Share on other sites More sharing options...
Recommended Posts