• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

JassNewGen Insert Native, Z

Status
Not open for further replies.
Level 7
Joined
Jun 16, 2008
Messages
253
Heya!

I'm a little clueless when it comes to programming and the like, so forgive me if I'm asking something silly.

I would like to put a 3d aspect into my myriad map, and for this I need to be able to use the concept of Z freely. Such as GetUnitZ and the like.
I don't know if GetLocationZ is native or not (I think it probably is) but I'm sure I heard that it was asynchronous, which is... bad? For multiplayer?
Probably something to do with LocalPlayer.

But anyway, my question has two parts. The first is inserting natives.

JassNewGen's Grimoire manual talked about inserting I think japi.dll into the engine. This would apparently allow me to insert my own natives.
My problem is that it refers me to I think japi(or something).cpp for native examples, yet I cannot find any such file.
Perhaps someone could enlighten me about the mechanics of inserting natives?
(Replace NativeInit or cache or something? I dunno!)



I think that perhaps I would not need to insert natives in order to get a 'Z' of a unit, because I could use GetLocationZ + Flying Height, but it would still probably be good for me to know.

The second part is about Z. I'm not sure exactly what my question should be, but I guess I'm asking if there is a lagless, and clean way in order to use Z in my map? So that I could say, have proper physics where units could run over the edge of cliffs and suffer falling damage and the like, with functions that do not stuff up everyone's computer?
I'm still feeling my way around creating physics engines, and as I'm only just emerging into learning vjass (all that jass stuff that uses heaps of .'s I think. :D) And I thought that making a proper phys engine might be hazardous to engine health, but after seeing SEE (awesome system by the way HINDYhat, even if the boulder sometimes seems a touch less than smooth, but that probably is just the limitations of the program) I think that my ultimate physics goal might work smoothly.

Feel free to answer or not, as most answers I probably won't be able to use until I understand vjass and the like.
 
Level 3
Joined
Sep 13, 2008
Messages
63
Adding your own natives will not work for other players, since it's a modification on your side, not theirs. It's not in the map file, but a modification to your copy of Warcraft 3. Anyways the game already has natives for getting a unit's z point.

JASS:
local unit u = UNIT //Change UNIT to whatever
local location l = GetUnitLoc(u) //Leaks (and cleaned up below)
local real z = GetLocationZ(l) + GetUnitFlyHeight(u) //Z point of ground plus the units flying height
//Actions... (put your stuff here)
call RemoveLocation(l) //Clean up the leak
set l = null //Not sure if you need to null, but it's a habit
set u = null //Same
set z = 0 //Same

One last thing, vJASS is JASS. The only difference is that its easier to work with, because it makes things so much cleaner and easier. If you tried to do structs (the . stuff) in normal JASS it would look crazy. vJASS simply makes it look clean. Once compiled its normal jass and looks pretty messy.
 
Level 7
Joined
Jun 16, 2008
Messages
253
Mm. So it is a native. I don't know if you need to null locations and the like either :D, every code that I see other people use always do it anyway, *shrug*.

And inserting natives will only work for my Warcraft? Buggar. But useful to know cheers. I guess it's safe to say that all my immediate questions were answered, though there is obviously a lot more room for explanation of things. But i guess that what tutorials are for.

You mods can go ahead and slap SOLVED on if you like! :D
 
Status
Not open for further replies.
Top