Unit Type via string identifier

Builder Bob

Live free or don't
Reaction score
249
Data Tables in the trigger editor can be used to store values of various types (int, real, unit, etc) which can later be recalled using a string identifier. As far as I can see Unit Types cannot be stored in this manner. There is no option to choose game link either.

Does anyone know how to do it, or have another working alternative? I must save them with a string id, so an array will not suffice.
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
I think I answered a similar post over at mapster.com, and there is no real way using GUI.

In custom script Unit Types are simply strings, but the Blizzard dudes forgot to add a conversion in GUI, I think.
 

Arkless

New Member
Reaction score
31
Create a function wich takes a gamelink named gl as parameter and returns a string. Tick the custom script option. Add #PARAM(gl) as custom script. There you go!

For the conversion from a string to gamelink, just use a string as parameter with the name st (returntype = the gamelink of your choice). Tick the custom script option. Add #PARAM(st) as custom script.

There you go, you can now convert from gamelink to string and the other way around.
 

Builder Bob

Live free or don't
Reaction score
249
Awesome, it compiles :)

GUI can be so frustrating some times. Thanks for the help


edit: need to spread rep :/
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top