• 🏆 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!

Producer Update: Natives List

Status
Not open for further replies.

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,889
if this will return nothing then you cant use this in conditions without your custom checks.
most of the function i think should return boolean wich now returns nothing.
There's no point in using using this in an if-statement as a condition, it would always return true.

no, if damage = 0, its anyway damage and will be detected. just make a condition smth like
if dmg > 0 then
some code...
else
your miss detect
endif
Damage will be 0 with abilities and etc of course. You missed the point, if I want to make the unit miss the target, then there should be a function for it, without the target actually being hit and without setting the damage = 0, it won't be a real miss because the hit sound still plays.
 
No idea what you're talking about, if a unit miss the target, he misses, doesn't deal damage. If a unit has splash damage and missile type, it will never miss.

upload_2019-6-16_18-33-53.png



No idea, does that mean this gameplay constant does nothing then?
 
Level 4
Joined
Jan 7, 2014
Messages
69
JASS:
native IsAbilityPassive takes integer abilityId returns boolean
//Detect ability is passive or not

native PlayerShareUnitVisionEx takes player whoShare, player toShare, boolean share returns boolean
//Share vision of units inventory cd, Abilities and also abilities cd, without control to player
//or just new ALLIANCE_TYPE variable

native PlayerShareUnitVision takes unit wichUnit, player toWichPlayer, boolean share returns boolean
//Same as previous, but only for selected unit shared vision of cd, inventory and etc. Without control
//or just new ALLIANCE_TYPE variable

native GetConvertedType takes type wichType returns integer
//Thats means you can take every primitive type wich converted with function Convert....(int) and get index(integer) of this
//For example UNIT_TYPE_PEON = ConvertUnitType(16), so you can:
//local integer utype = GetConvertedType(UNIT_TYPE_PEON) thats means utype = 16

native GetFilterInteger takes integer wichFilter returns boolean
//Uses previous function GetConvertedType in filter functions, thats means will be worked more faster than filtering unittypes, itemtypes and etc, and will be universally for every filters

native RealWithInt takes integer beforeDotl, integer AfterDot returns real
//thats means you can make any real with integer arguments, for example:
//local integer i = 123
//local integer a = 5
//local real b = realRealWithInt(a,i) thats will be looks like a.i or 5.123, or:
//====================
//local integer i = 143
//local real a = RealWithInt(5,i) and will looks like a = 5.143

native GetIntFromReal takes real arg1, boolean afterDot returns integer
//returns an value integer of real after dot
//For example
//local real a = 3.14
//local integer i = GetIntFromReal(a,true) wich returns 14, or GetIntFromReal(a,false) wich returns 3

native RootReal takes real arg, real rootArg returns real
//returns a root of real from pow rootArg
//For example local real a = 156
// local real b = RootReal(a, 5) thats means some value x^5 = a, so this function will return x

type matrix extends smth... or not extends
//new type wich will an alternative of hashtables with every size as you want for example wich also emulate an 2D and 3D massives and works more faster and universally, and you can save every type with same values of matrix.
for example:
you can save in matrix with X=1 coordinate, Y=1 coordinate, Z=1 coordinate a unit and also an integer,
when you save a different types in same coordinates, VM will create a different adresses in memory.
Its more comfortable and more faster for use than a big hashtables. As you know, for save in hash a different values you should do smth like this:
// call SaveUnitHandle(h,GetHandleId(smth),0,unit)
and you cant save the different value in childhash and you should for save other different value make another point in childhash...call SaveInteger((h,GetHandleId(smth),1,integer) and etc...
but with matrix you can save this in same coordinates. Sorry for my engl. its hard to explain.:)
Who understand what is matrix, should to know)

native CreateMatrix takes nothing returns matrix
//Creates a matrix of integers,reals... and natives for work with it...

native SetMatrixSizeX takes matrix ma, integer sizeX returns nothing
//Set a value of matix size X

native SetMatrixSizeY takes matrix ma, integer sizeY returns nothing
//Set a value of matix size Y

native SetMatrixSizeZ takes matrix ma, integer sizeZ returns nothing
//Set a value of matix size Z (if no setup this value, will be a defaul 2D matrix)

native GetMatrixSizeX/Y/Z takes matrix ma returns integer
//Get size of matrix of XYZ

native SaveMatrixValueX/Y/Z takes integer x/y/zCoordinate, type value returns nothing
//Set a value (any type) of matrix in xyz coordinate

native GetMatrixValue takes integer x, integer y, integer z return type
//returns a type wich saved in coordinates xyz, so if there is a unit, then matrix will return unit, if there //is an integer, then will return integer F.E:
local unit a = GetMatrixValue(1,4,2) so its should return (unit for example). If there is //no unit, then return null.
also in same time:
local real b = GetMatrixValue(1,4,2)

native SetEventPriority takes trigger trig, type eventype, integer priority returns nothing
//set a value of priority of fire events with same eventid, value > means more priority
//to avoid a big systems with that

native SetEventPriorityEx takes type eventype, type eventtype2, integer priority returns nothing
//set a value of a events fire priority, thats means priority between different events wich fire for unit use an item and event cast ability for example, you can setup a priority wich event will fire first for all map...wich event will fire first
 
Last edited:
Level 4
Joined
Jan 7, 2014
Messages
69
JASS:
native GetUnitAnimationByIndex takes unit u returns integer
//returns an index of unit's current animation

native GetUnitAnimation takes unit u returns string
//also returns string name of unit's current animation

