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

Producer Update: Natives List

Status
Not open for further replies.
Level 2
Joined
Jul 25, 2017
Messages
9
Hey everyone! I'm an aspiring game designer (but not a coder) and I'm wondering if any of these changes have opened up design space for the project that I've got on my mind.


If you would be so kind to answer my questions... Do any of these changes..:

1) Allow for any procedurally generated elements in game?

2) Reasonably allow for a "Vision Cone" mechanic? (ala Stealth game)
 
Level 5
Joined
Dec 6, 2009
Messages
79
vJASS:
function SetSpecialEffectTarget2Loc takes effect fx returns nothing //Set the Special Effect Attachment out from the Target to same location by X/Y/Z.

Wouldn't a function which returns the world position of an attach point be more useful/robust? DOTA 2 does exactly this and it's very useful for various stuff:
DoctorGester/greeviling_contest
 
Level 3
Joined
Sep 26, 2012
Messages
20
And what about this suggestion of this dialog or might an all to lay on usual dialog?
vJASS:
type rpgdialog extends agent
type rpgdialogbutton extends agent
type rpgdialogevent extends agent
type rpgdialogbuttontype extends handle

constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_BUTTON
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_CHECK
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_TEXTFIELD
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_TEXTAREA
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_LABEL
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_RADIO
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_PROGRESS
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_ICON
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_MODEL_PORTRAIT

constant rpgdialogevent RPG_DIALOG_BUTTON_CLICKED
constant rpgdialogevent RPG_DIALOG_BUTTON_CHECKED
constant rpgdialogevent RPG_DIALOG_CLICKED
constant rpgdialogevent RPG_DIALOG_SHOWED
constant rpgdialogevent RPG_DIALOG_HIDE

native GetClickedButtonRPGDialog takes nothing returns rpgdialogbutton
native GetCheckedButtonRPGDialog takes nothing returns rpgdialogbutton
native GetClickedRPGDialog takes nothing returns rpgdialog
native GetCheckedRPGDialog takes nothing returns rpgdialog
native GetPlayerRPGDialog takes nothing returns player // Player which clicked the dialog

native TriggerRegisterRPGDialogEvent       takes trigger whichTrigger, rpgdialog whichRPGDialog, rpgdialogevent eventId returns event
//native TriggerRegisterRPGDialogEvent       takes trigger whichTrigger, rpgdialog whichRPGDialog returns event
//native TriggerRegisterRPGDialogButtonEvent takes trigger whichTrigger, rpgdialogbutton whichRPGDialogButton returns event

native RPGDialogCreate takes integer x, integer y, integer width, integer height returns rpgdialog
native RPGDialogResize takes rpgdialog whichRPGDialog, width, integer height returns nothing
native RPGDialogReposition takes rpgdialog whichRPGDialog, integer x, integer y returns nothing
native RPGDialogFolding takes rpgdialog whichRPGDialog, player whichPlayer, boolean onFolding returns nothing
native RPGDialogMinimize takes rpgdialog whichRPGDialog, player whichPlayer, boolean onMinimize returns nothing
native RPGDialogScrollStyle takes rpgdialog whichRPGDialog, boolean onEnabled returns nothing
native RPGDialogDisplay takes rpgdialog whichRPGDialog, player whichPlayer, boolean onShow returns nothing
native RPGDialogButtonDisplay takes rpgdialogbutton whichRPGDialogButton, player whichPlayer, boolean onShow returns nothing
native RPGDialogDestroy takes rpgdialog whichRPGDialog returns nothing
native RPGDialogSetTitle takes rpgdialog whichRPGDialog, string Text returns nothing
native RPGDialogButtonSetGraphic takes rpgdialogbutton whichRPGDialogButton, string icoOrModelPath returns nothing // RPG_DIALOG_BUTTON_TYPE_BUTTON, RPG_DIALOG_BUTTON_TYPE_ICON, RPG_DIALOG_BUTTON_TYPE_MODEL_PORTRAIT
native RPGDialogButtonRelease takes rpgdialogbutton whichRPGDialogButton returns nothing
native RPGDialogAddButton takes rpgdialog whichRPGDialog, rpgdialogbuttontype rpgbuttonType, integer x, integer y, integer width, integer height returns rpgdialogbutton
native RPGDialogButtonChangeValueString takes rpgdialogbutton whichRPGDialogButton, string changeText returns nothing
native RPGDialogButtonChangeValueBoolean takes rpgdialogbutton whichRPGDialogButton, boolean changeBool returns nothing
native RPGDialogButtonChangeValueInt takes rpgdialogbutton whichRPGDialogButton, integer changeInt returns nothing
native RPGDialogClear takes rpgdialog whichRPGDialog returns nothing
native RPGDialogSetTitleColor takes rpgdialog whichRPGDialog, integer red, integer green, integer blue, integer alpha returns nothing
native RPGDialogSetButtonColor takes rpgdialog whichRPGDialog, integer red, integer green, integer blue, integer alpha returns nothing // Colored progress bar, oh yeah!
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Hey everyone! I'm an aspiring game designer (but not a coder) and I'm wondering if any of these changes have opened up design space for the project that I've got on my mind.


If you would be so kind to answer my questions... Do any of these changes..:

1) Allow for any procedurally generated elements in game?

