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

Warcraft III - Patch 1.31 PTR

Status
Not open for further replies.
Level 11
Joined
Nov 23, 2013
Messages
665
They do for me, but I tested with quick "place a bunch of units in empty field and have them fight for my amusement" map. Maybe something breaks if the AI is forced to actually gather resources, build the base, pick units, and stuff like dat.
I should have mentionned it was melee games. I've edited my post. I'll keep testing though.
 
Level 1
Joined
Jun 12, 2018
Messages
1
I was trying to use this function in our shiny new Lua script.
Lua:
print(BlzGetAbilityTooltip('AHfs', 1))
It gave no output and crashed the rest of the calling function.
I found these lines in the common.j file. The AbilityId function always gives 0, whatever the input.
vJASS:
// Not currently working correctly...
constant native AbilityId                   takes string  abilityIdString   returns integer
constant native AbilityId2String            takes integer abilityId         returns string

So I decided to do it myself. I thought this would work, but it just gives me "Tooltip missing!"
Lua:
function GetAbilityID (code)
    local length = #code
    if length == 4 then
        local id = 0
        for i = 1, length do
            id = id + (256 ^ (length - i)) * code:byte(i)
        end
        return id | 0
    else
        return 0, 'Error: ' .. code .. ' is not an ability!'
    end
end
print(BlzGetAbilityTooltip(GetAbilityID('AHfs'), 1))

After some debugging, I found the issue. In the standalone Lua interpreter, the function call gives the expected value 1095263859. But in game, it gives 1095263744.
Lua:
print(GetAbilityID('AHfs'))
I suspect the error is related to the floating point numbers. It is. The following version works correctly.
Lua:
function GetAbilityID (code)
    local length = #code
    if length == 4 then
        local id = 0
        for i = 1, length do
            -- Must convert floats to integers, or there will be severe rounding errors
            id = id + (256 ^ (length - i) | 0) * code:byte(i)
        end
        return id
    else
        return 0, 'Error: ' .. code .. ' is not an ability!'
    end
end
My conclusion:
  1. Automatic conversion from ability ID string to integer does not work in Lua scripts
  2. There are some subtle bugs in the new Lua VM related to floating point numbers
  3. Integer and Real types are not indistinguishable even in Lua scripts

Neveralice, indeed your implementation somehow ends up using real numbers instead of integers and causing loss due to FP precision. Please use this function for now. It will be built-in in the next patch:

Code:
function FourCC(id)
 return string.unpack(">I4", id)
end
 

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,847
As @Sieben AI heroes indeed do not use spells in melee games (attached replay).
Also, a tome of strength remnant bug:
tomeofstrengthProb.png
Basically, the tome models aren't removed but they are shrunk.

EDIT: attached another one on Emerald Gardens without warpten and greedisgood (only whosyourdaddy and iseedeadpeople), this time with insane AI.
EDIT2: did a LAN test too (attached). The same happens. Also tested on both x64 and x86.

I'd like a /timer command to see the elapsed game time.

What's this Bonjour crap so I can run LAN?

@Sieben I think it might be because the AI needs rehashing due to the newly changed and added spells/items.
 

Attachments

  • AIHeroesNoSpells.w3g
    35.8 KB · Views: 85
  • EmeraldAITest.w3g
    29.8 KB · Views: 74
  • LANreplay.w3g
    22 KB · Views: 80
Last edited:
Level 11
Joined
Nov 23, 2013
Messages
665
Also, a tome of strength remnant bug:
tomeofstrengthprob-png.321985
Basically, the tome models aren't removed but they are shrunk.
There has always been remnant tomes after they were picked up. Bribe even created a system to delete them: Item Cleanup 1.3
It would be a good idea to remove that strange feature though, it's small but noticeable and it uses computer resources, even if it's not significant.
 
Level 10
Joined
Oct 5, 2008
Messages
355
It would be a good idea to remove that strange feature though, it's small but noticeable and it uses computer resources, even if it's not significant.

While i think that people should always create something like a cleanup setup for used tomes, i would not suggest removing this bug/feature. If you think about it, tomes and all other powerups indirectly create unclickable, unpickable items, that can still be get by triggers and moved around. Im not currently aware of anything that uses these properties, but removing this would, as far as i know the community abusing any oddities, break stuff in some maps.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
While i think that people should always create something like a cleanup setup for used tomes, i would not suggest removing this bug/feature. If you think about it, tomes and all other powerups indirectly create unclickable, unpickable items, that can still be get by triggers and moved around. Im not currently aware of anything that uses these properties, but removing this would, as far as i know the community abusing any oddities, break stuff in some maps.
The only reason they added it was so that when someone in a competitive game acquired a tome and the enemy later revealed the fog where it was at, they would see the death animation and know that there had been a tome used.

