How to declare a reference?

Post » Wed Aug 29, 2012 9:31 pm

Hello,
This code is made on a triigger. The trigger will place 2 npcs I have created and assign random class on them.
The NPCs appear normally in the game but no class is assigned.
It is not working the way I have typed below.

If I use

If NPC01Class == 1NPC01.SetClass Warrior
I get error message

I actually want to declare NPC01ref to be NPC01 (NPC created in Editor) and NPC02 (NPC created in Editor).
Despite using GetSelf, GetContainer etc I want it to understand standard ref IDs.
Anyone can help?

scriptname NPCtriggershort NPC1short NPC01Classref NPC01refshort NPC2short NPC02Classref NPC02refshort TriggerBegin OnTrigger Playerset NPC01ref to NPC01set NPC02ref to NPC02if Trigger == 0Set NPC01Class to RAND 1 20Set NPC02Class to RAND 1 20If NPC01Class == 1NPC01ref.SetClass WarriorElseif NPC01Class == 2NPC01ref.SetClass WarlockelseIf NPC01Class == 3NPC01ref.SetClass ThiefelseIf NPC01Class == 4NPC01ref.SetClass SorcererelseIf NPC01Class == 5NPC01ref.SetClass ScoutelseIf NPC01Class == 6NPC01ref.SetClass RogueelseIf NPC01Class == 7NPC01ref.SetClass PriestelseIf NPC01Class == 8NPC01ref.SetClass NightbladeelseIf NPC01Class == 9NPC01ref.SetClass MageelseIf NPC01Class == 10NPC01ref.SetClass KnightelseIf NPC01Class == 11NPC01ref.SetClass HunterelseIf NPC01Class == 12NPC01ref.SetClass ConjurerelseIf NPC01Class == 13NPC01ref.SetClass AgentelseIf NPC01Class == 14NPC01ref.SetClass AcrobatelseIf NPC01Class == 15NPC01ref.SetClass AssassinelseIf NPC01Class == 16NPC01ref.SetClass BarbarianelseIf NPC01Class == 17NPC01ref.SetClass BardelseIf NPC01Class == 18NPC01ref.SetClass HealerelseIf NPC01Class == 19NPC01ref.SetClass MonkelseIf NPC01Class == 20NPC01ref.SetClass Archerendif........NPC01Marker.placeatme NPC01 1,1,1NPC02Marker.placeatme NPC02 1,1,1message "Followers have been created!"set Trigger to 1endifend
User avatar
KU Fint
 
Posts: 3402
Joined: Mon Dec 04, 2006 4:00 pm

Post » Thu Aug 30, 2012 6:29 am

Yo guys noone?
The question is simple:
How shall I call the ref ID of an actor that is not in game.
User avatar
Kayla Oatney
 
Posts: 3472
Joined: Sat Jan 20, 2007 9:02 pm


Return to IV - Oblivion