• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Anyone want useful, simple JASS functions in Custom Script?

Status
Not open for further replies.
Level 10
Joined
Sep 21, 2007
Messages
517
Basically, i can provide you with efficient functions in JASS to be used in Custom Script section of GUI. An example of the functions il provide is getting the height of an XY position without you having to create a location, find its height using GetLocationZ and then removing it, its also faster cus it doesnt generate a location every time, instead of moving it (did this function cus i see alot of people like spells w/ heights these days, like parabola jump, grenade, bla bla... :p)

anyways, thats just an example, and to do it in custom script you just do this:
  • Custom script: call GetPositionZ(x,y)
or to set it in a variable you do:
  • Custom script: set udg_YourVariableName = GetPositionZ(x,y)
udg_ is a prefix for the variables you create in the variable editor, but if it is a local variable (if you know what that means, not trying to be offensive/sarcastic) you dont have to put that prefix. Please note that not all JASS functions give a value that gets set in a variable, some are just for ordering units to move for example without having to use locations, anyways, you will need very simple JASS knowledge to use this.

So you can imagine im trying to simplify/make more efficient the amount of work you guys do and make life easier for GUI users, just tell me what functions you'd like and il put them in a trigger that you can just copypaste to your map and everything will work just well.

:spell_breaker:
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
  • Custom script: call GetPositionZ(x,y)

That function doesn't work.

  • Actions
    • Custom script: local real x
    • Custom script: local real y
    • Custom script: call GetPositionZ(x,y)

66929d1254855347-anyone-want-useful-simple-jass-functions-custom-script-error.jpg


There is function called "GetLocationZ". For example, this trigger has no errors:
  • Actions
    • Custom script: local location l
    • Custom script: call GetLocationZ(l)
 

Attachments

  • Error.JPG
    Error.JPG
    37.7 KB · Views: 301
Level 28
Joined
Jan 26, 2007
Messages
4,789
What's wrong with the trigger-section that you put this here? ^^

Anyhow, I believe it's something like this:
JASS:
local real X = GetUnitX(udg_Hero)
local real Y = GetUnitY(udg_Hero)
local real Z = GetLocationZ(Location(X,Y))

...which would be basically the same with Custom scripts.

  • Custom script: local real X = GetUnitX(udg_hero)
  • Custom script: local real Y = GetUnitY(udg_hero)
  • Custom script: local real Z = GetLocationZ(Location(X,Y))
I like the effort, though... there are a lot of people who use GUI, it may be a bit outdated, but my guess is that about 80-90% of the mappers use GUI (yeah, Dr Super Good, this value is a lot lower when you only talk about the people being serious about it).

It still belongs in the trigger-section, no matter how you look at it.
 
Level 10
Joined
Sep 21, 2007
Messages
517
:p thanks for response guys, hmm, yea just thought it wasnt a problem (which trigger section is filled with) so decided to post here since its relative to the world editor section, but yea technically ur right.

anyways i really hope some GUI guy wants this cus itll help out the guys by alot ^^

btw child of bodom, i like ur response xP yes, JASS tends to do that to peoples minds (speak from experience) xP
 
Status
Not open for further replies.
Top