constant event UNIT_REGISTER_GOT_ABILITY(aslo buff)
constant event PLAYER_UNIT_REGISTER_GOT_ABILITY(aslo buff)
thats events means not learn skill, but when ability or buff added to unit and also lost ability or buff
also
native GetTriggerAbility takes nothing returns ability
native GetTriggerAbilityId takes nothing returns integer
//this natives responds on new events


native TriggerRemoveEvent takes trigger t, event e returns boolean
//removes an event from the trigger

native TriggerDisableEvent takes trigger t, event e returns boolean
//disable an event of trigger, very usefull if trigger for example got more than 1 different events

native SetTriggerEventIndex takes trigger t, event e, integer onWichIndex returns nothing
//thats means you can set integer index on event in trigger (like SetUnitUserData function for example)

native GetTriggerEventIndex takes trigger t, event e returns integer
//thats means you can get a number of event in trigger

native TimerStart takes timer t, real period, boolean periodic, code callBack returns nothing
//so timer will save the code or new native
native SaveTimerCode takes timer t, code callBack returns nothing

native GetTimerCode takes timer t returns code
//thats means timer will return code of his callBack or null if there is no

native GetTriggerCondition takes trigger t returns conditionfunc

native GetTriggerAction takes trigger t returns triggeraction

native GetTriggerEvent takes trigger t returns event
//if trigger got more than 1 events, then returns null

native GetTriggerEventEx takes trigger t, integer eventIndex returns event
//returns an event of trigger if he got indexed, if not - return also null

native SetTriggerEventValue takes trigger t, event e, real NewValue returns nothing
//if trigger event has no index, then you can change the value of some events like Life of unit more than <value>,
//if trigger has events where is no values, then just no actions.

native SetTriggerEventValueEx takes trigger t, event wichEvent, integer eventIndex, real newValue returns nothing
//if trigger has indexed events and they can takes a value, then you can change them, if not, then no actions

native SetTriggerEventValue takes trigger t, event e returns real
// just returns a value of event if no indexed

native SetTriggerEventValueEx takes trigger t, event e, integer index returns real
//returns an indexed event of trigger value, if event has no value, then no actions

native GetUnitTimedBuffTime takes unit u, integer buffid returns real
//returns a time of timed effect of unit/hero, like morphed buff for example

native GetUnitTimedBuffTimeRemaining takes unit u, integer buffid returns real
//returns a remaining time of timed effect of unit/hero, like morphed buff for example

native SetUnitTimedBuffTime takes unit u, integer buffid, real newValue returns nothing
//same as Get function, but with set new time

native UnitPauseTimedEffect takes unit u, integer buffid, boolean pause returns boolean
//pause or unpause the timed effect of unit's buff like morphing for example. Also returns boolean //paused or not for using in conditions calls

native UnitAddStun takes unit u, boolean add returns boolean
//that means you can add/remove to unit a stun buff, doesnt matter immuned he or not.
//also returns boolean for using in condition checks.

native UnitAddBuff takes unit u, integer buffId, boolean add returns boolean
//just add a buff to unit with icon without real effects and also returns a boolean

native GetMaximumInt takes integer ArrayInt, integer arrayMin, integer arrayMax returns integer
//returns a maximumal integer wich has been defined in array
//here is a problem to define as argument array type so need a new native to save a variable name in //string and convert it back like smth
(native Var2String takes type wichType returns string)
//and also
(native String2Var takes string wichString returns type)
//have no idea how to realize this but i guess its possible, in example mb this will looks like
local integer array A
local string name = Var2String(A)
local integer maxInt
//some code with define a integers values
set maxInt = GetMaximumInt(String2Var(name),2(min array index from where to start),15(max array index when to stop))

native GetMaximumReal takes real ArrayReal, integer arrayMin, integer arrayMax returns real
//same as GetMaximumInt algorithm...
//ALSO IF TYPE IS NOT ARRAY, then just return 0

Also same natives with GetMinimalInt/Real...
 
Last edited:

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,889
JASS:
constant event UNIT_REGISTER_GOT_ABILITY(aslo buff)
constant event PLAYER_UNIT_REGISTER_GOT_ABILITY(aslo buff)
thats events means not learn skill, but when ability or buff added to unit and also lost ability or buff
also
native GetTriggerAbility takes nothing returns ability
native GetTriggerAbilityId takes nothing returns integer
//this natives responds on new events
The hell? Why would you want an event for detecting when an ability was added when you can simply do "UnitAddAbility(etc)" whenever you want and with that you already know it was added? How would this even respond to morphing units?

JASS:
native TriggerRemoveEvent takes trigger t, event e returns boolean
//removes an event from the trigger
Not sure where this would be useful for. Where would you use this?

JASS:
native TriggerDisableEvent takes trigger t, event e returns boolean
//disable an event of trigger, very usefull if trigger for example got more than 1 different events
A disabler but no enabler? More like this
JASS:
native TriggerDisableEvent takes trigger t, event e, boolean flag returns nothing
//disable an event of trigger, very usefull if trigger for example got more than 1 different events

JASS:
native SetTriggerEventIndex takes trigger t, event e, integer onWichIndex returns nothing
//thats means you can set integer index on event in trigger (like SetUnitUserData function for example)

native GetTriggerEventIndex takes trigger t, event e returns integer
//thats means you can get a number of event in trigger
Do these even have any practical use?

JASS:
native TimerStart takes timer t, real period, boolean periodic, code callBack returns nothing
//so timer will save the code or new native
native SaveTimerCode takes timer t, code callBack returns nothing

native GetTimerCode takes timer t returns code
//thats means timer will return code of his callBack or null if there is no
What does that even mean to save code? If a timer has a code callback then it already is saved, or retained? Unless it also uses other codes. Probably also gets in conflit.

