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

Patch 1.23b, JASS, GUI, and Gaming

Status
Not open for further replies.
Level 15
Joined
Jul 19, 2007
Messages
618
I also have to agree with DSG about the new natives. I loved Hashtable from the moment i read it used integers instead of strings and that it could save almost ALL handles!

But DSG, Me and Eccho have had some exchange of knowledge and files, but on both of our computers, the new natives didnt work/compile! What did you do to get them to work? =S

this is a must

wyrmlord said:
You don't need to update PJASS or JassHelper to get syntax checking on hashtables to work. Instead, you need to make sure they're using the most recent version of common.j.
 
Level 8
Joined
Aug 6, 2008
Messages
451
...still if we count best jass maps like DotA or such then y this GUI ones dont stand a chance!...

Lols. Its true that some cool Jass made maps pwn GUI maps, but whats so special in dota that you cant do with GUI?

( And the answer is: you cant do anything with GUI, you need custom script and then you can do some stuff and it will still suck because of that horrible GUI interface )


You can do lots of cool "Jass" stuff with GUI + custom script, and most of dotas thingies too, if Im not mistaken.
The main reason why we use Jass, is because its easier to code with and looks much much better than GUI. ( Ofc better performance is a nice thing to have too.. )
 
Level 15
Joined
Jul 19, 2007
Messages
618
Lols. Its true that some cool Jass made maps pwn GUI maps, but whats so special in dota that you cant do with GUI?

( And the answer is: you cant do anything with GUI, you need custom script and then you can do some stuff and it will still suck because of that horrible GUI interface )


You can do lots of cool "Jass" stuff with GUI + custom script, and most of dotas thingies too, if Im not mistaken.
The main reason why we use Jass, is because its easier to code with and looks much much better than GUI. ( Ofc better performance is a nice thing to have too.. )

ofc thats what i mean as well i named dota only coz we all know that map and for no other reason!

ofc GUI + custom script lol coz without custom script it means leaks...

Yes i read that, but where to get that? Where to get that Beta Patch or so? Where to put the new file?

huh? i thought u already have installed beta patch! if not then ofc it does not work... i did not test jet beta patch but i know how to install it... and i think that JNGP will load automatically new common.j from patch.mpq or smth!
if not put it in ur warcraft iii directory and ur done!
 
Level 12
Joined
Feb 23, 2007
Messages
1,030
You either use GUI, in which case there's no problem, or you use vJass in which case you should NOT be using Kattana's handle vars and could fix your map within 1 minute (replace H2I by GetHandleId) or you use jass and are now in big trouble. If the latter is your case, then it's your own stupidity of not using Table & vjass that brought you into the trouble :p

How can you attach things in JASS without H2I or using tables? lol
 
...still if we count best jass maps like DotA or such then y this GUI ones dont stand a chance!...
You say DotA is one of the best vJASS maps? DotA is using the H2I bug everywhere, in most of the spells. (& Systems). Its pretty easy coded and not modular.

Back to topic, I still want more information about the bug. Is the 'Return bug' fixed in SP now, will they fix it, will they let it, what about it?
 
Last edited by a moderator:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Hoernchen, your making no sense.... The only triggers that will not work are ones which involved the double return bug (JASS). GUI will not be affected at all next to improved a bit.

Any JASS code which did use the double return bug can easilly be fixed so as to be compatiable. Thus I think you misinterpreted what blizzard said, and your maps should be made easilly to work again, if not they still will work.
 
Level 15
Joined
Jul 19, 2007
Messages
618
Hoernchen, your making no sense.... The only triggers that will not work are ones which involved the double return bug (JASS). GUI will not be affected at all next to improved a bit.

Any JASS code which did use the double return bug can easilly be fixed so as to be compatiable. Thus I think you misinterpreted what blizzard said, and your maps should be made easilly to work again, if not they still will work.

thats exactly true! i mean you dont need to recode whole of your triggers but just replace H2I with GetHandleId and thats all!
 
Level 15
Joined
Jul 19, 2007
Messages
618
and if you used I2H() or S2I() or B2I() or C2I() youre screwed. Not like you werent even before this patch, but recoding a map with ~500 calls to different I2X() is tiresome.

yes but if thats the case then this new patch will save that guy from nightmares i had when i was discovering whats wrong! until i learned about HSC!

jet thats just another reason why i love new patch coz well you will be sure to play safe maps not bugged ones! i mean corrupted... lol if only at that time i new about I2X corruption :S

ohh and btw does anyone know will blizzard really completely fix the return bug i mean this:

JASS:
function H2U takes handle h returns unit
    return h
endfunction

coz well if they will fix that then GUI will be effected:

