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

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Then u go with items you dont wanna silence (eg Reincarnation)
Sure, you can have a separate function or a flag for that.

Those functions are barely useful in the way you propose them
I reckon they are, considering the workarounds. But hey, if you think otherwise, you've got yourself a good remedy for that.
 
Level 11
Joined
Jun 2, 2004
Messages
849
Could we get a "BlzStartUnitAbilityCooldown" to go with the added "BlzEndUnitAbilityCooldown"? It seems currently impossible to start the cooldown of an ability without A) actually using it or B) using an ability with the same order string (not possible if incapacitated, afaik).

My current use case would be wanting to simulate the cast of an ability without interrupting channeling abilities or having to wait for the unit's cast point. (someone please educate me if I'm wrong about this)
 
Last edited:
Level 11
Joined
Jun 2, 2004
Messages
849
You'll have to elaborate if you know how to accomplish it.

(oh and just in case there's some confusion, the "BlzSetUnitAbilityCooldown" native is insufficient; I want to START the ability cooldown, not merely change the object editor field through triggers.)
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
Could we get a "BlzStartUnitAbilityCooldown" to go with the added "BlzEndUnitAbilityCooldown"? It seems currently impossible to start the cooldown of an ability without A) actually using it or B) using an ability with the same order string (not possible if incapacitated, afaik).

My current use case would be wanting to simulate the cast of an ability without interrupting channeling abilities or having to wait for the unit's cast point. (someone please educate me if I'm wrong about this)
What the hell is "BlzEndUnitAbilityCooldown" supposed to do? reset cooldown? There is already a method for that.
I think "BlzTriggerUnitAbilityCooldown" is more clear than "BlzStartUnitAbilityCooldown", also i already had suggested this one in one of my earlier posts, and someone replied to me stating that it doesn't support passive abilities.
 
I would find some of these natives to be pleasant to note:

Pleasantries in unit editing.

JASS:
native GetUnitAttackRange takes unit u, integer index returns real

native SetUnitAttackRange takes unit u, integer index, real newR returns nothing

native GetUnitArmorType takes unit u returns armortype

native GetUnitDamageType takes unit u, integer index returns damagetype

native GetAttackDamage takes nothing returns real
    // The damage to be dealt to the target with a physical attack.

native SetAttackDamage takes real r returns nothing
    // Sets the damage dealt by an attacker on attack proc. Different from SetEventDamage.
   
unitevent
EVENT_UNIT_ATTACK_RELEASE
    // A unitevent that procs on the release of an attack.
    // Also triggers EVENT_UNIT_TARGET_SUCCESS afterwards.

unitevent EVENT_UNIT_TARGET_SUCCESS
    // A unitevent that runs after target in range.
    // If it runs, the targeting ability is successful.

A list on what to do in code.

JASS:
type pointer extends code, handle
    // A handle type that is generated on reference call that automatically gets recycled.
    // Recycle point is at the decay of the function.

native GetPointer takes code c returns pointer
    // returns a new pointer handle that refers to code.
    // Also defaults all parameters required by said code to 0 for the pointer handle.
   
native DestroyPointer takes pointer p returns nothing
    // Destroys a pointer.
    // Clears all the arguments, defaulting them to 0.

native GetPointerParameters takes pointer p returns integer
    // Returns the number of arguments to supply.

native TimerGetPointer takes timer t returns pointer
    // It gets the pointer to the function, and generates a pointer handle once.
    // Subsequent calls return the same pointer handle.

native TimerGetCode takes timer t returns code
     // Returns the current pointer (not handle) to the function.

native PushArgument takes pointer p, integer arg returns boolean
    // Pushes an integer argument, which is implemented to be type-safe.
    // I would presume this is most difficult to do when implementing type-safety along with it.
    // If pushing data to a pointer that has no arguments, do nothing.
    // It is allocation-based addition of data, meaning if the number of arguments...
    // Is 3, it starts from 1 up to 3.
    // Subsequent calls do nothing.

native ClearArgument takes pointer p, integer post returns boolean
    // If double-free case is detected, or
    // Invalid positions return false
    // Deallocate the position of argument.