JASS:
native GetTriggerCondition takes trigger t returns conditionfunc

native GetTriggerAction takes trigger t returns triggeraction

native GetTriggerEvent takes trigger t returns event
//if trigger got more than 1 events, then returns null
What happens if an idiot gets more than 1 triggercondition/triggeraction?
Why make GetTriggerEvent return null when more than 1 event while you could make it get the triggering event (the event which fired the trigger) instead?

JASS:
native GetTriggerEventEx takes trigger t, integer eventIndex returns event
//returns an event of trigger if he got indexed, if not - return also null

native SetTriggerEventValue takes trigger t, event e, real NewValue returns nothing
//if trigger event has no index, then you can change the value of some events like Life of unit more than <value>,
//if trigger has events where is no values, then just no actions.

native SetTriggerEventValueEx takes trigger t, event wichEvent, integer eventIndex, real newValue returns nothing
//if trigger has indexed events and they can takes a value, then you can change them, if not, then no actions

native SetTriggerEventValue takes trigger t, event e returns real
// just returns a value of event if no indexed

native SetTriggerEventValueEx takes trigger t, event e, integer index returns real
//returns an indexed event of trigger value, if event has no value, then no actions
None of these seem to have any use besides not making sense at all, and duplicated native names, a setter doesn't make sense to return something here honestly.

JASS:
native GetUnitTimedBuffTime takes unit u, integer buffid returns real
//returns a time of timed effect of unit/hero, like morphed buff for example
native SetUnitTimedBuffTime takes unit u, integer buffid, real newValue returns nothing
//same as Get function, but with set new time
Not needed, in 1.31.1 we can access object fields, however some of them don't work yet.

JASS:
native UnitAddStun takes unit u, boolean add returns boolean
//that means you can add/remove to unit a stun buff, doesnt matter immuned he or not.
//also returns boolean for using in condition checks.
Irrelevant if no timeout specified, and stacking would be good. Makes no sense to take a boolean "add" if the native itself is called UnitAddStun, why would anyone use false? You Can simply remove the buff with the already existing native. Has no purpose being able to use in if statements. Has no source.
JASS:
native UnitApplyUnitStun takes unit source, unit target, real timeout, boolean stack returns boolean
//that means you can stun buff to a unit, doesn't matter if immune.

JASS:
native UnitAddBuff takes unit u, integer buffId, boolean add returns boolean
//just add a buff to unit with icon without real effects and also returns a boolean
Irrelevant with same points as last one, also, no point to have a buff if there isn't effect.

JASS:
native GetMaximumInt takes integer ArrayInt, integer arrayMin, integer arrayMax returns integer
//returns a maximumal integer wich has been defined in array
//here is a problem to define as argument array type so need a new native to save a variable name in //string and convert it back like smth
(native Var2String takes type wichType returns string)
//and also
(native String2Var takes string wichString returns type)
//have no idea how to realize this but i guess its possible, in example mb this will looks like
local integer array A
local string name = Var2String(A)
local integer maxInt
//some code with define a integers values
set maxInt = GetMaximumInt(String2Var(name),2(min array index from where to start),15(max array index when to stop))

native GetMaximumReal takes real ArrayReal, integer arrayMin, integer arrayMax returns real
//same as GetMaximumInt algorithm...
//ALSO IF TYPE IS NOT ARRAY, then just return 0

Also same natives with GetMinimalInt/Real...
No, just no. One could simply define the start point and end point of an array and do their job without any effort, no need for this overcomplicated scenarios.
 
Last edited:
Level 4
Joined
Jan 7, 2014
Messages
69
What does that even mean to save code? If a timer has a code callback then it already is saved, or retained? Unless it also uses other codes. Probably also gets in conflit.
try to start a periodic timer, pause and resume after and you will see why this should be fixed...
Do these even have any practical use?
yes, if you need a priority to fire events. for example spell event fires first than event using item...dude, try first to check events until ask this and comment :)
Not needed, in 1.31.1 we can access object fields, however some of them don't work yet.
are you sure that this no need?))) when you get an acces to object fields, this does not change the time instantly. I mean here a native wich change this instantly.
No, just no. One could simply define the start point and end point of an array and do their job without any effort, no need for this overcomplicated scenarios.
and how you can put an array in function argument?))) tell me. Everytime to create a loop when you need a get max or min value in array?)) this natives just should make a life of modder easy.
P.S. You prefer to create a tons of code with systems? Or for example you can a detect how many time remains a timed buff like morph ability of unit with new 1.31.1 natives?)) no, you cant. Or detect wichh exactly buff unig got, timed or not? Loop with checking a list of defined abilities every times instead a just calling a function? My english istn perfect, but i hope you get my idea. Here i just throw an ideas of functions, and how they can help. Or why you think its bad when you can work with triggers events and indexed them? If your map got a 10 triggers with same event, how you can control wich should fire first without a system? No you cant, i created the system for that, but i prefer use natives and less code in map. How many times i needed a function for example wich can detect, a variable is defined in that function or not for example, this will very helpfull to create a systems of spells and etc.
 
Level 3
Joined
Sep 26, 2012
Messages
20
Maybe someone asking themselves about resource gathering events. Just among my friends came a question: "How detect resource gathering at worker?" Because I've thought about this suggestion:
vJASS:
native   ConvertResourceGatheredType             takes integer i returns resourcegatheredtype

