EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Little help: any ideas why this won't work? (https://www.eqemulator.org/forums/showthread.php?t=24744)

ChaosSlayer 03-26-2008 08:48 AM

Little help: any ideas why this won't work?
 
the followign SHOULD work- yet nothgin is happeneing.

Quote:


#qeynos2



sub EVENT_SPAWN
{

quest::settimer("spar1", 6);

}



sub EVENT_TIMER
{

if ($timer eq "spar1")
{

# Random animations: Kick, Throw, Offhand Attack, Dragon Punch, Round Kick, Rude, Flying Kick, Tiger Claw, Eagle Strike

my $anivar1 = quest::ChooseRandom(1, 5, 6, 7, 11, 30, 45, 46, 47);

quest::doanim($anivar1);
quest::settimer("spar1", 6);

}

}


#END of FILe


also on timers:

do timers automaticly run in circle unless stopped? for exmaple i set my timers to 400, it will count to 400 seconds, run ist sub, and thrn start from 0 again, OR does only work once, and have to be re0started every time it fires off?

also do timer names shared bewten diffirent quest files? can 2 difirent npc have same timer name in their quest files?


thank you =)

trevius 03-26-2008 10:10 AM

AFAIK, timer names can be the same as long as they are in seperate files. The scripts run independently.

The timers definitely don't loop like you mentioned. You might want to add a quest::stoptimer("spar1"); in there before you start it again. Other than that, it looks ok. I think the issue may be with $anivar1, since I have never used that variable. If you want to test the timers to make sure they are working properly, just replace:

Code:

my $anivar1 = quest::ChooseRandom(1, 5, 6, 7, 11, 30, 45, 46, 47);

quest::doanim($anivar1);

with:

Code:

quest::say("I'm saying it now and I will say it again in 6 seconds!");

ChaosSlayer 03-26-2008 10:26 AM

ah i see. Thank you, i belive that problem is in not having "stop timer"
timers fires off once, and keeps counting forwards.

as far $anivar1 goes- thsi is basicly any name variable, like $x1
however I am more concern to know if aimations actualy working at all

will try code with stoptimer later on today

Congdar 03-26-2008 11:37 AM

this looks like the west freeport sparing monks script i wrote for Ran`Un. It's working fine in west freeport without stoptimer.

Are other quests working? Is Perl working, because animations are working for me.

ChaosSlayer 03-26-2008 01:16 PM

Quote:

Originally Posted by Congdar (Post 145396)
this looks like the west freeport sparing monks script i wrote for Ran`Un. It's working fine in west freeport without stoptimer.

Are other quests working? Is Perl working, because animations are working for me.

aye that is where I got it from - but i have no idea if it ever qorked in FP.

So far i run into situation where "scrip wroks as intendend" even wihout checking how mcuh time has passed, in some files, and don't work in others at all.

for exampel the following code is not suppose to work:

Quote:

#fiherman



sub EVENT_SPAWN
{

quest::settimer("fish1", 180);
quest::say("It is fish time! Oh no! All the dang cats allready here!");


}



sub EVENT_TIMER
{

if($timername eq "fish1")
{
quest::doanim(1);
}

quest::say("Come on fishy-fishy!..Hushhhh, you little hungry devils! Get away from my fish!");



}
As you see it says the phrase BEFORE it checks the timers - yet phrase fires off every 3 min, but animation never

ChaosSlayer 03-26-2008 01:50 PM

another question on timer names.
is it posible to use a timer for a generic creature? like "an_orc", when its 5-20 of them in the zone? I am getting a feeling that timers ONLY work for unique creatures like "Commander_Kain" or "Goblin_Warlord", the timer seem to break if I take the same code and stick it into "a_large_wolf"

ChaosSlayer 03-26-2008 03:44 PM

did few chages around.

what wasn't working now works..
what was working stoped =)

and yes, timer do work with generic multyple npcs...


also there seem two diffirent timer keys:

$timer and $timername

it seems to me than $timername does not requre timerstop function, and neither uses time check....
out to experiment some more...

ChaosSlayer 03-26-2008 03:54 PM

btw Congdar, do you by chance have ENTIRE list of all animations number codes? also things like /dance, /rude etc?

thanks

Congdar 03-27-2008 01:45 AM

I originally used $timername but found that it only worked sometimes but $timer seemed to work all the time.

This is from the source code:
Code:

enum {        //type arguments to DoAnim
        animKick                                = 1,
        animPiercing                        = 2,        //might be piercing?
        anim2HSlashing                        = 3,
        anim2HWeapon                        = 4,
        anim1HWeapon                        = 5,
        animDualWeild                        = 6,
        animTailRake                        = 7,        //slam & Dpunch too
        animHand2Hand                        = 8,
        animShootBow                        = 9,
        animRoundKick                        = 11,
        animSwarmAttack                        = 20,        //dunno about this one..
        animFlyingKick                        = 45,
        animTigerClaw                        = 46,
        animEagleStrike                        = 47,
       
};

There are more for spell casting but not listed like above, appears to retrieve the id from the spell data. You can test out other animations though, use the GM command #doanim and try a bunch of other numbers and see what you come up with.

Congdar 03-27-2008 01:52 AM

and I just found this:

http://www.peqtgc.com/phpBB3/viewtopic.php?t=304

ChaosSlayer 03-27-2008 04:36 AM

awsome, thank you Congdar!


All times are GMT -4. The time now is 07:47 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.