native TimerQueue takes timer t, real r, code c returns pointer
    // If the timer hasn't started, internally call TimerStart(t, r, false, c)
    // Else, proceed with queuing.
    // Queued functions do not repeat.
    // If successful, return a new pointer handle to the function.

native JumpTo takes code c returns nothing
     // Basically what the call keyword is used for.
     // However, the difference is that it can take any code at run-time as opposed to a static code at compile time.
     // Does not create a new thread.

native JumpEx takes pointer p returns nothing
    // Basically calls JumpTo, with the difference being that you are able to call
    //functions dynamically with the right arguments.

Example usage:

JASS:
function HandlerFunc takes unit u returns nothing
    call SetWidgetLife(u, GetRandomReal(100, 350))
    call DestroyTimer(GetExpiredTimer())
endfunction

function Caller takes nothing returns nothing
    local timer t = CreateTimer()
    call TimerStart(t, 0.01, false, function HandlerFunc)
    call PushArgument(TimerGetPointer(t), GetHandleId(GetTriggerUnit()))
    set t = null
    call JumpTo(null)
endfunction

With the fix on memory writing in script, can we have code arrays again?

JASS:
code array

native SaveCode takes hashtable h, integer pKey, integer cKey, code c returns nothing

native LoadCode takes hashtable h, integer pKey, integer cKey returns code

native HaveSavedCode takes hashtable h, integer pKey, integer cKey returns boolean

native RemoveSavedCode takes hashtable h, integer pKey, integer cKey returns nothing.
 
Last edited:

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
JASS:
native GetAttackDamage takes nothing returns real
    // The damage to be dealt to the target with a physical attack.

native SetAttackDamage takes real r returns nothing
    // Sets the damage dealt by an attacker on attack proc. Different from SetEventDamage.
  
unitevent
EVENT_UNIT_ATTACK_RELEASE
    // A unitevent that procs on the release of an attack.
    // Also triggers EVENT_UNIT_TARGET_SUCCESS afterwards.

unitevent EVENT_UNIT_TARGET_SUCCESS
    // A unitevent that runs after target in range.
    // If it runs, the targeting ability is successful.
How is "GetAttackDamage" something new? How's that different from GetEventDamage?
Again, how exaclty is SetAttackDamage different from SetEventDamage, also what does "proc" even mean?
Isn't EVENT_UNIT_ATTACK_RELEASE the same as EVENT_UNIT_IS_ATTACKED?
EVENT_UNIT_TARGET_SUCESS = EVENT_UNIT_DAMAGE??
Sounds confusing
 
Looks like I didn't clarify my description for GetAttackDamage. It contains a value on an EVENT_UNIT_ATTACKED event but not on EVENT_UNIT_DAMAGED events.

Since there is no existing constant with the name EVENT_UNIT_IS_ATTACKED, I came up with EVENT_UNIT_ATTACK_RELEASE, when the front animation is done, the missile is released, etc.

Now, EVENT_UNIT_TARGET_SUCCESS is one peculiar unitevent in that it procs when the targeting ability is successfully executed. Attacking and casting abilities are not differentiated yet, and will fire this event.

My ultimate intention for the event above is that we can build a native miss detector from that unit event, as much as I would like to have a native unit event for that.
 
Level 4
Joined
Nov 20, 2016
Messages
75
Question: Has this been implemented?

Code:
function GetEventDamageAbilityId takes nothing returns integer        
//In response to a damage event returns the ability ID that caused the damage. This ability can be a damage spell (Flame Strike, Storm Bolt, etc) or an attack modifier ability (Cold Arrow, orb of fire, etc). Normal attack damage returns some safe default value such as 0.
 
Level 11
Joined
Jun 2, 2004
Messages
849
Echoing my request for letting triggers access arbitrary object editor data instead of having random hardcoded getters and setters.