constant resourcegatheredtype    GOLD_GATHERED                            = ConvertResourceGatheredType(0)
constant resourcegatheredtype    LUMBER_GATHERED                            = ConvertResourceGatheredType(1)
constant unitevent                 EVENT_UNIT_RESOURCE_GATHERED            = ConvertUnitEvent(n)
constant unitevent                 EVENT_UNIT_RESOURCE_GATHERING            = ConvertUnitEvent(n) // for wood only
constant unitevent                 EVENT_UNIT_RESOURCE_GATHERED_DELIVERED    = ConvertUnitEvent(n)
constant unitevent                 EVENT_UNIT_RESOURCE_GATHERED_DELIVERING    = ConvertUnitEvent(n)
constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_GATHERED        = ConvertUnitEvent(n)
constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_GATHERING    = ConvertUnitEvent(n) // for wood only
constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_DELIVERED    = ConvertUnitEvent(n)
constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_DELIVERING    = ConvertUnitEvent(n)

native BlzWorkerHasResourceGathered             takes unit worker returns boolean
native BlzWorkerIsResourceGathering             takes unit worker returns boolean
native BlzWorkerGetResourceGatheredType         takes unit worker returns resourcegatheredtype
native BlzWorkerSetResourceGatheredType         takes unit worker, resourcegatheredtype rgtype returns nothing
native BlzWorkerGetResourceGathered             takes unit worker returns integer
native BlzWorkerSetResourceGathered             takes unit worker, integer resourcegathered returns nothing
native BlzWorkerGetEventResourceGathered          takes nothing returns integer
native BlzWorkerSetEventResourceGathered         takes unit worker, integer resourcegathered returns nothing
native BlzWorkerGetEventResourceGatheredType    takes nothing returns resourcegatheredtype
native BlzWorkerSetEventResourceGatheredType     takes resourcegatheredtype rgtype returns nothing
native BlzGetEventGatheringWorker                 takes nothing returns unit
native BlzGetGatheringGoldmine                     takes nothing returns unit
native BlzGetGatheringTree                         takes nothing returns destructable

--- update --

vJASS:
native BlzWorkerGetEventChoppedWood takes nothing returns integer // And work with wisp's harvesting
native BlzWorkerSetEventChoppedWood takes integer setwoodchopped returns nothing
 
Last edited:
Level 4
Joined
Jan 7, 2014
Messages
69
Maybe someone asking themselves about resource gathering events. Just among my friends came a question: "How detect resource gathering at worker?" Because I've thought about this suggestion:
vJASS:
native   ConvertResourceGatheredType             takes integer i returns resourcegatheredtype

constant resourcegatheredtype    GOLD_GATHERED                            = ConvertResourceGatheredType(0)
constant resourcegatheredtype    LUMBER_GATHERED                            = ConvertResourceGatheredType(1)
constant unitevent                 EVENT_UNIT_RESOURCE_GATHERED            = ConvertUnitEvent(n)
constant unitevent                 EVENT_UNIT_RESOURCE_GATHERING            = ConvertUnitEvent(n) // for wood only
constant unitevent                 EVENT_UNIT_RESOURCE_GATHERED_DELIVERED    = ConvertUnitEvent(n)
constant unitevent                 EVENT_UNIT_RESOURCE_GATHERED_DELIVERING    = ConvertUnitEvent(n)
constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_GATHERED        = ConvertUnitEvent(n)
constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_GATHERING    = ConvertUnitEvent(n) // for wood only
constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_DELIVERED    = ConvertUnitEvent(n)
constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_DELIVERING    = ConvertUnitEvent(n)

native BlzWorkerHasResourceGathered             takes unit worker returns boolean
native BlzWorkerIsResourceGathering             takes unit worker returns boolean
native BlzWorkerGetResourceGatheredType         takes unit worker returns resourcegatheredtype
native BlzWorkerSetResourceGatheredType         takes unit worker, resourcegatheredtype rgtype returns nothing
native BlzWorkerGetResourceGathered             takes unit worker returns integer
native BlzWorkerSetResourceGathered             takes unit worker, integer resourcegathered returns nothing
native BlzWorkerGetEventResourceGathered          takes nothing returns integer
native BlzWorkerSetEventResourceGathered         takes unit worker, integer resourcegathered returns nothing
native BlzWorkerGetEventResourceGatheredType    takes nothing returns resourcegatheredtype
native BlzWorkerSetEventResourceGatheredType     takes resourcegatheredtype rgtype returns nothing
native BlzGetEventGatheringWorker                 takes nothing returns unit
native BlzGetGatheringGoldmine                     takes nothing returns unit
native BlzGetGatheringTree                         takes nothing returns destructable

--- update --

vJASS:
native BlzWorkerGetEventChoppedWood takes nothing returns integer // And work with wisp's harvesting
native BlzWorkerSetEventChoppedWood takes integer setwoodchopped returns nothing
i think its can be detected from orders. mb not))
 
Level 3
Joined
Sep 26, 2012
Messages
20
i think its can be detected from orders. mb not))
And were you thinking about their accuracy?
One orders aren't enough for a more trick things but some modders think wider. A therefore alone orders maybe an unusable. I hope that suchlike natives will be usable. Just as some maps can use the systems for resource's gathering which can be of any type. E.g.: minerals, oil, gold, gems, crystals and etc. And everything this interacts with the custom Game UI constructed by frame natives.
 
