Snippet Typecasting

You can generally use a Table instead of a HashTable.

This just removes a HashTable from the map!
 
Nowadays typecasting is out of date, we have struct and such now, imho this library is only useful to repair broken old maps which used gamecache and return bug. (for lazy ass and not speed freaks)

So this "problem" is totally irrelevant, since these kind of maps didn't use an hashtable for the following really decent reason : it didn't existed yet :D

I mean don't use this library in new maps, or anyway if you care that much you can edit it for yourself.
Or kingkingyyk3 could "requires optional Table" *shrugs*
 
JASS:
//  ====================================
//   Functions provided :
//  ====================================
//  Agent2Widget(agent) -> widget
//  Agent2Group(agent) -> group
//  Agent2Trigger(agent) -> trigger
//  Agent2Timer(agent) -> timer
//  Agent2Location(agent) -> location
//  Agent2Effect(agent) -> effect
//  Agent2Unit(agent) -> unit
//  Agent2Item(agent) -> item
//  Widget2Unit(widget) -> unit
//  Widget2Destructable(widget) -> destructable
//  Widget2Item(widget) -> item

Table is not open for saving handles.
 
With an HandleTable and one global variable per handle type, like "widget", "location" and so one, it should work.
But that's not the most important thing.

Honestly kinkingyyk3, do you think about any other valid purpose other than fixing old maps which use the return bug and no hashtables ?

Anyway, we are talking about one hashtable only for a such generic code, so if you hurt the limit of 256 hashtable you are probably doing something wrong.
 
With an HandleTable and one global variable per handle type, like "widget", "location" and so one, it should work.
If you are sure on this, please post a demo.

Honestly kinkingyyk3, do you think about any other valid purpose other than fixing old maps which use the return bug and no hashtables ?
It is useful for converting. Just like getting dead items from item death event.

Anyway, we are talking about one hashtable only for a such generic code, so if you hurt the limit of 256 hashtable you are probably doing something wrong.
I don't think you can hit the limit.
If you hit it, you are doing something wrong.
 
If you are sure on this, please post a demo.
No i am not sure, just a theory, and i can't test it (i mean i can't use vJass, well i could do it in jass but meh ...)

EDIT :
Ok it can be done but with some fancy stuff, including a struct, arrays, and so one, i forgotten that Table returns an integer not an handle, so nevermind.

But remember me, are we still allowed to do that ?

set agentOrHandleVariable = unitVariable

It is useful for converting. Just like getting dead items from item death event.

I said "honestly".
If you are talking about the widget death event if you don't know what sort of widget die when the event fire, then you will probably have other bigger problems.
And without typecasting, you still can know which type of widget is dying, simply because the other event responses will return null, at least this way is not an exploit of a bug.
 
And without typecasting, you still can know which type of widget is dying, simply because the other event responses will return null, at least this way is not an exploit of a bug.
Proof? Any native of return dying items other than using typecasting+GetTriggerWidget()?
 
the new Table is not 100% compatible with old table... lol

I dislike it...

People like to use the same name as other resources but don't make 100% compatibility
 
I don't get you... adding a Table version will not change the original system. You can still use the original one, if you have the old Table and don't wanna change (however it's worth to change)

Also, the whole system is like two textmacro. It could be easily done with some static ifs.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    I don't think he ever figured out how to do the calamari in a pan though, like idk how to do that either. He was afraid of the at home deep fryers though and it's like yeah, that's fair, I am too
  • Varine Varine:
    He was just such a sweet old man, we had two servers pregnant and they held a baby shower together, he was soooooo fucking excited to get to see a baby. Unfortunately he died a month or so before they were born
  • The Helper The Helper:
    So I decided to Google some people that I had not seen or heard from in a while and sure enough one of my old best friends, we had a falling out years ago but whatever, find out he died of Pancreatic Cancer in January. I have also lost a few of my closer acquaintances from growing up the last year. Getting old - people die - I kinda thought it was going to be this way a few years ago....
    +2
  • The Helper The Helper:
    Forum running super slow again
  • Ghan Ghan:
    Not really clear from the stats as to what is causing the slowness.
  • Ghan Ghan:
    We get a lot of guest traffic so it may just be the load is getting too high and not from any particular source.
  • Ghan Ghan:
    Looks like the server is maxed out on CPU.
  • Ghan Ghan:
    Oh it looks like a lot of the traffic is Silkroad Forums. That domain isn't protected by Cloudflare.
  • Ghan Ghan:
    But the old Silkroad site is still on its own server. I just had a test site set up on this server for it.
  • Ghan Ghan:
    I just disabled that test site. Let's see if that helps the load.
  • Ghan Ghan:
    Looks much better already.
  • The Helper The Helper:
    I had actually forgot about the Silkroad site. I had asked
  • The Helper The Helper:
    SD Ryoko about it and he said the couple of people left on there really like it, that was a few years ago, maybe I should check back
  • jonas jonas:
    I guess when you're getting old, and the last day of soup season draws near, you start wondering
  • jonas jonas:
    will I make it to the start of the next season? or was this the last time I'll ever have my favorite dish?
  • The Helper The Helper:
    I am doing my first Vibe Coding project. In installed the environment and tools according to instructions but it is all chat doing this for me at my direction. It is fun really and holy shit I might finish in 2 hours what it would have taken a day to in my Access and this would be an electron app complete new
  • Ghan Ghan:
    Good stuff.
  • Ghan Ghan:
    Just make sure it is secure. :)
    +1
  • The Helper The Helper:
    It will only be on internal network
  • jonas jonas:
    Man the AI is good about gaslighting about security though. I've had several times where I pointed out security problems and it tried to convince me that with a tiny tweak it suddenly becomes secure
  • jonas jonas:
    Like using a distrobox as a "secure" container, and when I point out that's not secure at all, it claimed that specifying home will make it secure
  • The Helper The Helper:
    Yeah I finished the app today and it is bad ass. Like ChatGPT codes way better and faster than me that is for sure. The app is unsecure AF though and I would never put it anywhere it was obvious. I did not even show it today, the boss never made it in, but I showed the office and they liked it and frankly, I do software for a living and I am qualified to judge this kind of stuff and... Holy Shit this is a game changer. It took me around 4 hours to finish the app from design to end and that is much faster than I could have done it in the outdated MS Access the thing it replaced was in. Good Stuff! Had tons of fun doing it too! Work has not been fun in a while - today was fun!
    +1
  • The Helper The Helper:
    And really, I did not do it, chat wrote all the code I just pasted it in, tested it, acted like Chats eyes on it and just learned. I learned VS Code, how to use the Terminal and a bunch of Powershell and Command stuff, I used Git for the first time and learned how to save, search, start my server, stop it, run the tests, do some debugging - all the freaking fun stuff - chat wrote all the code
    +1
  • The Helper The Helper:
    I think the key was the 40 minutes of that 4 hours that went into the design of it. The thing was fully specced out before we started and the only reason it took so long was I had never done any of it and had to get used to the navigation and workflow.
    +1
  • The Helper The Helper:
    React, JS and AG Grid are the tools that I know i used along with git. I learned alot but it will be a minute before I fully understand everything I am doing in these environments because I am really just following instructions.
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top