SphereCommunity
a timer, pause or something in a Trigger? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: a timer, pause or something in a Trigger? (/Thread-a-timer-pause-or-something-in-a-Trigger)



a timer, pause or something in a Trigger? - pushim - 08-10-2017 12:54 PM

Hi!
I have this problem, i want have a pause in a trigger, i can't have any idea, because the @timer is the only way to do that i know...
help c:


RE: a timer, pause or something in a Trigger? - Artyk - 08-10-2017 03:07 PM

Put what you want to do inside a function, then use timerf inside the trigger.
"timerf N, function_name" will execute "function_name" after N seconds on the object (in this case who triggered the trigger)


RE: a timer, pause or something in a Trigger? - pushim - 08-11-2017 02:13 AM

Very useful the truth! But I can not solve my problem
I want to pause for 5 seconds when a player wants to cut a body
To replace the script "negotiate features" that does not work very well and gives lag and problems
I tried many combinations but I can not get it
Later I want to devise something so the players do not use "autoloot"

Do you have any idea?


RE: a timer, pause or something in a Trigger? - Artyk - 08-11-2017 03:17 AM

Do you want to "protect" the body for 5 sec after death or make the action of cutting the body take 5 sec?
For the autoloot i remember I've already read something time ago on the forum, take a look Smile


RE: a timer, pause or something in a Trigger? - pushim - 08-11-2017 03:51 AM

make the action of cutting the body take 5 sec, the players love use a macro to cutting bodys haha!

I'll take a look at the forum, I hope I'm lucky ^^


RE: a timer, pause or something in a Trigger? - darksun84 - 08-11-2017 05:48 AM

A cool idea is to make a custom skill that handles carving:

Code:
[SKILL 58]
DEFNAME = Skill_carving
Key = Carving
FLAGS=SKF_GATHER|SKF_SCRIPTED
DELAY = 1.0
STAT_STR=0
STAT_DEX=0
STAT_INT=0
BONUS_STR=0
BONUS_DEX=0
BONUS_INT=0
BONUS_STATS=0
//This will prevent the skill advancement
ADV_RATE = 0

ON=@Start
//5 Strokes with 1.0 delay, around 5 seconds?
local.GatherStrokeCnt = 5
actdiff = 0

ON=@Stroke
//Play the bow animation
bow

ON=@Success
act = <tag.carveCorpse>
useitem <tag.carveWeapon>
last

Then add this trigger to a general player event

Code:
ON=@itemTargon_Item
if (<argo.type> == t_corpse) && (!<tag0.carveCorpse> ) //Start the custom carving skill -> Skill 58
    //Set Corpse Uid
    tag.carveCorpse = <argo>
    //Set the item used for carving
    tag.carveWeapon = <act>
    skill 58
    return 1
elseif (<argo.type> == t_corpse) && (<tag0.carveCorpse> ) //Proceeds with carving.
    tag.carveCorpse =
    tag.carveWeapon =
    return 0
endif

It seems to work for now


RE: a timer, pause or something in a Trigger? - pushim - 08-11-2017 11:19 AM

Very grateful to both, I opened so many ideas Smile