Don't ask me how I remember this much detail. I used to be a huge fan of this game. Why else would I still be into it 18 years later (longer than some of you have been alive)?
 

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,847
While i think that people should always create something like a cleanup setup for used tomes, i would not suggest removing this bug/feature.
I doubt it'll break any maps, however they could at least make the tomes invisible after units taking them.
The only reason they added it was so that when someone in a competitive game acquired a tome and the enemy later revealed the fog where it was at, they would see the death animation and know that there had been a tome used.
That doesn't matter really since melee maps have balanced item drops.
 
How'd you do it? JASS or?

Yeah with the new JASS natives. You also have to work with FrameDef files (.fdf) to define the elements. The game uses these files internally so you can search the CASC/MPQ for .fdf files and see how various UI elements work in the game.

EDIT: I wrote the above screenshot with Lua, but you can use JASS as well.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
How'd you do it? JASS, Lua or?
Lua offers a lot of technical processing that JASS lacks, such as strings, data structures and trimming of visible code. However, like TH said, the natives are accessible in JASS.

Right now it seems you can't even use Lua in an existing map, you have to do it by creating a new map. But even then, you have to disable JassHelper in the new map and use //! beginusercode commands to differentiate the Lua script.

TriggerHappy made a new JassHelper mod that allows integration of Lua and vJass. I'll check it out at some point to see the pros and if there are any unresolved issues. Hopefully the final World Editor release allows existing maps to switch the trigger language with the same amount of ease.
 
Level 9
Joined
Feb 24, 2018
Messages
342
You can completely modify or replace the game's interface.

For example:

View attachment 322015

Sweet Lotus, that's doable already?! I've waited for 15 years for this! In Azkaban!
Is amount of action buttons limited in any way? Do default hotkeys, like Attack still work even if they ain't visible?
Do all those items count as equipped? How does that work with Inventory ability only allowing 6 items? How does that interact with "Item in inventory slot X" GUI variable?

Sorry for question barrage, I'm just so excited.
 
Level 8
Joined
Jun 13, 2012
Messages
336
Any news about the Campaign Editor? Could they possibly have made it so multiple maps share some of the code so you don't have to copy paste the entire trigger library to every map?

That custom UI is insane. The possibilities...
couldn't you just have exported trigger and import into different map? sounds like 10 seconds work. not including map loading xd
 
Sweet Lotus, that's doable already?! I've waited for 15 years for this! In Azkaban!
Is amount of action buttons limited in any way? Do default hotkeys, like Attack still work even if they ain't visible?
Do all those items count as equipped? How does that work with Inventory ability only allowing 6 items? How does that interact with "Item in inventory slot X" GUI variable?

Sorry for question barrage, I'm just so excited.

Those hotkeys no longer work once the command card is hidden. As far as I know there is no limit on how many frames/buttons you can create.

In my system I am going to completely custom code the inventory system to where I store the objects in code rather than letting the game handle it. However, you can expand the default inventory ability to have more than 6 slots (shift click), but getting it to reflect properly in the UI is a bit harder apparently. You can see @Retera has been trying to expand the default inventory. He made some good progress but there were some issues. I think the extra 3 slots were faked in the UI, or something.

reterainv.png

How can we do that? Is there a simple palette or does it require some modeling and transparent textures and stuff like that?

It doesn't necessarily require any modelling or texturing. You can use the files that come with the game as well as custom ones. I explained a bit more about how it's done with JASS/.fdf files in the previous post.
 

Remixer

Map Reviewer
Level 31
Joined
Feb 19, 2011
Messages
1,956
Please give a native for "Unit - Set unit build style (race)", also please make metamorphosis duration follow the levels (on the same unit) or alternatively, give transformation abilities option to make them temporary (with timed life). Also, if possible, fix the native "Unit - Cancel unit timed life", it kills the unit.

EDIT: On the build style, never mind, you can change it by disabling and enabling the build abilities by rawID.
 
Last edited:

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,847
Level 9
Joined
Feb 24, 2018
Messages
342
Huh, I didn't know about this thread. Thanks for the link.


Those hotkeys no longer work once the command card is hidden. As far as I know there is no limit on how many frames/buttons you can create.

In my system I am going to completely custom code the inventory system to where I store the objects in code rather than letting the game handle it. However, you can expand the default inventory ability to have more than 6 slots (shift click), but getting it to reflect properly in the UI is a bit harder apparently. You can see @Retera has been trying to expand the default inventory. He made some good progress but there were some issues. I think the extra 3 slots were faked in the UI, or something.

View attachment 322019

