• 🏆 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!

Is it possible to make a hero that can only transform at night?

Status
Not open for further replies.
Level 2
Joined
Jan 26, 2019
Messages
4
Hi, I want to make a hero that can transform at night like a werewolf, but I tried and I couldn't, I used Illidan's Meamorphosis skill as a base but I can't make him transform only at night. Help me please.

I already tried with detonators, I made the skill be added at a certain time and removed during the day but when using it you had to wait a while for the skill to start.

If the ability lasted two minutes, you had to wait that long for it to start performing that ability that lasts two minutes.
 
Last edited:
Level 13
Joined
Jun 23, 2009
Messages
299
I don't know how exactly how to use them in GUI but there's a bunch of functions and trigger events that can check for the current in-game time so it's totally possible, if I were to tackle this I'd do something like:

Event > Time of Day is (when it turns to night)
  • Remove disabled metamorphosis skill from the Hero
  • Give Hero the metamorphosis skill
Event > Time of Day is (when it turns to day)
  • Remove the metamorphosis skill from the Hero
  • Give Hero a disabled metamorphosis skill

You can fake a skill needing night-time by making a copy of it that requires some other skill/unit/upgrade, I'd personally go with an unresearchable upgrade called "Night time" so when you hover over the skill it will say: "Requires: - Night time" ...or something along those lines.

EDIT: lmao, I totally missed the part where you already did something like this, my bad :)
 
Level 2
Joined
Jan 26, 2019
Messages
4
I don't know how exactly how to use them in GUI but there's a bunch of functions and trigger events that can check for the current in-game time so it's totally possible, if I were to tackle this I'd do something like:

Event > Time of Day is (when it turns to night)
  • Remove disabled metamorphosis skill from the Hero
  • Give Hero the metamorphosis skill
Event > Time of Day is (when it turns to day)
  • Remove the metamorphosis skill from the Hero
  • Give Hero a disabled metamorphosis skill

You can fake a skill needing night-time by making a copy of it that requires some other skill/unit/upgrade, I'd personally go with an unresearchable upgrade called "Night time" so when you hover over the skill it will say: "Requires: - Night time" ...or something along those lines.

EDIT: lmao, I totally missed the part where you already did something like this, my bad :)
Thanks for the help, I'll try to do it and then I'll comment on the progress:thumbs_up:
 
Level 2
Joined
Jan 26, 2019
Messages
4
I don't know how exactly how to use them in GUI but there's a bunch of functions and trigger events that can check for the current in-game time so it's totally possible, if I were to tackle this I'd do something like:

Event > Time of Day is (when it turns to night)
  • Remove disabled metamorphosis skill from the Hero
  • Give Hero the metamorphosis skill
Event > Time of Day is (when it turns to day)
  • Remove the metamorphosis skill from the Hero
  • Give Hero a disabled metamorphosis skill

You can fake a skill needing night-time by making a copy of it that requires some other skill/unit/upgrade, I'd personally go with an unresearchable upgrade called "Night time" so when you hover over the skill it will say: "Requires: - Night time" ...or something along those lines.

EDIT: lmao, I totally missed the part where you already did something like this, my bad :)
the idea of my map is to make each player choose their character when the game starts, and I don't know how to make each hero keep their modifications with the triggers
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
When a player chooses their hero, which can be handled in several different ways, you want to store that chosen unit in a Unit array variable:
  • Unit - Create 1 Paladin for (Triggering player)
  • Set Variable Player_Hero[Player number of (Triggering player)] = (Last created unit)
This allows you to track the Hero for the rest of the game. So as long as you have access to a Player you'll be able to get their Hero.

How it works:
An array is what allows you to store more than one value to a variable at a time. The Index of an array is the integer that you type inside of it's [brackets]. Each [Index] can store one value at a time. Note that you can't set an Index to a value greater than 32,768, that's the limit.

Each Player in the game has what's called a Player Number, Reds = 1, Blues = 2, Teals = 3, etc...
We can use this Player Number as the [Index] of our Arrays to store data to specific Players.

Here's an example of this:
  • Set Variable Player_Oil[1] = 100
  • Set Variable Player_Oil[2] = 300
  • Set Variable Player_Oil[3] = 5

Let's say Player_Oil is a custom resource that each Player can harvest in the game. In the above example I am giving Player 1 a value of 100 oil, Player 2 a value of 300 oil, and Player 3 a value of 5 oil.

This allows us to cut down on trigger and variable usage by a lot. Here's an example of a trigger that takes full advantage of these methods:
  • Events
    • Player - Player 1 (red) types a chat message containing -oil as an Exact message
    • Player - Player 2 (blue) types a chat message containing -oil as an Exact message
    • Player - Player 3 (teal) types a chat message containing -oil as an Exact message
  • Conditions
  • Actions
    • Set Variable Player_Oil[Player number of (Triggering player)] = Player_Oil[Player number of (Triggering player)] + 10
This trigger will add 10 oil to any player that types the message -oil.

Remember, as long as you have access to a Player you'll have access to their Player Number, which will then give you access to any Array variables that you've created which take advantage of this Player number as their [Indexes]. Combine these with Player Groups and the Pick Every Player action and you can make some pretty neat triggers with relative ease.

With this in mind it shouldn't be hard to make triggers for each player/player hero and track those modifications that you mentioned.
 
Last edited:
  • Trigger 1: When a unit acquires the transform ability, check time of day, if day, enable that ability, if night, disable that ability. Add that unit to a your_group Group variable.
  • Trigger 2: When time of day changes from day to night, enum your_group and enable their transform ability.
  • Trigger 3: When time of day changes from night to day, enum your_group and disable their transform ability.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
If you want a requirement tooltip like "Must be night time" you can give the ability a tech requirement and then add and remove the upgrade (possible in newer versions of Warcraft III) every time day/night transition happens. I am not sure if abilities can have a unit technology requirement but if so then a dummy unit can be added/removed during the day/night transition.

Advantage of both these approaches is they do not require tracking the hero unit as Warcraft III manages disabling the ability natively.
 
Status
Not open for further replies.
Top