---------------------------------------------------------------------------------------
#include "f_encounter_tables"
void respawn()
{
//Debug
SendMessageToPC(GetFirstPC(), "Delayed part fired!");
if (GetTag(OBJECT_SELF) != "SPAWN_POINT")
{
location lPoint = GetLocation(OBJECT_SELF);
string sTable = GetLocalString(OBJECT_SELF, "ENCOUNTER_TABLE");
string sTemplate = RollEncounterTable(sTable);
string sNo = IntToString(GetLocalInt(OBJECT_SELF, "ID_NUMBER"));
CreateObject(OBJECT_TYPE_CREATURE, sTemplate, lPoint, TRUE, sNo);
}
}
void main()
{
//Debug
string sTag = GetTag(OBJECT_SELF);
SendMessageToPC(GetFirstPC(), "Script successfully fired from " + sTag);
float fDelay = 12.0f;
DelayCommand(fDelay, respawn());
}
---------------------------------------------------------------------------------------
Which doesn't work.
However, if I remove the delay...
---------------------------------------------------------------------------------------
void main()
{
respawn();
}
---------------------------------------------------------------------------------------
Then it does work.
I've written dozens of delay scripts on this module alone, but I can't figure this out and currently have a headache, so... Help...?
I should also mention that this script is executed on a waypoint (another script causes it to fire, "executescript")
Modifié par Julian Gellert, 17 juin 2011 - 07:23 .





Retour en haut