2) Reasonably allow for a "Vision Cone" mechanic? (ala Stealth game)
It doesn't help either of those more than before, but I have seen a few maps that are procedural. Gaias' Retaliation has a dungeon like that, if I've understood correctly.(Haven't tried it lately)
 
Level 4
Joined
Jan 27, 2016
Messages
89
>set goldmine resource name/icon/description?, so you can basically have a visually consistent set of different harvestable resources
 
Level 5
Joined
Dec 6, 2009
Messages
79
And what about this suggestion of this dialog or might an all to lay on usual dialog?
vJASS:
type rpgdialog extends agent
type rpgdialogbutton extends agent
type rpgdialogevent extends agent
type rpgdialogbuttontype extends handle

constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_BUTTON
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_CHECK
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_TEXTFIELD
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_TEXTAREA
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_LABEL
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_RADIO
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_PROGRESS
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_ICON
constant rpgdialogbuttontype RPG_DIALOG_BUTTON_TYPE_MODEL_PORTRAIT

constant rpgdialogevent RPG_DIALOG_BUTTON_CLICKED
constant rpgdialogevent RPG_DIALOG_BUTTON_CHECKED
constant rpgdialogevent RPG_DIALOG_CLICKED
constant rpgdialogevent RPG_DIALOG_SHOWED
constant rpgdialogevent RPG_DIALOG_HIDE

native GetClickedButtonRPGDialog takes nothing returns rpgdialogbutton
native GetCheckedButtonRPGDialog takes nothing returns rpgdialogbutton
native GetClickedRPGDialog takes nothing returns rpgdialog
native GetCheckedRPGDialog takes nothing returns rpgdialog
native GetPlayerRPGDialog takes nothing returns player // Player which clicked the dialog

native TriggerRegisterRPGDialogEvent       takes trigger whichTrigger, rpgdialog whichRPGDialog, rpgdialogevent eventId returns event
//native TriggerRegisterRPGDialogEvent       takes trigger whichTrigger, rpgdialog whichRPGDialog returns event
//native TriggerRegisterRPGDialogButtonEvent takes trigger whichTrigger, rpgdialogbutton whichRPGDialogButton returns event

native RPGDialogCreate takes integer x, integer y, integer width, integer height returns rpgdialog
native RPGDialogResize takes rpgdialog whichRPGDialog, width, integer height returns nothing
native RPGDialogReposition takes rpgdialog whichRPGDialog, integer x, integer y returns nothing
native RPGDialogFolding takes rpgdialog whichRPGDialog, player whichPlayer, boolean onFolding returns nothing
native RPGDialogMinimize takes rpgdialog whichRPGDialog, player whichPlayer, boolean onMinimize returns nothing
native RPGDialogScrollStyle takes rpgdialog whichRPGDialog, boolean onEnabled returns nothing
native RPGDialogDisplay takes rpgdialog whichRPGDialog, player whichPlayer, boolean onShow returns nothing
native RPGDialogButtonDisplay takes rpgdialogbutton whichRPGDialogButton, player whichPlayer, boolean onShow returns nothing
native RPGDialogDestroy takes rpgdialog whichRPGDialog returns nothing
native RPGDialogSetTitle takes rpgdialog whichRPGDialog, string Text returns nothing
native RPGDialogButtonSetGraphic takes rpgdialogbutton whichRPGDialogButton, string icoOrModelPath returns nothing // RPG_DIALOG_BUTTON_TYPE_BUTTON, RPG_DIALOG_BUTTON_TYPE_ICON, RPG_DIALOG_BUTTON_TYPE_MODEL_PORTRAIT
native RPGDialogButtonRelease takes rpgdialogbutton whichRPGDialogButton returns nothing
native RPGDialogAddButton takes rpgdialog whichRPGDialog, rpgdialogbuttontype rpgbuttonType, integer x, integer y, integer width, integer height returns rpgdialogbutton
native RPGDialogButtonChangeValueString takes rpgdialogbutton whichRPGDialogButton, string changeText returns nothing
native RPGDialogButtonChangeValueBoolean takes rpgdialogbutton whichRPGDialogButton, boolean changeBool returns nothing
native RPGDialogButtonChangeValueInt takes rpgdialogbutton whichRPGDialogButton, integer changeInt returns nothing
native RPGDialogClear takes rpgdialog whichRPGDialog returns nothing
native RPGDialogSetTitleColor takes rpgdialog whichRPGDialog, integer red, integer green, integer blue, integer alpha returns nothing
native RPGDialogSetButtonColor takes rpgdialog whichRPGDialog, integer red, integer green, integer blue, integer alpha returns nothing // Colored progress bar, oh yeah!

What would be the point of yet another hardcoded piece of UI instead of enabling an ability to draw arbitrary images/text and capture mouse input locally in screenspace?
 
Level 2
Joined
Aug 1, 2013
Messages
33
Wouldn't a function which returns the world position of an attach point be more useful/robust? DOTA 2 does exactly this and it's very useful for various stuff:
DoctorGester/greeviling_contest
You're Right.
*Edited.

vJASS:
function GetSpecialEffectAttachX takes effect fx returns real //Get value from X axis of the attachment point.
function GetSpecialEffectAttachY takes effect fx returns real //Get value from Y axis of the attachment point.
function GetSpecialEffectAttachZ takes effect fx returns real //Get value from Z axis of the attachment point.

