Well that was just a sample of what would happen and would produce the same results each time, even if only one line per event_timer. The heading parameter is optional. The perl parser checks to see if there are 4 or 5 parameters, and a default is used if only 4 are present.
I just rewrote the quest functions to get the client by entity_list if initiator was not defined for my solution, as it appears not all data is exported when an event timer is triggered. Not sure how some people are reporting they are successfully using quest functions like selfcast and movepc in the EVENT_TIMER call. |
Ok, trying to figure out what you are looking for. Here is another script that will allow you to use the client in sub EVENT_TIMER.
Code:
|
I'll give that a whurl Capheus. That's exactly what I was trying to do with little to no successful results. I'm starting to believe it has something to do with my highly customized build of Perl that I use for other applications. Thanks for taking the time to post your example.
I rewrote the timer trigger event so it tracks and always exports $client and $npc now so even the generic quest functions like quest::movepc() work now in EVENT_TIMER. I'll need to do more QA against it before distribution can be considered. |
Just a minor note that might help a bit;
When exporting the client (or anything for that matter) to a timer, you always want to check for a NULL pointer before doing anything with it. Otherwise, if your client has died or left the zone, the zone will probably crash when you try to use the pointer later. Here is an example of what I mean from part of the script posted above: Code:
if ($theclient && $theclienteid) { |
You most often don't get the crash if the player has left the zone since the perl client is checking to see if the reference is defined and IsClient() but when a player re-enters the zone with the timer still active, as their $entity_list id has changed.
|
Never knew about the zone crashing thing, I'll have to keep that in mind.
|
All times are GMT -4. The time now is 04:05 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.