It doesn't necessarily require any modelling or texturing. You can use the files that come with the game as well as custom ones. I explained a bit more about how it's done with JASS/.fdf files in the previous post.
Okay, that is great. Thanks a lot.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
For anyone interested. Here is a demo map showing a more full implementation for location garbage collection.

It demonstrates a typical GUI unit slide trigger written by someone who does not know about leaks. Press Esc to see location metrics. In my case when the locations registered hit around 10,000 the aggressively set garbage collector runs and removes them. One can verify that the memory used by Warcraft III then after does not substantially increase thanks to continuous automatic removal of the locations.

Note that if you exit the game to the OS using the menu, eg Alt+F4, the map will cause a crash error. This does not appear to happen when exiting back to the main menu, only when exiting to the OS by quitting the game entirely.
 

Attachments

  • Location GC Demo.w3x
    14.3 KB · Views: 138
Level 5
Joined
May 10, 2018
Messages
129
Is there a document of .fdf files about basic types (e.g. "FRAME", "TEXT", "GLUEBUTTON"...) and fields (e.g. UseActiveContext, DecorateFileNames, Text...)?
upload_2019-5-2_0-12-24.png

Is there a way in scripts to aquire framehandle of an inner/local frame defined in .fdf?
 
Is there a document of .fdf files about basic types (e.g. "FRAME", "TEXT", "GLUEBUTTON"...) and fields (e.g. UseActiveContext, DecorateFileNames, Text...)?
Is there a way in scripts to aquire framehandle of an inner/local frame defined in .fdf?

I don't know of any documentation. There may be some in the future.

If you want to acquire a child frame you can call BlzGetFrameByName right after you create the parent frame. It seems to always return the last one created, because there can be duplicates.
 
Last edited:

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Is there a document of .fdf files about basic types (e.g. "FRAME", "TEXT", "GLUEBUTTON"...) and fields (e.g. UseActiveContext, DecorateFileNames, Text...)?
Unlikely. Similarly to the old days, the idea is probably experimentation and discovery. An excellent motivation to write a new tutorial :p

(By the way, that glowing button in your screenshot reminds me of the campaign mission buttons)
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Judging from the fact something as complex as the Galaxy Editor never received thorough documentation, I doubt we can expect it for any of Warcraft III's features, especially at such a late point in time. As it seems it's simply not a priority. We'll just have to test things ourselves and hope a diligent fellow will kindly document them in WarCraft III Tutorials, as we've done for the past two decades.
 
Level 9
Joined
Feb 24, 2018
Messages
342
Documentation? Hah.
I went over to MMO-Champ to see if there are any new icons from PTR, randomly looked at a couple threads and saw someone point out that even WoW patches don't get adequate patchnotes.
If WoW doesn't get enough documentation, no way a Classic game will.
 

Remixer

Map Reviewer
Level 31
Joined
Feb 19, 2011
Messages
1,956
Documentation? Hah.
I went over to MMO-Champ to see if there are any new icons from PTR, randomly looked at a couple threads and saw someone point out that even WoW patches don't get adequate patchnotes.
If WoW doesn't get enough documentation, no way a Classic game will.
Then again, with such enthusiastic community, I doubt anything will go unnoticed - that of course only applies to visible changes, but then again the community quickly noticed that Blizzard changed some minor thing and this then caused something and so forth. I think that its also in Blizzard's interest to keep track of even the minor thing they change - but then again, having it public, probably not.

A good example is the now increased tooltip description character limit - not mentioned in the patch notes, but alas it is instantly noted by the community.
 
Level 3
Joined
Feb 24, 2018
Messages
39
A good example is the now increased tooltip description character limit - not mentioned in the patch notes, but alas it is instantly noted by the community.
It doesn't take,the new api(UI) can solve this problem.
I want them to improve the lua functionality,Such as "loadstring" "math.atan2"
 
Last edited:
Level 5
Joined
May 10, 2018
Messages
129
(By the way, that glowing button in your screenshot reminds me of the campaign mission buttons)
That's ROC/TFT version switch button. I copy and paste it.
If you want to acquire a child frame you can call BlzGetFrameByName right after you create the parent frame. It seems to always return the last one created, because there can be duplicates.
Thank you, TriggerHappy.
 
  • Like
Reactions: Rui
That's all well and good if you only have to do it once, but there could be numerous times triggers and scripts change over the course of developing a campaign, meaning a ton of extra work to update them in each map. I don't think it would be that hard to add a trigger editor to the campaign editor just like the object editor.
 