In this way, a bullet shoot from gun can hit whether head, chest, arm, leg.
Basically, an one step back version of converting it to location directly but more powerful.

*Newly edited.
vJASS:
function GetSpecialEffectAttachYaw takes effect fx returns real //Get Yaw value from the special effect attachment.
function GetSpecialEffectAttachPitch takes effect fx returns real //Get Pitch value from the special effect attachment.
function GetSpecialEffectAttachRoll takes effect fx returns real //Get Roll value from the special effect attachment.

Since the Y/P/R values from the attchment are changed passively as if a weapon attachment, is held by a soldier, playing Attack animation.
 
Last edited:
Level 3
Joined
Sep 26, 2012
Messages
20
Raised, DoctorGester,
No all a may the neatly draw custom UI by code with the natives by such as Tracktable and Image + Destructable portrait. In addition the object editor it's takes not small a time. RPGDialog takes a trifle the time and allows to make the same an operations. At example: selecting a hero... But not yet the all, after all are you can to let the custom names for heroes via this dialog with help of textfield. Choose skins through checkboxes, radio buttons and also to give descriptions into text area that is read only. Find room into multiboard for the big description? No. You must think, what kind a more actions can be make. By idea this dialog no stops game in single player, and locks screen for player on networks game, but yet this dialog by scrolling and minimizing.
 
Level 4
Joined
May 8, 2016
Messages
58
I've enhanced my list on page 12.

These natives are broken:

vJASS:
native SetTerrainFog takes real a, real b, real c, real d, real e returns nothing //This simply does not work. A lack of information in common.j

native SetTerrainFogEx integer style, real zstart, real zend, real density, real red, real green, real blue returns nothing //Density parameter doesn't affect anything. Exponential fog is completely broken, so the style other than 0 breaks the fog.
 
Last edited:
Level 19
Joined
Dec 12, 2010
Messages
2,074
vJASS:
native TrigUnitAbilCd takes unit WhichUnit, integer AbilId returns nothing
//Triggers a unit's ability cooldown, useful for passive abilities mostly.
native IsPathBlocked takes real x, real y, real x2, real y2 returns boolean
//Checks if path is blocked between these two locations.
1. not every ability has cooldown support at all, cannot be maintained for passives properly. adding isn't quite obvious as nobody has the listings
2. without stating pathing types its worthless too
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,011
True, was too lazy for that x)
vJASS:
native IsPathBlocked takes real x, real y, real x2, real y2, pathingtype WhichPath returns boolean
I also thought about new ones:
vJASS:
EVENT_DESTRUCTIBLE_ATTACKED //similar to units
EVENT_DESTRUCTIBLE_TAKES_DAMAGE // similar to units
EVENT_UNIT_HEALED // this should be some way "in contact or linked" to EVENT_UNIT_DAMAGED if the amount of damage is negative, meaning it heals
EVENT_PLAYER_TRADE_GOLD // triggers when a player shares gold
EVENT_PLAYER_TRADE_LUMBER // triggers when a player shares lumber
EVENT_PLAYER_TRADE_ANY // triggers when a player shares either gold or lumber
native GetTriggerPlayer takes nothing returns player
//only added this here to say that this should be the event response for the player who shared resources
native GetReceivedPlayer takes nothing returns player
// gets the player who received the resources from another player
native UnitHasBuff takes unit whichUnit, integer buffcode returns boolean
//I know we already have UnitHasBuffBJ but it is proven to be unefficient because the buff is lost after a unit dying, so it must be redone
native SetUnitBuildTime takes unit Whichunit, integer time returns nothing
//Someone suggested GetUnitBuildTime and GetUnitBuildingProgress
//So we also should be able to set the unit building time
native GetUnitBuildTimeByIdEx takes integer UnitId time returns integer
//Get original unit building time
native SetHeroBuildTime takes unit Whichunit, integer time returns nothing
//Same for heroes
native GetHeroBuildTimeByIdEx takes integer HeroId time returns integer
//Same for heroes
native TriggerSleepAction takes integer timeout returns nothing
//If possible, fix this native so all folks can be reliefed with an accurate wait
native GetUnitCurrentAnimationById takes unit WhichUnit returns integer
//self-explanatory
native GetUnitCurrentAnimation takes unit WhichUnit returns string
//self-explanatory
native HasUnitAnimEnded takes unit WhichUnit returns boolean
//checks if the unit's current animation ended, even if it loops
 
Last edited:
1.29 was released and almost all new natives from the test version were renamed.
Here a new list:
JASS:
// Automation Test
native AutomationTestStart takes string testName returns nothing
native AutomationTestEnd takes string testName returns nothing

