Finding an actor using a bed

Post » Thu Feb 19, 2015 9:45 pm

Heya I'm trying to make an array of actors. The idea is when they are using the bed, and the player hits a switch, the actor gets stored in the array.

But I'm having a few problems when it comes to the array:

I have an actor property 'storageempty' which is already initialized in the ActorArray. Meaning if this actor is in the Array its ok to replace it, if its not then check the next slot but this comes up with a few errors:

Spoiler
Scriptname NHThrallStorageScript extends ObjectReference
{actor storage script}

ObjectReference Property Bed Auto
{Object reference for the bed of actor storage}

ObjectReference Property Coffin Auto
{Object reference for the exit}

ObjectReference Property TeleportMarker Auto
{Object reference for the teleport location xmarker}

Actor[] Property ActorArray Auto
{Array containing all of the actors in storage}

Int Property actorSlots = 0 Auto
{Counter to check if actor storage is full}

Actor Property storageempty Auto
{Actor for the storage checker to check if the storage slot is empty
If the slot has this actor in the array, its empty}

Auto STATE Waiting
EVENT onActivate (objectReference triggerRef)
self.BlockActivation(true)
playAnimationandWait("Pull","Reset")
self.BlockActivation(false)
if !(Bed.IsFurnitureInUse())
ThrallSlots = 0
While ThrallSlots<=30
If ActorArray[actorSlots] = storageempty
ActorArray[actorSlots] = (Bed akActivator)
debug.notification("actor has been stored")
actorSlots +=31
Else
If actorSlots>=30
debug.notification("No storage slots left")
EndIf
EndIf
debug.notification("actor has been stored")
actorSlots +=1
EndWhile
else
debug.notification("No actor to store")
endIf
endEVENT
endState

The errors are:

Spoiler
Starting 1 compile threads for 1 files...
Compiling "NHThrallStorageScript"...
E:\Programs\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\NHThrallStorageScript.psc(34,25): required (...)+ loop did not match anything at input '='
E:\Programs\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\NHThrallStorageScript.psc(35,26): no viable alternative at input 'TSI'
E:\Programs\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\NHThrallStorageScript.psc(35,41): required (...)+ loop did not match anything at input ')'
No output generated for NHThrallStorageScript, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Line 34 is meant to be checking if the actor in the array is the predefined 'empty' actor

line 35 is meant to be adding the actor which is using the bed into the array.

Line 35 I'm not sure whats going on because I don't know how to find a actor using an object so that line was a stab in the dark so I was assuming that was going to give me an error. But line 34 I honestly don't know whats going on, because its checking if the actor that is stored in the array matches the one in the property, I've tried adding .ActorBase to that line but it still comes up with the error. But if i remove the = storageempty then it comes up saying that Bed doesnt exist.

Not sure whats going on here I would really love some help

User avatar
Amy Cooper
 
Posts: 3400
Joined: Thu Feb 01, 2007 2:38 am

Return to V - Skyrim