Currently I'm needing to get some data out of an ability (the buff ID and order string). As such, I'm once again copying the data to a field I'm not using and abusing one of the hardcoded getters (in this case, BlzGetAbilityActivatedTooltip) to have the data accessible to my triggers, instead of something sane like pulling the data from the real fields. My only other option is to do something annoying like putting the data in an array or hashtable indexed by the ability ID/level, which is even more tedious.

I understand not having setters for everything, but having to make a new getter for every field is more work for both the devs and mapmakers.
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Echoing my request for letting triggers access arbitrary object editor data instead of having random hardcoded getters and setters.
Already proposed this a few pages ago. Wc3 mappers are in contact with low-level stuff enough that this wouldn't be a crime, and it's totally justifiable given the slow rhythm of updates and the poor compilation process.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Not sure if this one has already been mentioned or not, but imma copy paste this one straight from SC2 (Actually, idk how to check jass on SC2 so I just wrote what I'm assuming the function looks like)

Code:
native MakeUnitUncommandable takes unit whichUnit, boolean flag returns nothing


Also, being able to chose before/after/override for issued orders like in SC2 would also be pretty nice. I know a lot of people have been asking to be able to queue orders like how you can shift + click ingame to queue orders.

  • Issue Order
    • Unit: Triggering Unit
    • Order: Order With No Target
      • Ability Command: Smart Command
    • Queue: After Existing Orders
Again, sorry that I don't really know how it would look like without GUI...
 
Level 4
Joined
Nov 20, 2016
Messages
75
Not sure if this one has already been mentioned or not, but imma copy paste this one straight from SC2 (Actually, idk how to check jass on SC2 so I just wrote what I'm assuming the function looks like)

Code:
native MakeUnitUncommandable takes unit whichUnit, boolean flag returns nothing


Also, being able to chose before/after/override for issued orders like in SC2 would also be pretty nice. I know a lot of people have been asking to be able to queue orders like how you can shift + click ingame to queue orders.

  • Issue Order
    • Unit: Triggering Unit
    • Order: Order With No Target
      • Ability Command: Smart Command
    • Queue: After Existing Orders
Again, sorry that I don't really know how it would look like without GUI...


Being able to manipulate the order queue would be great
 
Level 12
Joined
Nov 3, 2013
Messages
989
Edit: It's already on the list.

Not sure if these count as natives or whatever, but constants should fit here as well, I think?

Anyway, WC3 could really use an EVENT_PLAYER_UNIT_ATTACKED_EFFECT event, like an auto attack version of
  • Unit - A unit Starts the effect of an ability
Like how
  • Unit - A unit Is attacked
is the auto attack equivalent to
  • Unit - A unit Begins casting an ability

For melee auto attacks it's not that significant, since a DDS system can generally take care of it. But especially for ranged auto attacks, if you want an event to fire when an archer just released an arrow from their bow or something then a DDS doesn't cut it.

Only work-around for that that I know of is to turn all ranged auto-attacks into instant/normal and trigger the projectiles with a missile system or the like.
 
Last edited:
This is for Patch 1.30.

JASS:
native IsUnitAbilityDisabled takes unit u, integer abilId returns boolean
    // Returns a flag whether or not an ability is silenced. (Based on the counter mechanism for disabling and enabling abilities, exposed as a native)

unitevent EVENT_UNIT_EVADE
    // A unitevent that fires on evasion.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I just got happy seeing this and remembered that this is only a "Please, do this" thread...

JASS:
native IsUnitAbilityDisabled takes unit u, integer abilId returns Boolean
// Returns a flag whether or not an ability is silenced. (Based on the counter mechanism for disabling and enabling abilities, exposed as a native)
Shouldn't that be named differently? There are quite a few ways to disable an ability different than silence. And by "Quite a few" I mean 1 (maybe 2) other ways :|

Edit// Can you even evade splash damage? Is splash damage evade-able ?

regards
-Ned
 
Level 12
Joined
Nov 3, 2013
Messages
989
I just got happy seeing this and remembered that this is only a "Please, do this" thread...

JASS:
native IsUnitAbilityDisabled takes unit u, integer abilId returns Boolean
// Returns a flag whether or not an ability is silenced. (Based on the counter mechanism for disabling and enabling abilities, exposed as a native)
Shouldn't that be named differently? There are quite a few ways to disable an ability different than silence. And by "Quite a few" I mean 1 (maybe 2) other ways :|

Edit// Can you even evade splash damage? Is splash damage evade-able ?

regards
-Ned
There's this field called "Missed Attacks Damage Factor" in game constants for splash damage attacks. Tbh I'm not completely sure how it works, but either way, since it does say damage factor, even if they miss, they still deal damage. So I'm not sure if you can still call it being evaded...

But presumably it has to do with splash attack being homing, but you get out of the range or something, so that 25% miss chance from high ground or moving out of range happens or something... Just my guesses
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
Missile (splash), the splash damage is not evadable in anyway, only if you are out of its damage area.
Now that we're talking about evasion stuff...
Would be cool to do this:
JASS:
native MakeUnitMissAtk takes unit u returns nothing
//Makes unit miss its next attack.
Wasn't unitevent EVENT_UNIT_EVADE already asked here?
 
Level 8
Joined
Mar 19, 2017
Messages
248
Missile (splash) always damage it's intended target. If the missile is set to Homing > False, it still applies the small area damage factor to units that tread to far. Giving this last fact, is recommended to set the homing field to true, as it will look very weird how units take damage from a missile that exploded very far or that you can't see at all.

But you can potentially use Missile (splash) units to feature a pseudo-evade system. Not really the vanilla WC3 evasion for missiles (i think the only effect is that the missile is directed to the ground instead of the unit impact Z).

If you set the small area damage factor to 0.01 for a unit with Missile (splash), units that are inside the small area damage will take almost no (in fact dmg*factor, but you get the idea) damage.
You could say that units with high damage will deal damage regardless, but this is counterable by using a damage event trigger (or your handy DDS) and the new attack damage functions. If you detect physical/attack damage type (most DDS allows this feature) and it happens that the damage event amount is less than the attack (here comes the new attack get functions) multiplied by the small area damage factor, then you got a missed attack. Then you apply the events.
This is no theorycraft at all, and allows for manual evasion of attack missiles. The distance of evasion will be basically the medium damage area of the unit that attacks.

The sad part of Missile (splash) is that some abilitis will not work, ie. Barrage, Flaming Arrows, Cold Arrows, etc.
Orb of Annihilation (don't remember the exact name) works with units with Missile (splash) and allows to potentially increase area of effect dinamically (multiple levels).
 
Level 12
Joined
Nov 3, 2013
Messages
989
Oh right, I thought of something, and I can't see it listed under the Unit section. Though I did notice there's already this:

JASS:
function SetUnitMovementType takes unit u, movementtype movementType returns nothing
        //Changes the movement type of a unit to the specified movement type.

But it would be nice to also have the ability to change unit targeting tags and classifications. Stuff like: Ground, Air, Organic, Mechanical, Ward, Tauren, Undead, Giant, etc.

For instance, if I changed the unit's movement type to flying, I might also want to change it from being targeted as a ground unit to a flying unit.

Otherwise it would be kind of stupid if melee units could attack my flying unit.
 
Missile (splash), the splash damage is not evadable in anyway, only if you are out of its damage area.
Now that we're talking about evasion stuff...
Would be cool to do this:
JASS:
native MakeUnitMissAtk takes unit u returns nothing
//Makes unit miss its next attack.
Wasn't unitevent EVENT_UNIT_EVADE already asked here?

It's a follow up request.

 
But it would be nice to also have the ability to change unit targeting tags and classifications. Stuff like: Ground, Air, Organic, Mechanical, Ward, Tauren, Undead, Giant, etc.

Classifications are already available and have been for 15 years via the native UnitAddType (and IsUnitType for checking them)

I don't recall how it affects target types. But I wanted to point this out before Blizzard spends their time coding an API that they already gave us 15 years ago. The potential upgrade we might wish to ask for would be for target types. I recall using UnitAddType to make units mechanical many, many years ago, because I changed the gameplay interface to show level of hunger in a survival map by replacing the Mechanical text. There was another classification, might have been Undead, that also showed in game after being changed by the UnitAddType native, because I had at least 2 hunger states that could be added by JASS in my map all those years ago.

For example, checking if a destructible was Targeted As "Tree" in JASS was many, many lines of code. Likewise, for a mod I made, I wanted an aura that only benefits wards. That code for that determination is very long, because you must exploit the return value of IssueTargetOrder with a dummy unit and observe whether it returns true. You can verify any kind of target type in the existing JASS system with a dummy unit and IssueTargetOrder's return value, but it is inefficient code. And there are probably some Targeted As types that you can't add with UnitAddType.
 
Last edited:
Level 3
Joined
Sep 26, 2012
Messages
20
May be this variant is better than I early suggested? For dialogue is necessary, probably. I've solved that rpgdialog not need. simply add these features for dialog. Though it's late. This my last suggestion for jass.

vJASS:
type dialog         extends agent
type dialogelement     extends dialog
type dialogoption     extends dialog
type button         extends dialogelement
type portrait         extends dialogelement
type checkbox         extends dialogelement
type radio             extends dialogelement
type textfiled         extends dialogelement
type textarea         extends dialogelement
type icon             extends dialogelement
type label             extends dialogelement
type droplist        extends dialogelement

native ConvertDialogOptionType takes integer i returns dialogoption

constant dialogoption STYLE_READONLY         = ConvertDialogOptionType(0)
constant dialogoption STYLE_SCROLL             = ConvertDialogOptionType(1)
constant dialogoption STYLE_CHECKED         = ConvertDialogOptionType(2)
constant dialogoption CHANGE_TEXT             = ConvertDialogOptionType(3)
constant dialogoption CHANGE_ALPHA          = ConvertDialogOptionType(4)
constant dialogoption CHANGE_POS_X             = ConvertDialogOptionType(5)
constant dialogoption CHANGE_POS_Y          = ConvertDialogOptionType(6)
constant dialogoption CHANGE_WiDTH             = ConvertDialogOptionType(7)
constant dialogoption CHANGE_HEIGHT          = ConvertDialogOptionType(8)
constant dialogoption STYPE_DISPLAY          = ConvertDialogOptionType(9)
constant dialogoption CHANGE_FILE_PATH        = ConvertDialogOptionType(10)
constant dialogoption CHANGE_RED              = ConvertDialogOptionType(11)
constant dialogoption CHANGE_GEEN              = ConvertDialogOptionType(12)
constant dialogoption CHANGE_BLUE              = ConvertDialogOptionType(13)

constant dialogevent EVENT_DIALOG_CHECKBOX_CLICK
constant dialogevent EVENT_DIALOG_DROPLIST_ITEM_SELECTED
constant dialogevent EVENT_DIALOG_RADIO_CLICK
constant dialogevent EVENT_DIALOG_CHECKBOX_CLICK


native DialogSetElement takes dialogelement dlgElement, dialogoption dlgOpt, boolean dlgParram returns boolean
native DialogSetElementText takes dialogelement dlgElement, dialogoption dlgOpt, string dlgParram returns boolean
native DialogSetElementInt takes dialogelement dlgElement, dialogoption dlgOpt, integer dlgParram returns boolean

native DialogSetElementTextColor takes dialogelement dlgElement, integer r, integer g, integer b, integer a returns boolean

native DialogAddPortrait takes integer x, integer y, integer width, integer height, string mdlPath returns portrait
native DialogAddTextField takes integer x, integer y, integer width, integer height, string strText returns textfiled
native DialogAddCheckBox takes integer x, integer y, integer width, integer height, string Caption, boolean wLogic returns checkbox

native DialogAddRadio takes integer x, integer y, integer width, integer height, string Caption, boolean wLogic returns radio
native DialogAddTextArea takes integer x, integer y, integer width, integer height, string strText returns textarea
native DialogAddIcon takes integer x, integer y, integer width, integer height, string icoPath returns icon
native DialogAddLabel takes integer x, integer y, integer width, integer height, string icoPath returns label
native DialogAddDropList takes integer x, integer y, integer width, integer height, string icoPath returns droplist

native DialogGetElementText takes dialogelement dlgElement, dialogoption dlgOpt returns string
native DialogGetElementBoolean takes dialogelement dlgElement, dialogoption dlgOpt returns boolean
native DialogGetElementInt takes dialogelement dlgElement, dialogoption dlgOpt returns integer

native DialogDropListAddItem takes droplist wDropList, string strText returns integer
native DialogDropListGetCountItem  takes droplist wDropList returns integer
native DialogDropListGetItem  takes droplist wDropList, integer wIndex returns integer

native GetClickedCheckBox takes nothing  returns checkbox
native GetClickedRadio takes nothing  returns radio
native GetCurrentDropList takes nothing  returns droplist
native GetItemOfDropList takes nothing  returns string
native GetIndexOfItemOfDropList takes nothing  returns integer

native TriggerRegisterDialogCheckBoxEvent takes trigger whichTrigger, checkbox whichCheckBox returns event
native TriggerRegisterDialogRadioEvent takes trigger whichTrigger, radio whichRadio returns event
native TriggerRegisterDialogDropListEvent takes trigger whichTrigger, droplist whichDropList returns event

native DialogDestroyElement takes dialogelement dlgElement returns boolean
 
It would be mighty handy to be able to detect the scroll wheel, and which way it is being rolled.

I mean, would work wonders for camera systems, not having to rely on commands for zooming in and out.

Also, the ability to detect mouse x/y when not using a mouse event. For smart casting spells, ect.
 
@Volchachka Instead of spending time to expand the dialog system they should give us full control over UI elements as well as the ability to dynamically create new ones. It's already been proved feasible over in China (Netease).

@The_Silent Yes we need async mouse natives which give coordinates relative to the screen not an in-game location. They need to be async in order for us to create a smooth working camera system, or for us to be able to handle user input for custom UIs smoothly.

I have a feeling Blizzard will eventually follow Netease and give us these features.
 
Level 3
Joined
Sep 26, 2012
Messages
20
@TriggerHappy I know about it. Spoken to me a one man on that cause. I'm think that to the Blizzards not it. They'll make the similar natives a most likely. And scarcely they will give access to interface because of reason of the safety. So just not was being nothing.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Classifications are already available and have been for 15 years via the native UnitAddType (and IsUnitType for checking them)

I don't recall how it affects target types. But I wanted to point this out before Blizzard spends their time coding an API that they already gave us 15 years ago. The potential upgrade we might wish to ask for would be for target types. I recall using UnitAddType to make units mechanical many, many years ago, because I changed the gameplay interface to show level of hunger in a survival map by replacing the Mechanical text. There was another classification, might have been Undead, that also showed in game after being changed by the UnitAddType native, because I had at least 2 hunger states that could be added by JASS in my map all those years ago.

For example, checking if a destructible was Targeted As "Tree" in JASS was many, many lines of code. Likewise, for a mod I made, I wanted an aura that only benefits wards. That code for that determination is very long, because you must exploit the return value of IssueTargetOrder with a dummy unit and observe whether it returns true. You can verify any kind of target type in the existing JASS system with a dummy unit and IssueTargetOrder's return value, but it is inefficient code. And there are probably some Targeted As types that you can't add with UnitAddType.
I had checked before with "Able to attack flying/ground units" before, and just checked again since you mentioned it, and it doesn't work. (The unit can neither target ground/air and IsUnitType doesn't change either.)

I don't think the melee/ranged worked either, but can't remember if I tested it or not.


That said, I might have completely written it off without testing it more in the past, if the other classifications like tauren, mechanical & undead work... My bad.
 
Level 4
Joined
May 8, 2016
Messages
58
Following functions supposed to return corresponding coordinates of the intersection of the vector defined by input values and the terrain or widget.
vJASS:
native WidgetToggleRaycast takes widget w, boolean flag returns nothing
//This should make the widget collidable, so the coordinates of interception can be calculated. By default this should be sisabled.

native GetRaycastClippingX takes real xFrom, real yFrom, real zFrom, real xTo, real yTo, real zTo returns real
native GetRaycastClippingY takes real xFrom, real yFrom, real zFrom, real xTo, real yTo, real zTo returns real
native GetRaycastClippingZ takes real xFrom, real yFrom, real zFrom, real xTo, real yTo, real zTo returns real

Why do we need this? Because this should replace massive and slow systems and gives a lot more flexibility.
 
Level 12
Joined
Nov 3, 2013
Messages
989
There doesn't seem to be a way to change minimap color. i.e. even if you use the teamcolor of a player's units, they'll still have their original color on the minimap.



Edit: Thought of another thing, so I'm adding it here to not double post.


It would be nice to have an event that happens before a unit tries to pick up an item & another when you try to buy items from shops.

Reason, you currently can't check the inventory of the unit before they buy/pick up item, so you have to do some workarounds to be able to upgrade/combine items if you have a full inventory. (e.g. having a dummy unit for every item you can buy.)


Maybe a way to get/set item cost as well, like the ones added for units. (function GetItemGoldCost takes integer itemId returns integer)
 
Last edited:
Are there native to get price of units or items already? If not, can we have them?

JASS:
native GetUnitGoldCost      takes integer unitid                        returns integer
native GetUnitWoodCost      takes integer unitid                        returns integer

native GetUpgradeGoldCost   takes integer id                            returns integer
native GetUpgradeWoodCost   takes integer id                            returns integer

These are in common.ai and there doesn't seem to be anything for items.
 
Level 11
Joined
Mar 6, 2008
Messages
898
Can anybody here please elaborate if there was already a discussion and plans about some new natives that actually allow us to save and load data over the course of several game instances?

This can be done in StarCraft2 via the banks as far as I remember and there they are even available in online sessions. So the data isn't even stored locally on the players computer but on B.Net2 servers as far as I can imagine it to work.
This feature would allow for a great set of new maps and map types.
 
Can anybody here please elaborate if there was already a discussion and plans about some new natives that actually allow us to save and load data over the course of several game instances?

This can be done in StarCraft2 via the banks as far as I remember and there they are even available in online sessions. So the data isn't even stored locally on the players computer but on B.Net2 servers as far as I can imagine it to work.
This feature would allow for a great set of new maps and map types.

After pestering Blizzard a few times they finally listened and have told me the "Allow Local Files" requirement for the Preloader native will be removed. This means you will be able to execute generated files from the Preload exploit effectively allowing us to read/write arbitrary data from disk.

In short, Codeless Save/load should work for everyone without having to enable the "Allow Local Files" registry flag starting on Patch 1.30 (not PTR).

Codeless Save and Load (Multiplayer) - v1.3.9

I will be updating my Sync library / codeless save/load once the patch hits and I can confirm the requirement has been removed.
 
Level 11
Joined
Mar 6, 2008
Messages
898
Thank you for clearing that up to me.
It is awesome to see progress in this field.

So we can actually use local files that are safed on each player's computer - this is good.
And I think using your library (or similar) makes for a good encryption of the data. :) - Am I right about this?

Depending on the limiations of local file loading for multiplayer games this could create many new opportunities for us on creating new game experiences! I imagine a global player rank for some mini games such as Tower Defense etc.
 
Level 14
Joined
Jan 16, 2009
Messages
716
The issue is not how the data is stored - Nobody would cheat by cracking the encryption method used to store the data. It's much easier to copy a map, inject any cheat in it and create a 'valid' save by just playing that cheated map. The only way to ensure data legitimacy is to make sure that the data's source is legit itself and thus you must have a way to know from where the data is coming - official host bot, regular battle net, lan or singleplayer. Then the first step would be to have only official host bot data work in the official host bot games. However even with that type of safety, one could just modify the hostbot map to produce host bot data even when hosted by a non official source (unless you are using a private key received at run time). Thus to have it really safe, one should store the data on a sever.

Using TriggerHappy's Web Request API, one could achieve that today.
 
Status
Not open for further replies.
Top