// JAPI Functions
native BlzGetTriggerPlayerMouseX                   takes nothing returns real
native BlzGetTriggerPlayerMouseY                   takes nothing returns real
native BlzGetTriggerPlayerMousePosition            takes nothing returns location
native BlzGetTriggerPlayerMouseButton              takes nothing returns mousebuttontype
native BlzSetAbilityTooltip                        takes integer abilCode, string tooltip, integer level returns nothing
native BlzSetAbilityActivatedTooltip               takes integer abilCode, string tooltip, integer level returns nothing
native BlzSetAbilityExtendedTooltip                takes integer abilCode, string ExtendedTooltip, integer level returns nothing
native BlzSetAbilityActivatedExtendedTooltip       takes integer abilCode, string ExtendedTooltip, integer level returns nothing
native BlzSetAbilityResearchTooltip                takes integer abilCode, string researchTooltip, integer level returns nothing
native BlzSetAbilityResearchExtendedTooltip        takes integer abilCode, string researchExtendedTooltip, integer level returns nothing
native BlzGetAbilityTooltip                        takes integer abilCode, integer level returns string
native BlzGetAbilityActivatedTooltip               takes integer abilCode, integer level returns string
native BlzGetAbilityExtendedTooltip                takes integer abilCode, integer level returns string
native BlzGetAbilityActivatedExtendedTooltip       takes integer abilCode, integer level returns string
native BlzGetAbilityResearchTooltip                takes integer abilCode, integer level returns string
native BlzGetAbilityResearchExtendedTooltip        takes integer abilCode, integer level returns string
native BlzSetAbilityIcon                           takes integer abilCode, string iconPath returns nothing
native BlzGetAbilityIcon                           takes integer abilCode returns string
native BlzSetAbilityActivatedIcon                  takes integer abilCode, string iconPath returns nothing
native BlzGetAbilityActivatedIcon                  takes integer abilCode returns string
native BlzGetAbilityPosX                           takes integer abilCode returns integer
native BlzGetAbilityPosY                           takes integer abilCode returns integer
native BlzSetAbilityPosX                           takes integer abilCode, integer x returns nothing
native BlzSetAbilityPosY                           takes integer abilCode, integer y returns nothing
native BlzGetAbilityActivatedPosX                  takes integer abilCode returns integer
native BlzGetAbilityActivatedPosY                  takes integer abilCode returns integer
native BlzSetAbilityActivatedPosX                  takes integer abilCode, integer x returns nothing
native BlzSetAbilityActivatedPosY                  takes integer abilCode, integer y returns nothing
native BlzGetUnitMaxHP                             takes unit whichUnit returns integer
native BlzSetUnitMaxHP                             takes unit whichUnit, integer hp returns nothing
native BlzGetUnitMaxMana                           takes unit whichUnit returns integer
native BlzSetUnitMaxMana                           takes unit whichUnit, integer mana returns nothing
native BlzDeleteHeroAbility                        takes unit whichUnit, integer abilCode returns nothing
native BlzSetItemName                              takes item whichItem, string name returns nothing
native BlzSetItemDescription                       takes item whichItem, string name returns nothing
native BlzGetItemDescription                       takes item whichItem returns string
native BlzSetItemTooltip                           takes item whichItem, string name returns nothing
native BlzGetItemTooltip                           takes item whichItem returns string
native BlzSetItemExtendedTooltip                   takes item whichItem, string name returns nothing
native BlzGetItemExtendedTooltip                   takes item whichItem returns string
native BlzSetItemIconPath                          takes item whichItem, string name returns nothing
native BlzGetItemIconPath                          takes item whichItem returns string
native BlzSetUnitName                              takes unit whichUnit, string name returns nothing
native BlzSetHeroProperName                        takes unit whichUnit, string name returns nothing
native BlzGetUnitBaseDamage                        takes unit whichUnit, integer weaponIndex returns integer
native BlzSetUnitBaseDamage                        takes unit whichUnit, integer baseDamage, integer weaponIndex returns nothing
native BlzGetUnitDiceNumber                        takes unit whichUnit, integer weaponIndex returns integer
native BlzSetUnitDiceNumber                        takes unit whichUnit, integer diceNumber, integer weaponIndex returns nothing
native BlzGetUnitDiceSides                         takes unit whichUnit, integer weaponIndex returns integer
native BlzSetUnitDiceSides                         takes unit whichUnit, integer diceSides, integer weaponIndex returns nothing
native BlzGetUnitAttackCooldown                    takes unit whichUnit, integer weaponIndex returns real
native BlzSetUnitAttackCooldown                    takes unit whichUnit, real cooldown, integer weaponIndex returns nothing
native BlzSetSpecialEffectColorByPlayer            takes effect whichEffect, player whichPlayer returns nothing
native BlzSetSpecialEffectColor                    takes effect whichEffect, integer r, integer g, integer b returns nothing
native BlzSetSpecialEffectAlpha                    takes effect whichEffect, integer alpha returns nothing
native BlzSetSpecialEffectScale                    takes effect whichEffect, real scale returns nothing
native BlzSetSpecialEffectPosition                 takes effect whichEffect, real x, real y, real z returns nothing
native BlzSetSpecialEffectHeight                   takes effect whichEffect, real height returns nothing
native BlzSetSpecialEffectTimeScale                takes effect whichEffect, real timeScale returns nothing
native BlzSetSpecialEffectTime                     takes effect whichEffect, real time returns nothing
native BlzSetSpecialEffectOrientation              takes effect whichEffect, real yaw, real pitch, real roll returns nothing
native BlzSetSpecialEffectYaw                      takes effect whichEffect, real yaw returns nothing
native BlzSetSpecialEffectPitch                    takes effect whichEffect, real pitch returns nothing
native BlzSetSpecialEffectRoll                     takes effect whichEffect, real roll returns nothing
native BlzSetSpecialEffectX                        takes effect whichEffect, real x returns nothing
native BlzSetSpecialEffectY                        takes effect whichEffect, real y returns nothing
native BlzSetSpecialEffectZ                        takes effect whichEffect, real z returns nothing
native BlzSetSpecialEffectPositionLoc              takes effect whichEffect, location loc returns nothing
native BlzGetLocalSpecialEffectX                   takes effect whichEffect returns real
native BlzGetLocalSpecialEffectY                   takes effect whichEffect returns real
native BlzGetLocalSpecialEffectZ                   takes effect whichEffect returns real
native BlzGetUnitArmor                             takes unit whichUnit returns real
native BlzSetUnitArmor                             takes unit whichUnit, real armorAmount returns nothing
native BlzUnitHideAbility                          takes unit whichUnit, integer abilId, boolean flag returns nothing
native BlzUnitDisableAbility                       takes unit whichUnit, integer abilId, boolean flag, boolean hideUI returns nothing
native BlzUnitCancelTimedLife                      takes unit whichUnit returns nothing
native BlzIsUnitSelectable                         takes unit whichUnit returns boolean
native BlzIsUnitInvulnerable                       takes unit whichUnit returns boolean
native BlzUnitInterruptAttack                      takes unit whichUnit returns nothing
native BlzGetUnitCollisionSize                     takes unit whichUnit returns real
native BlzGetAbilityManaCost                       takes integer abilId, integer level returns integer
native BlzGetAbilityCooldown                       takes integer abilId, integer level returns real
native BlzSetUnitAbilityCooldown                   takes unit whichUnit, integer abilId, integer level, real cooldown returns nothing
native BlzGetUnitAbilityCooldown                   takes unit whichUnit, integer abilId, integer level returns real
native BlzGetUnitAbilityCooldownRemaining          takes unit whichUnit, integer abilId returns real
native BlzEndUnitAbilityCooldown                   takes unit whichUnit, integer abilCode returns nothing
native BlzGetUnitAbilityManaCost                   takes unit whichUnit, integer abilId, integer level returns integer
native BlzGetLocalUnitZ                            takes unit whichUnit returns real  
native BlzDecPlayerTechResearched                  takes player whichPlayer, integer techid, integer levels returns nothing
native BlzSetEventDamage                           takes real damage returns nothing

