• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[lua] bug in object generation script

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

This command is bugged--instead of interpreting the passed value as an integer, it reads its ascii value. It's for changing the default team color of units.

JASS:
//this sets to the teamcolor value to 52, not 4 (yellow)
//52 is the ascii value of the character "4"
//! i makechange(current, "utco", "4")

Warcraft crashes apparently if you try to show player team colors above 12. I guess there's no way to coerce it to interpret the data as a color (like Starcraft Broodwar, where you could get extended glitchy colors by passing values between around 15-255).
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
That is because 'utco' is a custom type in the UnitMetaData.slk and the Object Merger probably treats all custom types as strings. I guess most of them are.

You can use a custom UnitMetaData.slk to change 'utco''s type to int or

JASS:
//! i makechange(current, "utco", "\4")

seems to be readable by wc3 as well.
 
Status
Not open for further replies.
Top