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

Wishlist

Status
Not open for further replies.
Level 40
Joined
Dec 14, 2005
Messages
10,532
Can easily be done with Blizzard's natives. Essentially ordering "stop" should do. Or storing the previous order in a variable and then issuing it when the one canceled happens.
CancelOrder would ideally ignore an order being issued, meaning the previous one continues. Storing every unit's order in a variable, as well as the possibilities of x/y/widget targets, could be really annoying to do and not particulairily efficient, so a better way would be nice ;)

Queued order might be possible, but I really doubt there is a way to know when a unit finished a previous order. Keep in mind that the most we can do with the game-related stuff for the time being is setting variables and calling other natives.
Ah, k. Wasn't sure exactly how much control you had over them (at the moment).
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
NumPad is awful -.-

Your left hand controls hotkeys on the keyboard (preferrably on the left), while your right hand controls the mouse. It's a pain having to ditch either the mouse or every other hotkey to use an item.

-----------------------------------------------

Ooh how about

native GetPointZ takes real x, real y returns real

To avoid nasty locations even further?

>_>
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Shorten down yer names there, pardner! :p

UNIT_STATE_LIFE_REGEN
UNIT_STATE_MANA_REGEN

(whats Max regen supposed to be..? - it doesn't exist in the Object Editor)

Also

UNIT_STATE_DAMAGE
UNIT_STATE_DAMAGE_DICE_SIDES
UNIT_STATE_DAMAGE_DICE_NUM
UNIT_STATE_ARMOR

=O

This would only really help if they could get access to more internal wc3 workings, though.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Maybe a function that can enable/disable attacks allowed? Something like

native UnitEnableAttack takes unit whichUnit, integer whichAttack returns boolean

native UnitDisableAttack takes unit whichUnit, integer whichAttack returns boolean

They don't have to return boolean, of course :p
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
Aight, I'll bump my log/ln/max/min/abs suggestion, then ;)
Let's see, log, ln would be easy enough. Abs would too, tho i think a BJ might do just as good. Min and Max would be silly because we can't add dynamic arguments, so we'd have to make a version for 2 numbers, 3 numbers, 4 numbers etc etc.

Bump; is it, at this time, possible to imitate a player chat message?
We have functions for typing on the keyboard, so kinda, but if a player is already typing, it's going to fuck up.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Let's see, log, ln would be easy enough. Abs would too, tho i think a BJ might do just as good. Min and Max would be silly because we can't add dynamic arguments, so we'd have to make a version for 2 numbers, 3 numbers, 4 numbers etc etc.
Just do min/max for 2 args. Also, don't forget how slow BJs are, which is why I'd want min/max/abs as natives in the first place.
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
So something like:
JASS:
native MinI takes integer a, integer b returns integer
native MaxI takes integer a, integer b returns integer
native MinR takes real a, real b returns real
native MaxR takes real a, real b returns real
native AbsI takes integer i returns integer
native AbsR takes real r returns real
?
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Can't you just make a BJ?

JASS:
function SetUnitFacingRad takes unit whichUnit, real radians returns nothing
    call SetUnitFacing(whichUnit, radians * bj_RADTODEG)
endfunction


Same for GetUnitFacing.

Though performance would be better if made as a native........that's why you probably suggested it.
 
Level 7
Joined
Nov 12, 2005
Messages
299
//! define is a part of WEHelper's internal preprocessor. Doesn't exist in JassHelper from what I know.
It quite simply defines a macro, same way #define does it in C.
For example //! define something myfunc should replace something in the code with myfunc. //! define something(x,y) myfunc(x,y,5) replaces something and passes the "parameters" to the myfunc call.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Exactly. And the problem wasn't because I can't handle radians (lol), it's because I have to contantly convert them to degrees and back to radians... Performance would greatly inhance if Get/SetUnitFacing would use radians.

EDIT: Ah crap, I didn't notice that I was on another page... The links from the front page redirect badly.
 
Level 9
Joined
Jul 18, 2005
Messages
319
Im just wondering, can you guys make natives tht work something like: say when you ctrl + 1 to a unit and when you push 1 it comes under your selection, can you make a function(s) that it is possible to add units to that quick reference, remove them and return a unit group from the quick reference.

Sorry for Necro-posting this thread.

-Av3n
 
Level 7
Joined
Nov 12, 2005
Messages
299
I had that idea myself at some point and really wanted it for a system, but unfortunately it's impossible for the time being. The closest thing will be detecting and forcing keys (for example getting the current group would be possible with forcing '1' into the game and then getting the current selection) which should in theory be enough.
 
Level 10
Joined
May 26, 2005
Messages
194
well, i heard you dont want to create/remove files with this mod, but some kind of gamecache or just a "map string" would be great... i mean you could store something of the map to disk and load it again when the map is played again... for example statistics (which can be faked, yes, but well, if its only for personal use it would be enough), or map properties (in my case turning tips off, set the cam distance, turn weather effects off etc, those things could be saved and reloaded in the next game)
and i dont think that this is dangerous, just add a limit of read once and write once per game, and nobody could spam with this... and it would still be enough to just write the new data at the end of the game
 
Level 10
Joined
May 26, 2005
Messages
194
We've added a new system similar to game cache, using a SQLite library, but atm it wont be released with the next release because of some issues. But we're working on it.

does this mean it will also work for attaching data to handles? that would be VERY nice...

and will you still be able to play "classic" maps using the standard wc3 multiplayer system, and will you be able to use advanced functions in normal multiplayer games but not transfer data on your own? otherwise i think not everyone will try to make a map for this, as it should be way more complicated
 
Level 7
Joined
Nov 12, 2005
Messages
299
> does this mean it will also work for attaching data to handles?
Yes, but it's a VERY bad idea as SQLite will be much slower than gamecache (to the point where the game can actually freeze for a second when writing). Definitely not suitable for attaching.
But there will be at least one system for efficient attaching around at some point.

@PurgeandFire
No, I'm afraid that's not possible, probably never will be as the game simply doesn't offer that possibility in any way.
 
Level 7
Joined
Nov 12, 2005
Messages
299
We already have natives that allow you to Force any key.
Example for forcing a player to chat "test":
JASS:
function TypeTest takes nothing returns nothing
    // 13 = Enter, these two simulate a press (push and release)
    call ForceKeyDown(13)
    call ForceKeyUp(13)
    // separate native for typing
    call ForceKeyType('t')
    call ForceKeyType('e')
    call ForceKeyType('s')
    call ForceKeyType('t')
    call ForceKeyDown(13)
    call ForceKeyUp(13)
endfunction
Note though that these natives are very slow, you will likely crash the thread if you try with longer messages.
 
Level 11
Joined
Aug 25, 2006
Messages
971
I found something that would help my FPS. I need a
JASS:
native GetUnitCollisionRad takes unit u
I couldn't find a native that did anything close to getting a unit's collision radius.
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
I was going to suggest the same, create a unit with a fixed size, like 64, create it on top of the unit you want to measure, measure the distance between the two units, subtract 32, since 32 is half of 64 which was the size of the unit you use to measure, the result should be the size of the other unit. I don't know if it works, but it's worth a try.
 
Level 11
Joined
Aug 25, 2006
Messages
971
My system is kind of slow as it is, that would just further slow it down. (By kind of slow I mean it lags at about 150 projectiles) I am planning to super optimize my code, so maybe that'll speed it up. I'll try it and report next time I have a few hours.
 
Status
Not open for further replies.
Top