Edit: What is this AutomationTestStart / AutomationTestEnd function and how one uses it?
 
Last edited:

deepstrasz

Map Reviewer
Level 75
Joined
Jun 4, 2009
Messages
20,246
Hey, so, I'm not sure how exactly Triggering Unit functions but shouldn't there be Event Response for every type of A Unit does something? For example: there's no definite Event Response for A Unit Comes Within Range of Unit.

EDIT:
Well, units with the Locust ability are not considered units, at least in the above mentioned trigger concern.
Thus, it's important to be able to choose region points (variables) when using the A Unit Enters Region as that considers the Locust users actual units.

EDIT2:
Never mind. You can do a workaround converting a point to a region.
 
Last edited:
On top of what I've added regarding item-enter-map event, providing mechanism for retrieving order queue would be great.
What would be even more welcome, is interface for manipulation such queue, inserting orders etc.

There are plenty of spells/libs that are limited / have FYI included with em due to lack of possibility of altering unit order queue.
 
vJASS:
function UnitAddItemToSlot takes unit whichUnit, item whichItem, integer slot returns boolean
You can workaround this by using dummy items and disabling item-pickup trigger within the handler until the operation is done. If RegisterNativeEvent/ RegisterPlayerUnitEvent is involved here (unified registration mechanism), then you should have no trouble workarounding that issue.
 
Level 19
Joined
Dec 12, 2010
Messages
2,074
You can workaround this by using dummy items and disabling item-pickup trigger within the handler until the operation is done. If RegisterNativeEvent/ RegisterPlayerUnitEvent is involved here (unified registration mechanism), then you should have no trouble workarounding that issue.
read the thread's title
each "workaround" costs a lot, which is matter a lot in big maps
 
Level 16
Joined
Sep 29, 2008
Messages
366
So, another thing that we have to deal in older wc3 versions is max number of abilities (4) that can be handled by an item (excepting book of spells workaround).
what about removing this limit?. I don't know if it's posible to do. I remember some guy posted here about this lacking aspect. why no add/remove abilities to items in real time. It would open us the way to make advanced item management into the game, like crafting, reciping or making sets. After checking the main new natives list, I miss some functions related to them.

the following functions would very useful
JASS:
function ItemAddAbility takes item whichItem, integer abilCode returns nothing

function ItemRemoveAbility takes item whichItem, integer abilCode returns nothing

function ItemCountAbilities takes item wichItem returns integer

function ItemGetAbilityIndex takes item wichItem, integer abilCode returns integer

function ItemGetAbilityLevel takes item wichItem, integer abilCode returns integer

function ItemSetAbilityLevel takes item wichItem, integer abilCode, integer Level returns nothing


if someone adviced this already, then this post seconds that suggestion ;D
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,011
So, another thing that we have to deal in older wc3 versions is max number of abilities (4) that can be handled by an item (excepting book of spells workaround).
what about removing this limit?. I don't know if it's posible to do. I remember some guy posted here about this lacking aspect. why no add/remove abilities to items in real time. It would open us the way to make advanced item management into the game, like crafting, reciping or making sets. After checking the main new natives list, I miss some functions related to them.