Level 4
Joined
Jan 7, 2014
Messages
69
And were you thinking about their accuracy?
One orders aren't enough for a more trick things but some modders think wider. A therefore alone orders maybe an unusable. I hope that suchlike natives will be usable. Just as some maps can use the systems for resource's gathering which can be of any type. E.g.: minerals, oil, gold, gems, crystals and etc. And everything this interacts with the custom Game UI constructed by frame natives.
idk, never had a this questions, but ive seen some hidden and also seen an orders about resource gathering.:) anyway, more natives - more good maps and more players. So ofc they should be :), also im for a less shaman's dances of users to find a descisions of their questions.
 
Level 6
Joined
Mar 7, 2011
Messages
124
Not all of them have been added, and some of what isn't there won't be there at all in the near future. Unfortunately, there is no single full / current documentation of the JASS API...

I'd recommend using JASS Manual for all natives before 1.24, and then the individual patch notes for new natives since 1.24. I would guess that there won't be a up-to-date single source of documentation until the API settles down, optimistically, around Reforged's release
 
Level 14
Joined
Aug 31, 2009
Messages
775
I was really excited to read about the implementation of Proxies (spell casting dummies), customisable missiles, bars, detecting when a unit releases an attack... but then to learn those functions don't even exist in my common.j or blizzard.j files yet was a huge letdown.
 
Level 6
Joined
Mar 7, 2011
Messages
124
I was really excited to read about the implementation of Proxies (spell casting dummies), customisable missiles, bars, detecting when a unit releases an attack... but then to learn those functions don't even exist in my common.j or blizzard.j files yet was a huge letdown.
Some of that is fine then, because the need was filled using a different name / implementation than the original plan, and you just aren't looking for the right thing.

Using a WC3 spell as the base for additional custom spells has been deprecated in favor of directly manipulating the visual effects that compose it. For example, if I wanted a unit to cast a custom spell then I would give the appropriate unit a placeholder ability and listen to when it was activated. The placeholder ability would do nothing beyond be castable and have a mana cost, all the real work would happen in the event listener for it being cast. The beauty of this is that I can easily remove the unit / placeholder ability and still have my custom spell (and it can be cast without a unit/dummy source)

I'm not sure what you mean by "customisable missiles", but I'm pretty sure you could achieve this using any number of methods. Could you elaborate on what you're thinking of?

I think in game "bars" have either been released or are still on the menu for near future

Detecting when a unit releases an attack would be a nice event to have for a few very specific needs, but I don't know that its generally useful enough to merit its existence/cost. Anyways, for your needs, are you going to fire that "on attack released" event a lot? If its infrequently, then it might be best for you to implement your own order system on top of the vanilla WC3 system. You'd obviously be able to control your system's design, and could easily add in an OnAttackReleased Event
 
Level 14
Joined
Aug 31, 2009
Messages
775
Really not sure what you're talking about.

I'm talking about the list of natives on the First Post of this Thread (by Kam).

There's custom missile native functions, proxies, bars, detecting when a unit releases an attack etc... they're all listed there. But NONE of them are in the current game, common.j, blizzard.j or anything. That's why I'm confused... why is a Blizzard employee just listing random natives that do or don't exist? That's why I was asking for clarification.

Yes I know you can do dummy spells in other ways, but it's cumbersome and forces you to create dummy units (that take up unnecessary memory) and move them around. The natives listed on the first post of this thread mention that it can be done so much better:
Kam said:
JASS:
 //Proxies
    /*
    Proxies are essentially units - dummy casters to be exact, that are less performance-heavy. They have no collision, no model (though you may attach something to their "origin"), no
    movement type, nothing. They only move through triggers (SetUnitX/Y) and can cast spells regardless of mana cost, tech requirement, cooldown. They can also cast an unlimited amount
    of spells without any downtime so potentially only 1 proxy will ever be needed per map, or per player. One key aspect to proxies is that all actions they take is creditted to a source
    unit, so this way if a proxy kills a unit using a spell, the game will register the source unit as having earned that kill. Depending on the allegiance of the source will determine
    whether a target can be hit with a spell or not (eg: if the source is an ally of the target of the Proxy, the Proxy cannot cast Storm Bolt at the target).
    NB: the Proxy type is affected by most of the relevant unit triggers, like SetUnitX/Y and RemoveUnit. It can be added to unit groups, etc.
    */
    function CreateAbilityProxy takes unit source, real x, real y, real z returns proxy    //This is essentially a dummy of which all the actions it takes will be credited to the source.
    function SetProxySource takes proxy dummy, unit source returns nothing              //Modifies the source of the proxy.

Not to mention that this proposed method also links the source of the caster, which is not currently possible right now.

