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

[Need Info] Help with Actor creation, Event Macro and Token references?

Status
Not open for further replies.
Level 2
Joined
Dec 16, 2006
Messages
9
I have a bunch of Unit Actors which all have their own specific Actor Events each.

However, these Unit Actors do not contain any of their
Code:
UnitBirth.##unitName## -> Create
messages, so they will not show up for their Units. (I forgot to initially add it)

Now, since it is possible to make a reference to an Actor's token (using ##unitName###, or ##id##) I thought it might be a good idea to create an Event Macro containing the aforementioned Actor Creation message (using the ##unitName## reference) in the hope that it will be able to get the appropriate 'unitName' value for each of the Actors which the Event Macro would be added to.

The amount of Actors I have makes it hard for me to consider: copy/pasting & making adjustments in the Events dialog for each single one of them.
A lot of repetitive work, and this would be just to get my Actors to show up.

In this case, it seems as if it's -almost- possible, to just use a single Event Macro which can make sure that any of its Host Actors will be created whenever the Unit is born.

This also makes me wonder whether there are more references or tags that can be used. So far it seems we can refer to tokens by using the '##tokenId##' 3 hashtags around a Token's ID.

Note: The references I wrote about are sometimes seen in default values for existing units, they are only insertable in 'View Raw Data' mode.

Thanks for your time!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
The amount of Actors I have makes it hard for me to consider: copy/pasting & making adjustments in the Events dialog for each single one of them.
A lot of repetitive work, and this would be just to get my Actors to show up.
Use XML view to insert the events.

In this case, it seems as if it's -almost- possible, to just use a single Event Macro which can make sure that any of its Host Actors will be created whenever the Unit is born.

This also makes me wonder whether there are more references or tags that can be used. So far it seems we can refer to tokens by using the '##tokenId##' 3 hashtags around a Token's ID.
I think they are parser macros. As such it will not work as the tokenId is not defined in the Event Macro actors.

You can create any number of tokenId in XML view. Very useful for templates. Do note that tokenId is evaluated at first parse, meaning that if you change the token via extension (another mod layer) it will not be reflected in on the type. Within the same mod it works usually perfectly and even supports inheritance (useful for template types).
 
Status
Not open for further replies.
Top