the following functions would very useful
JASS:
function ItemAddAbility takes item whichItem, integer abilCode returns nothing

function ItemRemoveAbility takes item whichItem, integer abilCode returns nothing

function ItemCountAbilities takes item wichItem returns integer

function ItemGetAbilityIndex takes item wichItem, integer abilCode returns integer

function ItemGetAbilityLevel takes item wichItem, integer abilCode returns integer

function ItemSetAbilityLevel takes item wichItem, integer abilCode, integer Level returns nothing

if someone adviced this already, then this post seconds that suggestion ;D

what is exactly ItemGetAbilityIndex? Should be GetItemAbilityIndex, GetItemAbilityLevel and SetItemAbilityLevellike every other functions.
Who even uses old versions of Warcraft? Max number of abilities on an item was always 4, there's a reason for it (to not get absurd values), so no, they're not going to remove the limit. Unless you need the ItemAdd and Remove ability for more complex stuff, you can just use the spellbook as you mentioned, it's not like it's a workaround that gives a lot effort.
 
Level 16
Joined
Sep 29, 2008
Messages
366
Wrda said:
..Unless you need the ItemAdd and Remove ability for more complex advanced stuff, you...

That's the point. Anyway, adding infinite abilities to an item is a weird option. Increasing maximun limit from 4 to any suitable amount of skills is more accurate requirement. About if this is posible with workarounds, yes, workarounds are our best alternative. But, refered to main request (add abilities to items on real time) I think related workarounds are ineficients in terms of abilities gestion. Basically equiping - dropping items from units those have dinamically added abilities you need to read some kind of table/ indexer to enable - disable abilities for item owner (what a rare option that disable ability for some unit to hide ability icon). All this manner to do things could be improved. Craft, recipe, upgrade, composite, fusion, evolve; all these item aspects could be easily achieved enabling the listed functions on previous post.
About function name (ItemGetAbilityLevel) you're right. verb - noun order is irrelevant in this stage. finally, names responds to standars, we will get something like Blz...
 
vJASS:
// UNIT SECTION
// By Upgrades I mean bonuses to units for examples damages displayed in green on a unit
function SetUnitAttackDamageUpgrade takes unit u, integer index, integer upgrade returns nothing    //Changes the bonus damages given to the unit
function GetUnitAttackDamageUpgrade takes unit u, integer index, returns integer    //Get the amount of bonus damages

function SetUnitArmorUpgrade takes unit u, integer upgrade returns nothing    //Changes the bonus armor given to the unit
function GetUnitArmorUpgrade takes unit u returns integer    //Get the amount of bonus armor

//(not sure if attackspeed work just on one type of attack, with index 1 for exemple)
function SetUnitAttackSpeed takes unit u, integer index, integer bonus returns nothing    //Changes the attack Speed of a unit
function GetUnitAttackSpeed takes unit u, integer index returns integer    //Get the unit attack Speed

function SetUnitAcquisitionRange takes unit u, integer range returns nothing
function GetUnitAcquisitionRange takes unit u returns integer

function GetUnitCollisionSize takes unit u returns real
function SetUnitCollisionSize takes unit u, real size returns nothing

function UnitDisableSpells takes unit u, boolean flag returns nothing    //Silence a unit if the flag == true

function IsUnitSilenced takes unit u returns boolean //Return true if the unit is silenced

function AddHeroAbility takes unit u, integer id returns nothing // Add a spell to a hero that can be learnable

function GetUnitBountyGoldBase takes unit u returns integer
function GetUnitBountyGoldDiceNumber takes unit u returns integer
function GetUnitBountyGoldDiceSide takes unit u returns integer
function SetUnitBountyGoldBase takes unit u, integer amount returns nothing
function SetUnitBountyGoldDiceNumber takes unit u, integer amount returns nothing
function SetUnitBountyGoldDiceSide takes unit u, integer amount returns nothing

function GetUnitBountyWoodBase takes unit u returns integer
function GetUnitBountyWoodDiceNumber takes unit u returns integer
function GetUnitBountyWoodDiceSide takes unit u returns integer
function SetUnitBountyWoodBase takes unit u, integer amount returns nothing
function SetUnitBountyWoodDiceNumber takes unit u, integer amount returns nothing
function SetUnitBountyWoodDiceSide takes unit u, integer amount returns nothing

// these two functions are only available on events EVENT_PLAYER_UNIT_DEATH or EVENT_UNIT_DEATH to get the amount of bounty calculated by the game when a player kill a unit.
function GetBountyGoldGiven takes nothing returns integer // the amount of gold calculated with base bonus and dice given to the player that killed the unit.
function GetBountyWoodGiven takes nothing returns integer // the amount of wood calculated with base bonus and dice given to the player that killed the unit.

// SPELLS SECTION
// it could be intresting to use that following functions on specific spells on units and not only for abilityid
function SetAbilityOrder takes integer id, takes string order returns nothing
function GetAbilityOrder takes integer id returns string
function SetAbilityLearningKey takes integer id, takes string spellKey returns nothing
function GetAbilityLearningKey takes integer id returns string
function SetAbilityKey takes integer id, takes string spellKey returns nothing
function GetAbilityKey takes integer id returns string
function SetAbilityUnactivateKey takes integer id, takes string spellKey returns nothing
function GetAbilityUnactivateKey takes integer id returns string