As for the missiles, again, read the original post:
Kam said:
JASS:
//===========================================================================
// MISSILE
//===========================================================================

    type missile extends agent //New variable type - missile
    type missileevent extends eventid //New event type for missiles

    constant unitevent EVENT_UNIT_MISSILE //Event of missile hitting a unit
    constant missileevent EVENT_MISSILE_IMPACT //Even of missile reaching a point

    function CreateMissileOnUnitToUnit takes unit target, unit source, real height, real speed, real arcangle, real scale, string modelpath returns missile //Creates a missile that moves from one point to another. Upon impact triggers EVENT_UNIT_MISSILE.
    function CreateMissileOnPointToUnit takes unit source, unit target, real x, real y, real height, real speed, real arcangle, real scale, string modelpath returns missile //Like one above but from point to unit
    function CreateMissileOnPointToPoint takes unit source, real x1, real y1, real x2, real y2, real height, real speed, real arcangle, real scale, string modelpath returns missile //Like ones above but from point to point. Upon impact triggers EVENT_MISSILE_IMPACT.

    function SetMissileX takes missile m, real x returns nothing //Sets X coordinate of missile
    function SetMissileY takes missile m, real y returns nothing //Sets Y coordinate of missile
    function SetMissileHeight takes missile m, real height returns nothing //Sets height of missile
    function SetMissileTargetPoint takes missile m, real x, real y returns nothing //Sets the target that missile will move at
    function SetMissileTargetUnit takes missile m, unit u returns nothing //Missile will move to targeted unit
    function SetMissileSourceUnit takes missile m, unit u returns nothing //Detects a unit that spawned missile
    function SetMissileSpeed takes missile m, real speed returns nothing //Sets missile speed
    function SetMissileScale takes missile m, real scale returns nothing //Sets missile size
    function SetMissileArcAngle takes missile m, real angle returns nothing //Sets missile arcangle
    function SetMissileModel takes missile m, string path returns nothing //Sets missile model

    function GetEventMissile takes nothing returns missile //Returns a missile that reached its target

    function GetMissileX takes missile m returns real //Returns current X of a missile
    function GetMissileY takes missile m returns real //Returns current Y of a missile
    function GetMissileHeight takes missile m returns real //Returns current height of a missile
    function GetMissileSpeed takes missile m returns real //Returns current speed of a missile
    function GetMissileScale takes missile m returns real //Returns current size of a missile
    function GetMissileArcAngle takes missile m returns real //Returns current arcangle of a missile

    function RemoveMissile takes missile m, boolean animation returns nothing //Deletes a missile. Flag animation depends if it will play death animation or not

Of course you can do custom missiles by coding in your own logic for movement, arcs etc, but this native support makes it a million times easier.
 
Last edited:
Level 14
Joined
Aug 31, 2009
Messages
775
Finally someone answered the question!
So basically, they're not in the game yet, but what people want to be added.

Shouldn't the first post be edited to say this a bit more clearly? Googling "Wacraft 3 new natives list" brings you here, and is kinda misleading.
 
Level 6
Joined
Mar 7, 2011
Messages
124
Yes I know you can do dummy spells in other ways, but it's cumbersome and forces you to create dummy units (that take up unnecessary memory) and move them around. The natives listed on the first post of this thread mention that it can be done so much better:
doing it "other ways" should take less memory, not more. my point was that you are no longer forced to create dummy units because of the new natives. i doubt anyone will use dummy casters again by choice for custom spells. the proxy API may eventually appear if there is enough need to support dynamic casts of existing vanilla spells. i wouldn't count on it, given an alternative has been supplied

It is kind of a wish/request list.
Finally someone answered the question!
So basically, they're not in the game yet, but what people want to be added.

Shouldn't the first post be edited to say this a bit more clearly? Googling "Wacraft 3 new natives list" brings you here, and is kinda misleading.
i think this has been said a few times now, though maybe in slightly less obvious terms
 
Last edited:
Level 14
Joined
Aug 31, 2009
Messages
775
Serenity09 said:
i think this has been said a few times now, though maybe in slightly less obvious terms
Considering that the first reply to my question said "All of them were added long ago" (which is completely false), the second and third responses can be surmised as "Some of them, but not all of them and some will be removed or not exist in the future" followed by a slew of unrelated comments, I hope you can see why I was confused.

One question I do still have though - how exactly could you link the source of a spell to the caster? As an example, if I wanted a unit to cast a modified Shockwave to fire 5 small shockwaves in a cone - how do you link the damage of each of the smaller shockwaves to the original caster? This doesn't seem to be possible with the "AddSpellEffect" natives. You could cast a shockwave from the correct points, but how you do know which unit owned the cast? You can't correctly determine the killer if the shockwaves kills in this case.

This is why I thought the proxy method listed in Kam's post was superior. You just cast 5 different shockwaves offset by angles, with the source set to the original caster. Done.
 
Level 6
Joined
Mar 7, 2011
Messages
124
Think of WC3's implementation of spells as having a unit source, a condition to activate, and a functional effect. The source is always a unit, the condition is usually some check on the source and/or target, and the functional effect is any code. WC3 functional effects often involve an area/target, visual effects, sound effects, state changes, sometimes instant, sometimes over a set period of time. The first and second part of this design might seem intuitive for the melee/vanilla component of the game, but it leads to awkward situations in custom maps where you need to create a proxy caster just to get to the functional effect of a spell, when, really, that last piece was all you ever wanted. If we just focus on the last part of the spell design, the spell having an effect, we can now fully achieve that using the new & existing natives, without having to rely at all on a vanilla spell object. Part of the beauty of the new special effect API is it gives you smaller pieces to work with, which can still be connected to conventional WC3 spells (cast by a unit via an ability)

One question I do still have though - how exactly could you link the source of a spell to the caster? As an example, if I wanted a unit to cast a modified Shockwave to fire 5 small shockwaves in a cone - how do you link the damage of each of the smaller shockwaves to the original caster? This doesn't seem to be possible with the "AddSpellEffect" natives. You could cast a shockwave from the correct points, but how you do know which unit owned the cast? You can't correctly determine the killer if the shockwaves kills in this case.
For your specific question, you'd want to keep references to both the unit caster of the spell and the special effects/locations representing each shockwave. Then you'd update those references over time, both to visually display the spell and apply damage from the appropriate source (the original caster). You could connect this code by listening for vanilla unit spell/ability casts via call TriggerRegisterAnyUnitEventBJ(YourSpellTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT) and then, in the event callback, check GetSpellAbilityId() returned the same raw object ID as your placeholder spell/ability (raw ID code can be found in the object editor)