Level 9
Joined
Feb 24, 2018
Messages
342
That's all well and good if you only have to do it once, but there could be numerous times triggers and scripts change over the course of developing a campaign, meaning a ton of extra work to update them in each map. I don't think it would be that hard to add a trigger editor to the campaign editor just like the object editor.
I mean if you dump all campaign maps into same folder, so they all import same stuff, and that functionality can handle object/trigger data, it should be super easy, barely an inconvenience.
 
Level 5
Joined
May 10, 2018
Messages
129
If I want a dialog display for a specific player, I have DialogDisplay(player ,dialog ,boolean).
But for frames, I only have BlzFrameSetVisible(framehandle , boolean ).
To make my goal, can I use GetTriggerPlayer() in a frameevent?
 
Level 9
Joined
Jul 30, 2012
Messages
156
Improvement on my previous garbage collector implementation. Now works for locations, groups and forces all automatically!

Now that we can easily hook any native with lua, do you think it would be cool to implement recycling along with garbage collection? Maybe the cost of creating and destroying an agent is bigger than just recycling and calling MoveLocation to reuse a Location object. Not sure about Groups and Forces though.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Now that we can easily hook any native with lua, do you think it would be cool to implement recycling along with garbage collection? Maybe the cost of creating and destroying an agent is bigger than just recycling and calling
MoveLocation
to reuse a Location object. Not sure about Groups and Forces though.
Cost of recycling has always been higher. Ultimately the game recycles the storage used by the object except at native level. It was only ever really useful for units because units had a game engine level leak associated with them. Maybe people did it for groups and such due to handle leaks, but Lua does not suffer from those. It was also useful for timers before people realized they could pause them before destroying to prevent that final execution.
 
Level 13
Joined
Oct 18, 2013
Messages
691
I wonder if 'Cast Time' Object Data fields above Level 1 will get cached properly in 1.31, or if we will need to use the natives to apply the new levels' cast.
 
For all those concerned with Unholy Frenzy and Orb of Fire changes, it's kept in different ability. Bad luck for everything else as they add fields like Critical Strike in 1.29 did. There's also a new Spiked Barricade (%) in the research option.

@Kam
Shadow Meld (item) disappeared and the new Orb of Fire is there instead.
EDIT:
It's now in unit directory instead of item directory.
 
Last edited:
Level 4
Joined
May 17, 2008
Messages
75
The game keeps increasing in memory usage even while the game is paused. This was a map with only the start position placed and the melee victory/defeat conditions, AI, and melee time of day functions disabled IIRC. I left it paused for an hour or so and it increased from ~210,000 K to over 850,000 K.

This should be the x64 version, running under Windows 7.
 

Attachments

  • wc3.png
    wc3.png
    2.5 MB · Views: 329

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
The game keeps increasing in memory usage even while the game is paused. This was a map with only the start position placed and the melee victory/defeat conditions, AI, and melee time of day functions disabled IIRC. I left it paused for an hour or so and it increased from ~210,000 K to over 850,000 K.
Try without the melee AI? Was this map running in JASS2 or Lua mode?
 
Level 4
Joined
May 17, 2008
Messages
75
Melee AI was disabled. It was whatever mode the default is. I just opened a new map, placed a start point and disabled the time of day, AI, and victory/defeat conditions in the Melee Initialization trigger.
 
(SyncStringTest.w3x)

For these natives, the string prefix parameter accepts anything other than null as a value. Otherwise, they do not appear to work. (This was tested in LAN with 2 players).

For a valid user, BlzSendSyncData does what it says. However, for an empty slot, BlzSendSyncData will not work as intended, and will probably have something to do with the Host's local string data.

JASS:
native BlzTriggerRegisterPlayerSyncEvent takes trigger whichTrigger, player whichPlayer, string prefix, Boolean fromServer returns event
native BlzSendSyncData takes string prefix, string data returns boolean
native BlzGetTriggerSyncPrefix takes nothing returns string
native BlzGetTriggerSyncData takes nothing returns string

(CancelTimedLife.w3x)

BlzUnitCancelTimedLife still kills summoned units instead of just removing their timed life.
Test maps attached below:
 

Attachments

  • SyncStringTest.w3x
    33.7 KB · Views: 96
  • CancelTimedLife.w3x
    17.9 KB · Views: 102
Last edited:
Level 9
Joined
Jul 30, 2012
Messages
156
BlzUnitCancelTimedLife still kills summoned units instead of just removing their timed life.

It is possible to remove timed life from units by using Phoenix ability to prevent the unit from dying. You just catch the "phoenixmorph" order and remove the ability on that event, to prevent the actual morphing. This trick has always worked even in the oldest patches.

But now that Blizzard is actively developing the game, and adding many new features for mapmakers, I suppose it's time to stop improvising things and request that they implement as much as possible natively.
 
Status
Not open for further replies.
Top