1 post / 0 new
Oblisgr
Oblisgr's picture
Member
Offline
Last seen: 4 years 5 months ago
Joined: 08/04/2012 - 15:11
Karma: 85
Can you help me with this?

Hello,
A good guys helped me write these lines so the NPCs add chairs etc in array and check when it is added.
The problem is that the array is filled with the chairs the PLAYER encounters and not the NPC running the script.
I suppose it has something to do with the code.
I also used:

Let CurrentRef := GetFirstRef 32

&

Let CurrentRef := GetNextRef


but i get the same arror...

Can anyone helps me?

The code is:

................
...............

If eval ((ar_Size NPC01_Chairs) == -1)
Let NPC01_Chairs := ar_Construct Array
endif

Let CurrentRef := GetFirstRef 32
Label 100

If (CurrentRef)
If (CurrentRef.NameIncludes "Chair") || (CurrentRef.NameIncludes "Stool") || (CurrentRef.NameIncludes "Bench") || (CurrentRef.NameIncludes "Cushion")
ar_Append NPC01_Chairs
CurrentRef
PrintToConsole "%z: %n added to array" Name CurrentRef
endif

Let CurrentRef := GetNextRef
GoTo 100
endif

Let NPC01_ChairsLast := ar_Last NPC01_Chairs
set NPC01_ChairSelection to Rand 0 NPC01_ChairsLast

..............
..............