This is why I thought the proxy method listed in Kam's post was superior. You just cast 5 different shockwaves offset by angles, with the source set to the original caster. Done.
I'm in agreement with you, I think that the Proxy API supports dynamic casts of existing vanilla spells. Currently, your plan to just cast 5 vanilla shockwaves with slight configuration changes to each is a great fit for the Proxy API

However, as soon as you want to go beyond what any given spell allows you to configure, you'll be much better off dealing with the new special effect API. My point is that each API has its own use cases, but you could still get your custom shockwave with just a bit more lifting than your original Proxy based design
 
Level 14
Joined
Aug 31, 2009
Messages
775
This is what I meant. It's way more code to write your own projectiles, track their locations, update them every game tick, control who was hit by what etc. when that code all already exists in the game in the form of the base Shockwave skill.

Now if those natives listed under "Missiles" in Kam's post are added, that already goes a very long way to smoothing out that coding requirement. It will give trackable missiles, so all the movement, locations and trajectories are done already and you have to do the other parts manually.

So what I wonder is, is the current Spell Effect API capable of doing say a Shockwave that applies Curse (and its debuff) to hit targets? I bet you can't without having something cast a curse on the unit.
 
Last edited:
Level 6
Joined
Mar 7, 2011
Messages
124
This is what I meant. It's way more code to write your own projectiles, track their locations, update them every game tick, control who was hit by what etc. when that code all already exists in the game in the form of the base Shockwave skill.

Now if those natives listed under "Missiles" in Kam's post are added, that already goes a very long way to smoothing out that coding requirement. It will give trackable missiles, so all the movement, locations and trajectories are done already and you have to do the other parts manually.
First off, you're being a little dramatic, it's like maybe 3-4 lines of JASS code to move a point over time in a straight line, and reposition the special effect on that point. Add another 6 lines for damaging everything in a radius around the point each tick. You could literally be done with the entire thing by the time we've had this full conversation, even if you had to look up how to use sin and cos to do it
Secondly, part of the point of moving away from vanilla spells/abilities is that you literally cannot directly access their implementation as JASS -- you can only access them via issuing a unit order. So when you say "that code all already exists in the game in the form of the base Shockwave skill", i say it might as well not exist at all for most purposes

So what I wonder is, is the current Spell Effect API capable of doing say a Shockwave that applies Curse to hit targets? I assume it can, and that's where the base game's shockwave wouldn't be sufficient.
The special effect API isn't driving anything beyond the visual component of the spell. Whatever is calling the special effect API is also applying the damage to hit targets, and just as easily apply curse to hit targets. So yes, you're mostly right
You'd also get to choose not to apply the terrain deformation, which leaks every iteration. This might be a really nice choice, if your map has a long average play time / many custom shockwave casts

EDIT - Actually, I do get not wanting to make your own projectile-like implementation with one from blizzard probably on its way. I guess my recommendation then is to just wait and see, at least till reforged comes out or you get too bored
 
Last edited:
Level 14
Joined
Aug 31, 2009
Messages
775
I wouldn't say it was just a handful of lines - you'd need to make it MUI for a start, and keep track of targets already hit. Anyway, it's besides the point - the point being that the proxy system would achieve this in less than 10% of what's needed in the other method.

I also want to make it clear that I'm not talking about Special Effects - I know what they are and how to do them - I'm referring not to the visual, sound or whatever component of the spell. I'm specifically referring to editing what the spell DOES. Would it be possible to "cast" a customized curse (with my own choice of percentage chance to miss) on a unit of my choosing without creating a dummy unit to cast it, and without creating the spell inside the object editor first? Would the debuff show up on the unit (again, customized debuff of my choosing) affected and correctly cause the unit to miss attacks, be dispellable etc.? - like a normal game Curse cast by the Banshee unit but with edited text or percentage chances.

As far as I know, you can't apply a buff (or debuff) to a target without the spell actually being cast somehow (or giving the unit a self-affecting aura, but that wouldn't be dispellable). But you said "and just as easily apply curse" but I don't see how you could achieve the above using only special effects and JASS. If you say you can, then show me what natives I'm missing out on here, because I'm not finding anything of the sort in the common.j nor blizzard.j files.

Sorry if I'm just being dense here, but I'm really not getting what you're saying.

EDIT: Trust me, I don't want to make my own missile system. Me and My friend Arxos did this already, and it was a huge and exceptionally complex system. Look at the first post of this entire thread and read the "Missiles" section. That's what I'm referring to.
 
Level 6
Joined
Mar 7, 2011
Messages
124
I also want to make it clear that I'm not talking about Special Effects - I know what they are and how to do them - I'm referring not to the visual, sound or whatever component of the spell. I'm specifically referring to editing what the spell DOES. Would it be possible to "cast" a customized curse (with my own choice of percentage chance to miss) on a unit of my choosing without creating a dummy unit to cast it, and without creating the spell inside the object editor first? Would the debuff show up on the unit (again, customized debuff of my choosing) affected and correctly cause the unit to miss attacks, be dispellable etc.? - like a normal game Curse cast by the Banshee unit but with edited text or percentage chances.

As far as I know, you can't apply a buff (or debuff) to a target without the spell actually being cast somehow (or giving the unit a self-affecting aura, but that wouldn't be dispellable). But you said "and just as easily apply curse" but I don't see how you could achieve the above using only special effects and JASS. If you say you can, then show me what natives I'm missing out on here, because I'm not finding anything of the sort in the common.j nor blizzard.j files.
Sorry, I got confused to what you meant. I thought you just meant the special effect, but you mean the whole buff. You're right that there's still no way to add buffs/debuffs to units outside of casting spells/abilities. This could be addressed via casting a spell resulting in the desired buff using the Proxy API, but would be more directly solved via a Buff API, which was in the original wish list. I would guess that the Buff API is one of the higher priority remaining features, given that they've already started the push for fully scripted spells, before Blizz goes into pure QA/QC mode
 
