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

Where do I find the code for these functions?

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
In the Blizzard.j/Common.j, I can't seem to find the code anywhere for some of the functions. Such as,

SetUnitMoveSpeed
SetUnitFlyHeight
SetUnitX/Y
UnitResetCooldown

Is there just no more breaking these down, are these as basic as functions get in WC3?

I need these so I know how some of their things work, such as SetUnitMoveSpeed ALWAYS changes the color of the movement speed to red, instead of green. I don't really know what controls doing that, so looking at the code for it would be my best bet but I cannot find it...

Before SetUnitMoveSpeed - "Speed: Slow"
After SetUnitMoveSpeed - "Speed: Very Fast"
What I want it to do - "Speed: Very Fast"

Also, UnitResetCooldown effects ALL abilities on the unit. Now, I know there are some work arounds, such as removing all abilities that you don't want the cooldowns to reset, use the reset, then add all the other abilities back, or simply removing and then adding the spell back that you want to reset. But those feel really clumsy to me...
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Functions in the common.j file are as far as you can go, you can't get more info about how functions in common.j work without testing.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
WC3 is not SC2. It is just "clumsy".

You need to use the Blizzard.j and Common.j from the patch archive and not the base archives.

In Common.j...
SetUnitX is on line 1441 (first line is 1).
SetUnitY is on line 1442.
SetUnitMoveSpeed is on line 1447.
SetUnitFlyHeight is on line 1448.
UnitResetCooldown is on line 1612.

This is where you find the native declaration (the smallest part of JASS code).
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
In the Blizzard.j/Common.j, I can't seem to find the code anywhere for some of the functions. Such as,

SetUnitMoveSpeed
SetUnitFlyHeight
SetUnitX/Y
UnitResetCooldown

Is there just no more breaking these down, are these as basic as functions get in WC3?

I need these so I know how some of their things work, such as SetUnitMoveSpeed ALWAYS changes the color of the movement speed to red, instead of green. I don't really know what controls doing that, so looking at the code for it would be my best bet but I cannot find it...

Before SetUnitMoveSpeed - "Speed: Slow"
After SetUnitMoveSpeed - "Speed: Very Fast"
What I want it to do - "Speed: Very Fast"

Also, UnitResetCooldown effects ALL abilities on the unit. Now, I know there are some work arounds, such as removing all abilities that you don't want the cooldowns to reset, use the reset, then add all the other abilities back, or simply removing and then adding the spell back that you want to reset. But those feel really clumsy to me...

you can still brake down more, but you will have to generate C or C++ code from the game.dll dll file and check the native functions there.

Even then you wouldnt most likely understand a shit there(most likely noone would), cause if you generate C/C++ code from dll it will be quite messy.

I dont quite understand the part with UnitResetCooldown, but there is no way to change the behaviour of native functions, unless you use custom game.dll or use SharpCraft
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
you can still brake down more, but you will have to generate C or C++ code from the game.dll dll file and check the native functions there.

Even then you wouldnt most likely understand a shit there(most likely noone would), cause if you generate C/C++ code from dll it will be quite messy.
This makes no sense. I am pretty sure you mean disassemble the file since it is machine code (you cannot make C/C++ from machine code, too much data is lost that it might as well be assembly).
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
Im not expert in this and neither I ever attempted to do this, but Im certain it is possible to generate at very least C code from dlls. You can call it disassemble, reassemble, whatever, its the same process no matter how or in what language you call it
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
This guy disagrees.
WC3 is .NET powered?

I am also pretty sure after snooping around the assemblies that there is no residual human readable function names and things except a few very strange ones (external dynamically linked calls?).

Im not expert in this and neither I ever attempted to do this, but Im certain it is possible to generate at very least C code from dlls.
Well since C is low level I am pretty sure you can, just each line of it might have nearly the same meaning as a line of assembly. All function names, variable names, and optimize-able structures are lost.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
If microsoft can map function names in dlls to code, certainly I can too, depending o how function call looks in machine code I may be able to restore at least calls inside

PS: In term of I meam as human, not as me myself
 
Status
Not open for further replies.
Top