Here's an object script.
------------------
Scriptname TIE1SummonTrainingSkeletonSCRIPTTESTA
ref SkelFighter
short button
short menu
begin onactivate
If menu < 1
MessageBox "Summon the Opponent?", "Swordsman Skeleton", "Cancel"
set menu to 1
endif
end
begin gamemode
set Button to getButtonPressed
if button == 0
set SkelFighter to TIEskelREF.createfullactorcopy
SkelFighter.AddItem TIEtrainWeapSteelLongsword, 1
Skelfighter.AddItem TIEtrainIronShield, 1
SkelFighter.moveto TIE1SkelmarkerREF
Message "Skeleton Fighter Summoned."
endif
if SkelFighter.getdead
SkelFighter.moveto TIE1SkelDeadmarkerREF
SkelFighter.resurrect
SkelFighter.RemoveItem TIEtrainWeapSteelLongsword, 1
SkelFighter.RemoveItem TIEtrainIronShield, 1
set menu to 0
SkelFighter.deletefullactorcopy
endif
elseif button == 1
set menu to 0
endif
End
--------------------
The above script shown works great. There is a
new form ID creature (skeleton) dropped in
a hidden room within the cell.
The creature is copied and moved to
the heading marker and new form ID sword and shield
are added to the creature.
Then on death it is removed to another "unseen" xmarker,
resurrected and deleted. This is done to get rid of the
weapon and shield it would otherwise drop
on death.
Now, all of this works great, the thing is
that no matter how I add in a timer that would
control creature move to the xmarker,
then deletion, on X number of seconds if it ISN'T dead,
I can't get the timer to work.
Either the timer doesn't work at all in-game, or
it breaks the copied actor removal.
Then I have a dead skeleton, loose sword and
shield on the floor, in one of the scripts, for example.
The timer in the below script change just doesn't work,
in-game the activator works like the timer just
isn't there. I added in the "float timer" reference to the list,
and did a "Set timer to 10" just under the
Messagebox function.
--------------------------
if SkelFighter.getdead
SkelFighter.moveto TIE1SkelDeadmarkerREF
SkelFighter.resurrect
SkelFighter.RemoveItem TIEtrainWeapSteelLongsword, 1
SkelFighter.RemoveItem TIEtrainIronShield, 1
set menu to 0
Message "Skeleton Destroyed!"
SkelFighter.deletefullactorcopy
Return
elseif timer > 0
set timer to timer - getsecondspassed
elseif timer == 0
SkelFighter.moveto TIE1SkelDeadmarkerREF
SkelFighter.RemoveItem TIEtrainWeapSteelLongsword, 1
SkelFighter.RemoveItem TIEtrainIronShield, 1
set menu to 0
Message "Summon time is up."
SkelFighter.deletefullactorcopy
endif
--------------------------
Like I said, I've tried the timer add-in every way I
can think of.
I've gotta be missing something either really simple/stupid,
or this is a problem I haven't seen before (something I'm ignorant of).
Any ideas welcome,
Thanks.