• 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.

[JASS] CreateUnit()

Status
Not open for further replies.
Hey again..

I stumbled upon a useful function that allows you to create a unit without creating a location. I find it useful since I replaced the location system with X/Y real arrays in my Meat Hook spell. So I replaced this function in my spell:
  • Unit - Create 1 MeatHUnit2[MeatHCustomValue] for Neutral Passive at (Point(MeatHTempX, MeatHTempY)) facing MeatHAngle degrees
with this one:
  • Custom script: call CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'h000', udg_MeatHTempX, udg_MeatHTempY, udg_MeatHAngle)
but the results are totally different. Is it possible that Bribe's unit indexer doesn't support this kind of units or is there something else I should know?

Thank you for your time
 
Thanks Bribe but that wasn't the problem. Sorry for not being specific enough. There seems to be a problem with the location it is created at... It's hard to explain. I attached the spell if you would like to look at it. The function is 2 lines below the disabled function (Meathook loop trigger)
 

Attachments

  • MeatHook v3.1.w3x
    46.1 KB · Views: 125
http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/

Also, don't try to switch this to custom script. You're messing up a lot of what was originally working about this resource in the process. For example, you are using locations in some places but real coordinates in others. When you update the real coordinates you do not update the location you originally pulled the coordinates from - resulting in really unexpected behavior.

Creating/removing locations is fine when you're using GUI.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
There's a fine line to walk between GUI and JASS. If you use too much custom script, it becomes unreadable in GUI and you'll be better off writing the whole thing in JASS... Well, you are better off writing things in JASS anyway, it just requires more knowledge.
 
Status
Not open for further replies.
Top