// Only works for channel abilities
constant spelltarget TARGET_SPELL_LOCATION //the spell target a location (shockwave)
constant spelltarget TARGET_SPELL_UNIT    //the spell target units (thunderbolt)
constant spelltarget TARGET_SPELL_INSTANT  //the spell is instant (stomp)
constant spelltarget TARGET_SPELL_TARGET   // the spell can target units or location

function SetAbilityTarget takes integer id, takes spelltarget target returns nothing
function GetAbilityTarget takes integer id returns spelltarget

function IsSpellActivated takes integer id, takes unit u returns boolean // return true is spell is activated (mana shield, immolation, defense, ...)
function IsSpellAutoCast takes integer id, takes unit u returns boolean // return true is spell is auto cast (slow, bloodlust, ice arrow, ...)
 
Last edited:
A nice list of natives, I would say. The most useful natives insofar in the list are the bounty base getters and setters. With that in place, I would like to add some to the list...

Wurst:
function unittype.getBountyGold() returns int
function unittype.setBountyGold(int newVal)

...
// Basically, these are getters and setters for the unit type, not unit.

function unit.revive() returns bool
// Will return false if unit's alive or out of scope.
 
Could you please solve a problem which is some models imorted into the map has only an outline of their form? All or some of their .blp files shown nothing but shadows in both of the game and WE.
It's because your imported BLP texture uses fake mipmaps (to cut down filesize of the custom BLP). Open the BLP file in BLP Lab with File information turned on so you can see how many fake mipmaps it has. When converting an image to BLP format you can set the mipmap count. The minimum number of real mipmaps you need for a BLP is Logarithm base 2 of the largest dimension plus 1. So if you have a 512x256 TGA file you can set the mipmap count to 10 (b/c log base 2 of 512 is 9, then add 1 to make 10) which will make the result BLP file use all real mipmaps.

Clipboard01.png
 
Last edited:
Level 4
Joined
Sep 25, 2016
Messages
47
It's because your imported BLP texture uses fake mipmaps (to cut down filesize of the custom BLP). Open the BLP file in BLP Lab with File information turned on so you can see how many fake mipmaps it has. When converting an image to BLP format you can set the mipmap count. The minimum number of real mipmaps you need for a BLP is Logarithm base 2 of the largest dimension plus 1. So if you have a 512x256 TGA file you can set the mipmap count to 10 (b/c log base 2 of 512 is 9, then add 1 to make 10) which will make the result BLP file use all real mipmaps.

View attachment 296968
Thank you very much, I'll have a try.
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,551
function SetUnitAcquisitionRange takes unit u, integer range returns nothing
I've been out of the loop, so forgive my ignorance, but is this different from native SetUnitAcquireRange takes unit whichUnit, real newAcquireRange returns nothing?

function UnitDisableSpells takes unit u, boolean flag returns nothing //Silence a unit if the flag == true
I'd also like to propose:

vJASS:
function UnitSilenceItems takes unit u, boolean flag returns nothing //Prevents a unit from using item abilities when flag == true
function UnitMuteItems takes unit u, boolean flag returns nothing //Prevents a unit from benefiting from any item stats when flag == true
function IsUnitItemSilenced takes unit u returns boolean
function IsUnitedItemMuted takes unit u returs boolean

//Alternatively, though it'd require additional work when the use case is a spell that silences/mutes all items:
function ItemSilence takes item m, boolean flag returns nothing //Prevents units from using m's abilities when flag == true
function ItemMute takes item m, boolean flag returns nothing //Prevents units from benefiting off stats offered by m when flag == true
function IsItemSilenced takes item m, returns boolean
function IsItemMuted takes item m, returns boolean
 
Last edited:
This has been missing for quite a long time, so I'll propose the following things:

Wurst:
native SetUnitAttackRange(unit whichUnit, int index, int newRange)
native GetUnitAttackRange(unit whichUnit, int index)

unitevent EVENT_UNIT_ATTACK_RELEASE
playerunitevent EVENT_PLAYER_UNIT_ATTACK_RELEASE

However, the list of natives that we have obtained as of this major patch (v.1.29) is quite an enormous load of natives that would surely keep us content for a while if properly implemented.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,011
vJASS:
function SetUnitAcquisitionRange takes unit u, integer range returns nothing
function GetUnitAcquisitionRange takes unit u returns integer

function UnitDisableSpells takes unit u, boolean flag returns nothing    //Silence a unit if the flag == true

function IsUnitSilenced takes unit u returns boolean //Return true if the unit is silenced
SetUnitAcquireRange and GetUnitAcquireRange already exists, as stated before.
How is UnitDisableSpells supposed to work? Affect all abilities? Shouldn't it be called "UnitSilenceSpells" since "disable" looks like another thing?
What would IsUnitSilenced return if the "UnitSilenceSpells" is set to false but the unit has the "silenced" buff?
Sounds like this can be just achieved better with the silence ability.
Rest of the natives are great.

I'd also like to propose:

vJASS:
function UnitSilenceItems(unit u, boolean flag) //Prevents units from using item abilities when flag == true
function UnitMuteItems(unit u, boolean flag) //Prevents units from benefiting from any item stats when flag == true


