Jump to content

Giving different refIDs to same placeatme object


Oblis

Recommended Posts

Hello,

I created the following quest sctipt:

 

I summon actors from the same BaseObject and give them a refID so I will be able to use functions on them.

I know that every time I give the same RefID to the placed object.

Result of this is that the previous placed actor will reset its class due the new number rolled. (obvious). So if i wait for 3 loops for example, I will get 3 npcs and they eventually get the same class (the one that was rolled at the last time). I belive that if every npc placed could get a different refID everything would be perfect. But how?

 

I was thinking if it is possible to give different RefID somehow at every loop.

Any ideas?

 

ScriptName NPCStrongholdQuest

Float Countdown
Short RaidCountdown
Short RaidTrigger 

Short NPCStrongholdRaider01ClassTrigger 
Short NPCStrongholdRaider02ClassTrigger 
Short NPCStrongholdRaider03ClassTrigger 
Short NPCStrongholdRaider01Class 
Short NPCStrongholdRaider02Class 
Short NPCStrongholdRaider03Class 

ref NPCStrongholdRaider01Object
ref NPCStrongholdRaider02Object
ref NPCStrongholdRaider03Object

Begin GameMode

set Countdown to getsecondspassed 

If RaidTrigger == 0
Set RaidCountdown to 30
Set RaidTrigger to 1
Endif

if RaidTrigger == 1

if RaidCountdown > 0
Set RaidCountdown to RaidCountdown - Countdown
Message "New raid in %.0f seconds" RaidCountdown
endif

if RaidCountdown <= 0

Set NPCStrongholdRaider01Object to NPCKeepTeleportationInterior.PlaceAtMe NPCStrongholdRaider01
set NPCStrongholdRaider01Class to RAND 1 17
if NPCStrongholdRaider01Class == 1
NPCStrongholdRaider01Object.SetClass Warrior
endif
if NPCStrongholdRaider01Class == 2
NPCStrongholdRaider01Object.SetClass Mage
endif
if NPCStrongholdRaider01Class == 3
NPCStrongholdRaider01Object.SetClass Thief
endif
if NPCStrongholdRaider01Class == 4
NPCStrongholdRaider01Object.SetClass Priest
endif
if NPCStrongholdRaider01Class == 5
NPCStrongholdRaider01Object.SetClass Warlock
endif
if NPCStrongholdRaider01Class == 6
NPCStrongholdRaider01Object.SetClass Assassin
endif
if NPCStrongholdRaider01Class == 7
NPCStrongholdRaider01Object.SetClass Rogue
endif
if NPCStrongholdRaider01Class == 8
NPCStrongholdRaider01Object.SetClass Sorcerer
endif
if NPCStrongholdRaider01Class == 9
NPCStrongholdRaider01Object.SetClass Knight
endif
if NPCStrongholdRaider01Class == 10
NPCStrongholdRaider01Object.SetClass Bard
endif
if NPCStrongholdRaider01Class == 11
NPCStrongholdRaider01Object.SetClass Battlemage
endif
if NPCStrongholdRaider01Class == 12
NPCStrongholdRaider01Object.SetClass Barbarian
endif
if NPCStrongholdRaider01Class == 13
NPCStrongholdRaider01Object.SetClass Acrobat
endif
if NPCStrongholdRaider01Class == 14
NPCStrongholdRaider01Object.SetClass Nightblade
endif
if NPCStrongholdRaider01Class == 15
NPCStrongholdRaider01Object.SetClass Monk
endif
if NPCStrongholdRaider01Class == 16
NPCStrongholdRaider01Object.SetClass Healer
endif
if NPCStrongholdRaider01Class == 17
endif

MessageBox "Raiders have arrived"
Set RaidTrigger to 2
endif
endif

if RaidTrigger == 2
Set RaidTrigger to 0
endif

End

Link to comment
Share on other sites

Since Class is an attribute of the base object, different refIDs will not help (no matter which refID you use all NPCs in the game from the same base object will be changed)

 

In your case, you could prepare 16 different NPCs, each on a different Class and, in the script, roll the dice and PlaceAtMe the corresponding Base Object.

Link to comment
Share on other sites

Yes this is the simplest solution.

Since PlaceAtMe is not the best choice for a script (especially for actors) I created them as persistent refs.

Then I made waves of five each time.

Every wave has different npcs so the purpose of a real stronghold defence (the idea of my mod) will stay.

Thanks

Link to comment
Share on other sites

  • Recently Browsing   0 members

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