JASS:
constant native GetTriggerWidget takes nothing returns widget

function GetDyingDestructable takes nothing returns destructable
    return GetTriggerWidget()
endfunction

well i dont think that this will be fixed but not sure!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Unlike other things, widgets all shair simlar features and so they are meant to be highly changable. Thus they should permit easy type casting from widget to unit, destructable or item and vica versa. However they should not allow conversion from unlike fields, like floatingtext to unit as that would cause major errors internally.

Remember that units, items and destructables extend widgets and widgets extend handles. Unlike most types which extend handle.
 
JASS:
function GetDyingDestructable takes nothing returns destructable
    return GetTriggerWidget()
endfunction

Are you sure they want to fix that? Guess they could just replace such functions with natives

They already did.

JASS:
constant native GetTriggerDestructable takes nothing returns destructable

function GetDyingDestructable takes nothing returns destructable
    return GetTriggerDestructable()
endfunction
 
Level 15
Joined
Jul 19, 2007
Messages
618
They already did.

JASS:
constant native GetTriggerDestructable takes nothing returns destructable

function GetDyingDestructable takes nothing returns destructable
    return GetTriggerDestructable()
endfunction

ahh ty i dont have beta version so i did not know!

Unlike other things, widgets all shair simlar features and so they are meant to be highly changable. Thus they should permit easy type casting from widget to unit, destructable or item and vica versa. However they should not allow conversion from unlike fields, like floatingtext to unit as that would cause major errors internally.

Remember that units, items and destructables extend widgets and widgets extend handles. Unlike most types which extend handle.

i know that unit, dest... extend widget not handle but for example if function returns widget and i return destructable its correct but opposite should be wrong coz widget does not extend destructable right?

so if it returns dest then widget would be wrong i guess!
anyway since now i know they already coded native for it then its all logical! they will make strict type handling same as in GUI!


well anyway ty guys and +rep illidanx
 
Level 14
Joined
Nov 18, 2007
Messages
816
Blizzard will remove any kind of unsafe upcasting (that means from widget to destructable, or from handle to trigger). The only way to upcast will be through hashtables. WC3C already has a resource (ab)using this.
However, downcasting is, always was and will be allowed, even implicitly (this only applies to handles and subtypes, implicitly downcasting from handles to integers wont work).
 
Level 15
Joined
Jul 19, 2007
Messages
618
Dreadnought[dA];1170475 said:
Then why were you telling Blizzard to go suck a big one?

yes we (users) are the ones that notifyed blizzard about this bug coz if u did not know you could have spread viruses by simply converting code and integer!

btw H2I was always a slow function anyway! so this is more like a blessing! i mean they even added hashtable... they are all natives and are fast! + they will add some more natives like GetTriggerDestructable... and on top of that it will be accessible in GUI...

btw i really dont think that changing H2I to GetHandleId is hard! use some good text editor like n++ and use replace command... thats so simple!

if you where using some other bug returns like I2x then this patch will save your map from HSC!

so i can see only good things about new patch! this maps which are no longer supported by ther creators and are using bug-returns are not 100% safe anyway. so its good to know if you are playing safe game or not...

Greets!
~Dark Dragon
 
Level 8
Joined
Aug 6, 2008
Messages
451
I was so wise man that I had a Typecasting library for H2I and my attaching systems just required that library.

Now I just need to replace that one H2I and update my Table and it will be allright.

Also, those hashtable functions might be really really fast, which would mean that they could be used like everywhere which would be kinda sick.. ( in a good way )

And H2I was perfectly safe btw. And it seems that GetHandleId is just the same, maybe little faster though.
 
Level 6
Joined
May 7, 2009
Messages
228
Is there anyway to take advantage of the automatic caching of strings without using I2H?

E.g. every string you use is added to a secret table without having to explicitly store them.
 
Level 6
Joined
Apr 16, 2007
Messages
177
I'm not sure I'm too clear on hashtable safety yet...

JASS:
// What I'm doing here is storing both the attached and the attaching
// value into the hashtable.

globals
    constant integer Attacher___MODE_KEY = 0
    constant integer Attacher___MODE_VAL = 1

    constant hashtable Table = InitHashtable()
endglobals

    function Attacher___GetHandleKey takes handle typeval returns integer
        return GetHandleId(typeval)
    endfunction

    function Attacher_GethandleKey takes handle typeval returns integer
        return Attacher___GetHandleKey(typeval)
    endfunction

    function Savehandle takes hashtable table,integer mode,integer key,handle typeval returns integer
        if mode == Attacher___MODE_KEY then
            set key = Attacher_GetHandleId(typeval)
        endif
        call SaveHandle(table , key , mode , typeval)
        return key
    endfunction

    function Loadhandle takes hashtable table,integer mode,integer key returns handle
        return LoadHandle(table , key , mode)
    endfunction

    function Havehandle takes hashtable table,integer key returns boolean
        return ( HaveSavedHandle(table , key , Attacher___MODE_KEY) and HaveSavedHandle(table , key , Attacher___MODE_VAL) )
    endfunction


