• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Pick up mechanic

Status
Not open for further replies.
Level 7
Joined
Sep 8, 2011
Messages
211
Hey guys, so I'm trying to figure out how to do this certain mechanic in a map I'm creating. Basically it's a 4 (survivors) v 1 (killer). Survivors have 3 health and when they reach 1 hp they go into a dying state making them unable to move and unkillable to attacks. The only way to kill a survivor is if the killer Picks Up the dying survivor and puts them on a meat hook, which they bleed out (already sorted bleeding out, i'm using mana for it). This gives the survivors time to save their friends on the hook.

Basically I want to ask you guys how should I go about doing this 'Pick up' mechanic and putting a survivor on a hook.

At first I was thinking using a transport method like a Zeppelin but that doesn't work as you can't transport enemies. I was thinking devour ability too but I'm not sure how to transport the survivor from in the killers grasp to the hook's grasp.

If you are not sure how the mechanics work properly check out the game Dead by Daylight, which is basically what I'm trying to recreate here.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Hey Jackhamme, your thread made more sense for World Editor Help Zone. Triggers & Scripts is where people post triggers they already have and need help fixing it.

Now onto your post, you can easily pull this mechanic off by using an ability. When an enemy uses the ability on the "dying" survivor, you can periodically move the target to the caster's location. If you use a really small loop timer like 0.03 seconds, this will give the illusion that the survivor is on the killer. Making it look like it's on a "hook" is a different story though :p
 
Level 7
Joined
Sep 8, 2011
Messages
211
Hey Jackhamme, your thread made more sense for World Editor Help Zone. Triggers & Scripts is where people post triggers they already have and need help fixing it.

Now onto your post, you can easily pull this mechanic off by using an ability. When an enemy uses the ability on the "dying" survivor, you can periodically move the target to the caster's location. If you use a really small loop timer like 0.03 seconds, this will give the illusion that the survivor is on the killer. Making it look like it's on a "hook" is a different story though :p
Oh sorry about that.

Yeah the timer idea was another thought I had, I wanted to use less timers as I have two already running (not sure how much memory it uses to run a timer). Making the survivor look like it's hooked isn't much of a problem as I don't really care at this point lol, its how i would go about making them bleed faster on the hook than on the floor. I'm thinking probably using regions and stuff, unless someone can think of something better?
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Two timers will hardly do anything with your map unless you are doing big operations like enumerating the entire map. The mechanic you want will hardly tax your FPS.

how i would go about making them bleed faster on the hook than on the floor. I'm thinking probably using regions and stuff, unless someone can think of something better?
You said that they "bleed" mana right? You can do that during the periodic trigger. Given that they will only be moving when they are on the hook, it's safe to assume that they should be bleeding faster since they are on the hook.
 
Level 7
Joined
Sep 8, 2011
Messages
211
Two timers will hardly do anything with your map unless you are doing big operations like enumerating the entire map. The mechanic you want will hardly tax your FPS.


You said that they "bleed" mana right? You can do that during the periodic trigger. Given that they will only be moving when they are on the hook, it's safe to assume that they should be bleeding faster since they are on the hook.
That's good to know about timers. I always thought timers ruined FPS if you had anymore than like 5 lol.

At the moment when the survivor reaches 1 hp, their mana drains 1 per second currently. I'd like them to drain 2 every second 'on' a hook.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
You can do it one of two ways:
  • Every 1 second, drain the mana by one. If your loop timer is shorter than 1, you will need a variable to keep track of when 1 second has passed
  • Every loop iteration, drain the mana of the unit. If you have a 0.03125 loop timer and you want to drain 1 mana over a second, then you 1.00 * 0.03125, which gives you 0.03125 mana every loop iteration. This makes sense because it takes 32 loop iterations of a 0.03125 loop timer to reach 1 second (I used 0.03125 because it goes evenly to 1.00, having a 0.03 loop timer will be just the same)
The latter is always my go-to mechanic whenever a spell requires the draining or increasing of the property of the unit.
 
Level 7
Joined
Sep 8, 2011
Messages
211
You can do it one of two ways:
  • Every 1 second, drain the mana by one. If your loop timer is shorter than 1, you will need a variable to keep track of when 1 second has passed
  • Every loop iteration, drain the mana of the unit. If you have a 0.03125 loop timer and you want to drain 1 mana over a second, then you 1.00 * 0.03125, which gives you 0.03125 mana every loop iteration. This makes sense because it takes 32 loop iterations of a 0.03125 loop timer to reach 1 second (I used 0.03125 because it goes evenly to 1.00, having a 0.03 loop timer will be just the same)
The latter is always my go-to mechanic whenever a spell requires the draining or increasing of the property of the unit.
Oh yeah interesting, I never thought of having a dummy draining the mana. I've got an idea, thanks so much for the help killcide. :)
 
Level 7
Joined
Sep 8, 2011
Messages
211
The latter is always my go-to mechanic whenever a spell requires the draining or increasing of the property of the unit.

I thought you meant like a dummy casting a spell but I know what you mean. I know you don't need to, but It might be easier to have the hook as a unit, and make it drain mana from a dying survivor when the killer 'drops' the survivor on the hook. That way they are losing 1 mana every 1 second and the hook will drain mana ontop of that, making them bleed faster.
 
Level 7
Joined
Sep 8, 2011
Messages
211
Personally, having a dummy unit at all would make things more complicated. When I mentioned an ability, I was referring to the killer using a "Pick up" ability. At that point, you can periodically move the survivor to the killer while draining its mana at the same time.
Ah yeah I get ya. I've already got the mana draining over time sorted and the moving to the killer when he 'picks' up the survivor. I am currently making the hook mechanic which will simply work like this:

  1. Killer drops survivor within a short range of the hook.
  2. Hook automatically targets the closest 'dying' survivor and casts a modified drain mana spell.
  3. If the survivor is healed and the 'dying' debuff is removed the hook cancels the mana draining and the trigger that drains 1 mana every second will also stop.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
If you get it to work, thats good. However, if you plan on draining the mana in a one second loop timer, while also checking for the debuff in the same trigger, you will notice a delay in actions. What I mean is that on the off chance that the debuff is removed in between the timer, you will have to wait a full second to see the hook cancel.
 
Status
Not open for further replies.
Top