• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Some questions about vJass

Status
Not open for further replies.
Level 18
Joined
Mar 21, 2011
Messages
1,622
Hi :)

Question No.1:

I think it is ok to use the following functions, but i dont know if there is a better way:
UnitInventoryCount
UnitAddItemByIdSwapped


Question No.2:

can you read the length of an array?


Question No.3:

How can i get an offset point in vJass?
i did it like this, but i'm not sure if this is the best solution
JASS:
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    local real x2 = GetLocationX(Location(x, y)) + 600.00 * Cos(f * bj_DEGTORAD)
    local real y2 = GetLocationY(Location(x, y)) + 600.00 * Sin(f * bj_DEGTORAD)



thats it, thank you!
 
I think it is ok to use the following functions, but i dont know if there is a better way:
UnitInventoryCount
UnitAddItemByIdSwapped
Both are non-native functions (BJs), which means you can replace them by their implementation.
List of BJs: https://warcraft.ingame.de/maps/mappedia/Blizzard.j

The implementation of BJs are compositions of jass language elements and native functions.
List of natives: http://warcraft.ingame.de/maps/mappedia/Common.j

Just do a fulltext search for your functions.


can you read the length of an array?
No, arrays always have length 8192.
You can search the array for the last entry by looping through it...

How can i get an offset point in vJass?
i did it like this, but i'm not sure if this is the best solution
JASS:
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    local real x2 = GetLocationX(Location(x, y)) + 600.00 * Cos(f * bj_DEGTORAD)
    local real y2 = GetLocationY(Location(x, y)) + 600.00 * Sin(f * bj_DEGTORAD)

Replace GetLocationX(Location(x, y)) with x. Same with y..
Apart from that its fine.
 
Status
Not open for further replies.
Back
Top