Jump to content

set ref to GetSelf


drekmoor

Recommended Posts

I found a mod on TesNexus some time ago based on a British cult phenomenon, the TARDIS, the mod as it was it was alright but the guy who originally made it, Murfy27, wasn't very experienced at scripting so I thought I could make it in a different way. Works fine and all, and I even uploaded my own version, TARDIS by Drekmoor, after getting permission from Murfy27 of course. It's rather good if I may say so, it can transport you anywhere even into new cells created for other peoples mods.

 

Here’s the thing, I asked people who use my mod to send me suggestions on how to either improve the mod or to suggest new functions to add. One user suggested that I create a function to capture NPC and send them to the TARDIS prison cells. So I did. I've successfully created a spell which transports NPC's into the prison and locking them up. Cast the spell on the NPC while in prison will transport the prisoner to whereever you 'landed' the TARDIS.

 

Here's my problem. There are 5 prison cells, naturally I would like for there to be a maximum number of 5 prisoners. I set the 'Spell Script' to mark the Prison Cell's 1 through 5 to be either occupied or unoccupied, but I also created 5 quests, one for each prisoner but all in all just one Spell. The Spell Script changes a variable in the quests which then in return afflicts how the Spell Script reacts when choosing multiple prisoners. The problem is that I need the quest scripts to be able to identify the actors.

 

Currently I've got the following for the quest script for prisoner 1:

 

scn TARDISPrisoner1QuestSCRIPT

 

ref Prisoner

short doOnce

 

begin GameMode

 

if Prisoner.GetInCell TARDISPrison

set doOnce to 1

else

if doOnce == 1 ; as soon as the actor leaves the prison this if statement activates

set TARDISCell1Resident to 0 ; statement for the Spell Script determining whether a Prison Cell is occupied

set doOnce to 0

endif

endif

end

 

Problem: the reference Prisoner doesn't seem to be stored. This then triggers the above GetInCell thus setting cell 1 to unoccupied even though there is a prisoner in it. The prisoner is set from the Spell Script by:

 

set TARDISPrisoner1Quest.Prisoner to GetSelf

 

which should work like this: set the reference Prisoner in the Prisoner1Quest to the targeted actor/NPC (GetSelf) then when the actor is no longer in cell set the cell to be empty

but in stead seems to work like this: set the reference Prisoner in the Prisoner1Quest to the targeted actor/NPC (GetSelf) then the reference forgets who the referenced actor is, possibly because the actor is removed from the cell the player is in

 

If it is possible I would like to make this script without any script extending programs to keep it as simple as possible for people who are new to oblivion mods.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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