function SetHandleHandle takes handle key_handle, handle val returns nothing
    local integer key = Savehandle( Table, MODE_KEY, 0, key_handle )
    call Savehandle( Table, MODE_VAL, key, val )
endfunction

function GetHandleHandle takes handle key_handle returns handle 
    local integer key = Attacher_GethandleKey( key_handle )
    local handle loaded = Loadhandle( Table, MODE_KEY, key )
    if key_handle == loaded then
        return Loadhandle( Table, MODE_VAL, key )
    endif
    return  null
endfunction

When I'm trying to attach handles to handles, would something like this work?
It should 'leak' all type of handles since it doesn't free handles from memory anymore, correct?

so what would this print:
JASS:
function Hum takes nothing returns nothing
  local unit u = CreateUnit( 'hfoo', Player( 0 ), 0, 0, 0 )
  local unit z = CreateUnit( 'hpea', Player( 0 ), 100, 0, 0 )
  call SetHandleHandle( u, z ) 
  call SetHandleHandle( z, u ) 
  call KillUnit( u )
  call TriggerSleepAction( 500 )
  if GetHandleHandle( u ) == z then
    call BJDebugMsg( "u -> z: still there" )
  else
    call BJDebugMsg( "u -> z: gone" )
  endif
  if GetHandleHandle( z ) == u then
    call BJDebugMsg( "z -> u: still there" )
  else
    call BJDebugMsg( "z -> u: gone" )
  endif
endfunction

My guess would be that still everything is there, so the handle indicies will never get recycled. Is that correct?
 
Level 14
Joined
Nov 18, 2007
Messages
816
yes, the datas still there. Unlike gamecache, hashtables are ref-counted, meaning storing handles in it will increase the ref-counter of the stored handles. You have to flush those keys manually (to de-reference those handles, thus decreasing their ref-count).

Note: handles casted to integers dont increase the ref-count anymore (not like they ever did). Using handles as keys for hashtables still doesnt increase the ref-counter (and it probably never will).
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
An update has been released!

I tried to enter WestFall battle.net, and it gave me an update message.
I clicked cancel to see if it was also on Northrend Server, and it was.

Is this the official update? Holding a fully fixed return bug and fully working hashtable/new natives?
 
Level 6
Joined
Oct 4, 2008
Messages
263
Question: how can i use hashtables in vJass? since the jasshelper/JNGP arent updated to patch 1.23.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
@ Purplepoot, I probably didnt have the latest patch from northrend? =\ Because it showed a patch log going up to 1.23 still,,
But when i downloaded the Westfall patch, the update log showed 1.24.

My patch log:
JASS:
--------------------------------------------------------------------------
  WARCRAFT III: THE FROZEN THRONE VERSION HISTORY
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Patch 1.24
--------------------------------------------------------------------------
PC WORLD EDITOR CHANGES
- Added new JASS hash table functions to replace the lost functionality from 
   fixing unsafe type casting.
   - Hash Table - Save Item Handle
   - Hash Table - Save Unit Handle
   - ...
   - Hash Table - Load Item Handle
   - Hash Table - Load Unit Handle
   - ...
   - Hash Table - Get Handle ID
FIXES
- Fixed an exploit related to unsafe type casting that allowed users to 
   execute arbitrary code in maps.
- Fixed the JASS unsafe type casting exploit ("return bug").
- Fixed several World Editor crashes.
--------------------------------------------------------------------------
Patch 1.23
--------------------------------------------------------------------------
FEATURES
.....
 
Last edited:
Level 15
Joined
Jul 19, 2007
Messages
618
CG said:
According to Hindar, HaveSavedX now works, but so does the return bug work around...

the bug return does not work for me!
any map with return bug is not playable with v1.24 i just tested it!

Hijax said:
Question: how can i use hashtables in vJass? since the jasshelper/JNGP arent updated to patch 1.23.

interesting you said v1.23? i mean 1.23 is already out some time now but v1.23b came out some time now and was a little bugged so now with 1.24 it seems quite stable and you jasshelper has nothing to do with wc3 update to 1.24 hashtables work on 1.24 with jh 0.9.H.2!

keys work as well so enjoy!
 
Status
Not open for further replies.
Top