how does world editor differ these 2 thigns

W!†A_cRaft

Ultra Cool Member
Reaction score
28
Apparently when you want to get a level of an ability unit has you use a native

JASS:
GetUnitAbilityLevel(unit u, integer ability_rawcode)


but when you want to detect if a unit has a buff you use:

JASS:
UnitHasBuffBJ(unit u, integer buff_rawcode)


and that function does nothing else than call the above mentioned one, but with a comparison to see if it is >0 like this:

JASS:
function UnitHasBuffBJ takes unit whichUnit, integer buffcode returns boolean
    return (GetUnitAbilityLevel(whichUnit, buffcode) > 0)
endfunction



Sooo how does world editor differ am i asking for a buff or a unit with an ability?
only possible answer in my opinion is by the rawcode, but i am not sure that it is it so i am asking?

and also, this means that no buff and abiltiy will ever have the same rawcode, and that we can use abilities (passive or hidden in a spellbook) to act as buffs for checking things with a little jassing? correct?
 

jwallstone

New Member
Reaction score
33
There's absolutely no difference internally between a buff and an ability. That's why you use the same function to test for either.
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
The limitation with buffs though is that, while the buff may recognize what level it is, the Jass function can only return 0 if the buff isn't there or 1 if it is.

and also, this means that no buff and abiltiy will ever have the same rawcode, and that we can use abilities (passive or hidden in a spellbook) to act as buffs for checking things with a little jassing? correct?
Marker abilities? People use those all the time :)
Of course, if you're doing it MUIable, it's probably better to classify units by attaching values to them rather than adding disabled spellbooks, since the former is more versatile.
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
but if there is no difference between the buff and ability how come does the game not mix lets say this:

i have a hero who has a shadowstrike ability.

i usea trigger to check for if the hero has a buff and the trigger figgures that i have a level of an ability > 0 even when i do not have a buff.

only by rawcode correct? the rawcode of the ability and buff is never the same?
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
I'm not sure how the game responds if you use Newgen to try and force a buff and an ability to use the same rawcode. However, if you're using the automatically generated rawcodes, they will for sure never conflict, since all ability rawcodes have an 'A' prefix and all buff rawcodes have a 'B' prefix.


It for sure wouldn't be an issue though unless you're trying to break it, and even then I'm not sure that the game would let you.
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
the way i realized it is that the A/B is a hexadecimal coding of the number as a rawcode of the buff, basically making it possible to reach an ability limmit with the rawcodes that begin with an A, thus crossing over to a B, it is a large number yes, but it is still possible, i found it weird that the game has these 2 detections as a same mechanic, it can be exploited can't it?
 

Azlier

Old World Ghost
Reaction score
461
Raw codes are ASCII. They're integers that point to something in the Object Editor. A*** rawcodes are always different from B*** rawcodes. The first letter is usually there to "categorize" different objects while using the same rawcode system.

>it can be exploited can't it?
How?
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
the way i realized it is that the A/B is a hexadecimal coding of the number as a rawcode of the buff, basically making it possible to reach an ability limmit with the rawcodes that begin with an A, thus crossing over to a B, it is a large number yes, but it is still possible, i found it weird that the game has these 2 detections as a same mechanic, it can be exploited can't it?
It's not hex, it's base-256. Even if it were hex, there's no vulnerability as long as the characters used were to stay in the hex 0-F range. You probably noticed that the characters don't stay within the 0-F range of hex and thus assumed there was vulnerability, but you didn't check to make sure that it actually was hex, and not something else. It is something else, though; base 256 using CP850 character values.

Also, if it were hex, we would probably be using 0x<code> notation, not '<code>' notation.


If you want the un-hexidecimalishness of it to be demonstrated, do a [ljass]call BJDebugMsg(I2S('0000'))[/ljass] somewhere.
Be amazed as it doesn't display '0' :)
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
>it can be exploited can't it?
How?

well if it was to be hex than you could give abilities the buff codes and buffs the ability codes (maybe you can even now) and since the game detects if the code is a buff or an ability code than we could pass abilites as buff and vice verse which is an exploit yes?
 

saw792

Is known to say things. That is all.
Reaction score
280
Just because it starts with 'B...' doesnt mean it's a buff... the game knows this internally, it doesn't base it on the raw code.
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
if the game uses same function, and functions are same for the game engine and the engine gets the commands that are the same, the only difference is the rawcode given, there is no way that the game know this interrnally because it is the same function with only a difference in the rawcode
 

saw792

Is known to say things. That is all.
Reaction score
280
Except the rawcode is only a pointer to a whole lot of other data about the buff/ability/unit/destructable which does tell the game engine what type of object it is dealing with. Please don't state things as fact when you really have no idea.
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
Except the rawcode is only a pointer to a whole lot of other data about the buff/ability/unit/destructable which does tell the game engine what type of object it is dealing with. Please don't state things as fact when you really have no idea.

it is a forum, i asked how does game know the difference, people answered i asked specifics people answered, i stated what i thought it was and here you come saying that "pls dotn state thigns as facts when you really have no idea", so basically people should not ask questions on the forum, correct?
 

saw792

Is known to say things. That is all.
Reaction score
280
I told you the answer, you contradicted me without asking a question or clarifying it was only what you thought was true. Had you asked a question or asked for further clarification then I would have been happy to provide it. However, since you don't really express yourself too well the way you said what you 'thought' came across as you stating facts. So what I'm trying to say is try to communicate a bit better, not stop asking questions.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top