Level 14
Joined
Aug 31, 2009
Messages
775
Thanks for bearing with me. I thought I was just going insane or something and wasn't seeing how buffs and spell effects like it were being done without them being "cast" by something.

And you're right - a Buff API would be exceptionally useful, especially if it means we could combine multiple effects together (e.g. combining Silence and Curse into a single buff would be interesting, as that's currently utterly impossible to do right now).

I'm glad we got that all cleared up. So, I suppose we just have to hang on for a while until we get more news or reforged itself lands.
 
Level 6
Joined
Mar 7, 2011
Messages
124
I'm glad we got that all cleared up. So, I suppose we just have to hang on for a while until we get more news or reforged itself lands.
it's sorta an exercise in patience at the moment. it's funny because the longer we have to wait for reforged to release the more likely we are to get these functions. the majority of new/high-risk scope will probably happen before release, and then there will likely be a greater emphasis on continued stability


I'd like to request exposing two new natives, both probably already exist under the hood, supporting other natives. It would be useful to have async natives to get (local) mouse position x, y (and optionally location, but I don't see the need since its async so who cares about that particular optimization). There are natives for getting async camera target position x, y; and plenty of async natives for setting/panning camera target position. There is also an async native for setting a player's mouse position, but there are only the synchronized natives for getting mouse position (for trigger player). It would be useful to have async versions of the mouse position getters too, since they can often be used in tandem with the async camera target position logic. Ex an AFK system could elegantly have each local player check their own mouse and cam positions asynchronously, and then synchronize a change in overall AFK state (not total time, but the actual boolean AFK flag) via the new BlzSendSyncData native with all players registered to receive it.
Beyond async mouse position fitting in with other existing API's design, they would also serve as a fundamental building block for other systems, that a synced mouse position native is too large to easily fill. That said, I think that the (optimally) synced mouse position is by far the more important native to have, so if it came down to choosing I'd keep that one
 
Level 14
Joined
Aug 31, 2009
Messages
775
Well, no it isn't enough. For example, being able to do custom projectiles is probably one of the biggest things and a way to apply buffs / debuffs without needing a dummy unit system that we write ourselves.

Sure, manipulating damage is fine and all, but we still have to do really janky workarounds just to do something as simple as put a slow effect on a target.

Let's say you want something as simple as this spell:
"Fire a projectile in a straight line. The first unit hit and units nearby take X damage and have their movement and attack rate slowed by Y% for Z seconds"

This would need you to write 3 entire systems for it: One, you need to do a projectile system of some kind to detect the movement and collision of the spell, followed by a bunch of dummy units to apply a modified slow spell on each unit, as well as a way to handle those dummies in a memory efficient manner (i.e. recycling them rather than making more each time). Oh, and you'd need a custom dummy unit in the object editor, a custom slow spell, and a custom spell for the ability itself. That's 2 more things than should be necessary - only the last should be needed ideally.

The reason this annoys me is because in the "list" it specifies actual natives for projectiles and handling spell casts without a bunch of invisible dummy units. Both would massively save on resources, programming time, and just generally make everything easier for far more practical uses. Editing the interface is a lot more advanced, and only really benefits those wanting to massively stretch the bounds of Warcraft's engine capabilities to make entirely different games. Rather, shouldn't we focus on functions making "warcraft like" (i.e. top-down strategy with units, spells and abilities) games easier to make first?
 
Level 6
Joined
Aug 28, 2015
Messages
213
I agree with the two above.
I appreciate the natives to manipulate the UI more because it wasn't really possible before to do things with the UI,
but as I started, needing more advanced systems, there was at least already 3 missile/projectile or jumping systems made from the community, I could choose from.
Of course it's nice to just have to edit less from a pre-made well integrated systems actually the few things you want different.
That's why so many great people in this community are making and publishing awesome systems for us to use.
I personally also wait for someone smarter and more dedicated person to rewrite a projectile with the special effects natives in LUA
but I'm okay with using what I got so far and would like to get actually new natives that changes the way we can interact with the game in a completely new way.
 
Level 14
Joined
Aug 31, 2009
Messages
775
You can do custom projectiles with the new special effect natives relatively easily, no dummy unit required.
I know you can do the projectile without a dummy, but you still have to write all of its movement yourself. But you can't do an effect like apply a debuff / buff yet without dummies.

As for for what apsyll said, me and my friend are working on a projectile system using Lua. We've already made a buff system in Lua, but that still can't display buffs on the unit's status bar unless a dummy casts something.
 
There's an obvious solution to this problem, and I am working on it. Rewrite your own replica of the game for modding where you can invent your own natives. It will still require an official install, yet it'll give me the tools for efficient modding that I always wanted:

 
Level 39
Joined
Feb 27, 2007
Messages
5,016
I know you can do the projectile without a dummy, but you still have to write all of its movement yourself. But you can't do an effect like apply a debuff / buff yet without dummies.
The point of publicly available libraries that this site hosts is specifically to address this so you don’t have to do it yourself if you find it to be a pain. One person writes and perfects something and everyone benefits.

When ObjectMerger worked, being able to declare objects in code worked just fine.
 
Level 5
Joined
May 20, 2008
Messages
138
This may be a stupid question, but where do I find a list of all the new natives/triggers that have been added, and what they do?
 
Status
Not open for further replies.
Top