Alternatively, though it'd require additional work when the use case is a spell that silences/mutes all items:
vJASS:
function ItemSilence(item m, boolean flag) //Prevents units from using this item's abilities when flag == true
function ItemMute(item m, boolean flag) //Prevents units from benefiting off stats offered by m when flag == true
I guess we would have then
vJASS:
native IsUnitItemSilenced takes unit returns boolean //Returns true when unit can't use item abilities
//Same for UnitMuteItems
But what would "IsUnitItemSilenced" return if it returns false and unit has "silence" buff, like I said above?
Also please write the new natives like Dark-Zalor and everyone else, it's easier to read and understand.
 
Please add:

JASS:
native GetUnitAnimationIndex takes unit whichUnit, string animation returns integer

Right now, there is no way to make a unit play the 'walk' animation while not moving, except: SetUnitAnimationByIndex, and there is no way to know which animation index the walk animation is for a certain unit.

If this were possible, it would be awesome!

EDIT: Would also be nice to have a way to know which animation tags (eg. upgrade, first, alternate) a unit currently has, as a string with each tag separated by spaces, so we could do:

SetUnitAnimation(u, "stand" + GetUnitAnimationProperties(u))
 
Last edited:
@_Guhun_
You can iterate trough each animation index to get the animation index of any animation. I believe you can also open the model in a model editor software and check the index there but I am not sure.

Yeah, you can do that, but then you will only be able to play the animation for 1 model, since you can't do that programatically in-game (there's no way to get which index corresponds to which animation string, so you have to do it manually). If you want to play it for ANY model, you will need to save the correct index in a hashtable for EVERY unit type in the map, which could take a while and is pretty annoying to maintain if you add new unit types constantly (which is basically my case =3).
 
Level 11
Joined
Jan 2, 2016
Messages
472
vJASS:
function SetUnitAttackDamageUpgrade takes unit u, integer index, integer upgrade returns nothing    //Changes the bonus damages given to the unit
function GetUnitAttackDamageUpgrade takes unit u, integer index, returns integer    //Get the amount of bonus damages

function SetUnitArmorUpgrade takes unit u, integer upgrade returns nothing    //Changes the bonus armor given to the unit
function GetUnitArmorUpgrade takes unit u returns integer    //Get the amount of bonus armor

//(not sure if attackspeed work just on one type of attack, with index 1 for exemple)
function SetUnitAttackSpeed takes unit u, integer index, integer bonus returns nothing    //Changes the attack Speed of a unit
function GetUnitAttackSpeed takes unit u, integer index returns integer    //Get the unit attack Speed

function SetUnitAcquisitionRange takes unit u, integer range returns nothing
function GetUnitAcquisitionRange takes unit u returns integer

function GetUnitCollisionSize takes unit u returns real
function SetUnitCollisionSize takes unit u, real size returns nothing

function UnitDisableSpells takes unit u, boolean flag returns nothing    //Silence a unit if the flag == true

function IsUnitSilenced takes unit u returns boolean //Return true if the unit is silenced

function AddHeroAbility takes unit u, integer id returns nothing // Add a spell to a hero that can be learnable

function GetUnitBountyGoldBase takes unit u returns integer
function GetUnitBountyGoldDiceNumber takes unit u returns integer
function GetUnitBountyGoldDiceSide takes unit u returns integer
function SetUnitBountyGoldBase takes unit u, integer amount returns nothing
function SetUnitBountyGoldDiceNumber takes unit u, integer amount returns nothing
function SetUnitBountyGoldDiceSide takes unit u, integer amount returns nothing

function GetUnitBountyWoodBase takes unit u returns integer
function GetUnitBountyWoodDiceNumber takes unit u returns integer
function GetUnitBountyWoodDiceSide takes unit u returns integer
function SetUnitBountyWoodBase takes unit u, integer amount returns nothing
function SetUnitBountyWoodDiceNumber takes unit u, integer amount returns nothing
function SetUnitBountyWoodDiceSide takes unit u, integer amount returns nothing

The bounty natives should take a unit type not an unit. Basically reference the field in the OE.

Nonetheless these natives could be very useful, perhaps some natives that retrieve item cost as well ?
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,551
But what would "IsUnitItemSilenced" return if it returns false and unit has "silence" buff
Unit abilities and item abilities should be treated differently, so the silence buff should be irrelevant for the inner workings of this function.

EDIT: Revised proposals:
vJASS:
function UnitSilenceItems takes unit u, boolean flag returns nothing //Prevents a unit from using active item abilities when flag == true
function UnitSilenceItemPassives takes unit u, boolean flag returns nothing
function UnitMuteItems takes unit u, boolean flag returns nothing //Prevents a unit from benefiting from any item stats when flag == true
function IsUnitItemSilenced takes unit u returns boolean
function IsUnitItemMuted takes unit u returs boolean

//Alternatively, though it'd require additional work when the use case is a spell that silences/mutes all items:
function ItemSilenceActives takes item m, boolean flag returns nothing //Prevents units from using m's abilities when flag == true
function ItemSilencePassives takes item m, boolean flag returns nothing //Prevents units from benefiting off passive abilities given by m
function ItemMute takes item m, boolean flag returns nothing //Prevents units from benefiting off stats offered by m when flag == true
function IsItemSilenced takes item m, returns boolean
function IsItemMuted takes item m, returns boolean
 
Last edited:
Status
Not open for further replies.
Top