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

Wishlist

Status
Not open for further replies.
Level 21
Joined
Aug 3, 2004
Messages
710
Since i'm creating a bunch of new natives for WC3, i thought that i might aswell just create some more jass functions, incase anyone wants to use them.
First of all, the basic native set, will include only winsock, then i'm going to make another pack, that has C standard math(Only the ones missing), which will be an option for developers that use WarSoc, it will be part of the end user product.

This will be the wishlist for natives you might need, but you should know that i'm not a very good programmer, and i might not be able to do everything.

Wishlist:
  • MindWorX:
    • WarSocAPI - Done, new version coming. Standalone
    • MouseAPI - Partly Done. Part of WarSoc
    • WindowAPI - Partly Done. Part of WarSoc
    • C Standard Math, The Missing Functions - Partly Done. Part of WarSoc
    • C File Reading - I'll add this for the possible use of reading a database included with a map. Also going to add filewriting, but in a way so endusers have complete control. This means they can specify a max filesize and if filewriting is allowed at all. Filewriting will still be limited to text. Part of WarSoc
  • SFilip:
    • Binary Operators. - Still WIP.
    • MD5 and SHA1 string hashing. - Done
    • Encryption - Still WIP.
  • Diablo-dk:
    • Combine SetUnitX/SetUnitY into function. - Still WIP.
 
Last edited by a moderator:
Level 21
Joined
Aug 3, 2004
Messages
710
JASS:
native SetExactCameraHeight takes player whichplayer, real height returns real

return real returns "height"

it ignores "average terrain height"

I'm pretty sure that effect can be achieved using
JASS:
GetTerrainHeight()-DesiredHeight
Either way, that wont be possible yet, i'm not able to change anything of the game using custom natives right now, might be a possibility later, but not right now.
 
Level 7
Joined
Nov 12, 2005
Messages
299
Well anything that involves messing with the game itself isn't really possible. It may be at some point, but for now all you can do is manipulate with integers, reals and strings.
So no, those two aren't possible either I'm afraid.

Anyway my suggestions:
-binary operators (and, or, xor, not, shift left, shift right)
-md5 and sha1 sums
-encryption
 
Level 21
Joined
Aug 3, 2004
Messages
710
Well anything that involves messing with the game itself isn't really possible. It may be at some point, but for now all you can do is manipulate with integers, reals and strings.
So no, those two aren't possible either I'm afraid.

Anyway my suggestions:
-binary operators (and, or, xor, not, shift left, shift right)
-md5 and sha1 sums
-encryption
For math, this might interest you: Linky
md5 and encryption is going to be part of my next gen WarSoc native set, and i could add sha1 too.

Combining SetUnitX/SetUnitY into one function will make them faster?
That might be possible, i'd have to research a little, but i think it's possible.

Also, is MouseAPI gonna include mouse-click detection? Most stuff can be done with trackables, but it would possibly be nice for some fps maps.
Going to add full mouse and keyboard key detection, it just proved to be a little harder than i thought, since blizzard is already doing their share of detection for the normal UI.
 
Level 9
Joined
Jul 27, 2006
Messages
652
Are you going to design your own storage system?
If not it would be nice, sorta like LHV but without using a slow ass gamecach?

Heres something me and my friends thought would be fun, adding a chat system to the loading screen?
With the ability to create a map of any size im sure load times would be alot longer so a way of communicating would be nice...
 
Level 12
Joined
Aug 3, 2005
Messages
745
Well guess I could add a few functions I use, see what you think.


Mainly for projectile spells, a simple one line move a unit towards a direction with an angle:
(Note: Ive split it into 2 lines otherwise it shows up strange in jass tags)
JASS:
function MoveUnitToPolarProjection takes unit u,real d,real a returns nothing
   call SetUnitPosition(u,GetUnitX(u)+d*Cos(a*bj_DEGTORAD) 
   ,GetUnitY(u)+d*Sin(a*bj_DEGTORAD))
endfunction

Get distance between points (instead of locations):
JASS:
function GetDistance takes real x1, real y1, real x2, real y2 returns real
    local real dx = x2 - x1
    local real dy = y2 - y1
    return SquareRoot(dx * dx + dy * dy)
endfunction

Standard commonly used ones made by Vex and co.

CS Error
JASS:
function CS_Error takes player ForPlayer, string msg returns nothing
    local sound error = CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
    if (GetLocalPlayer() == ForPlayer) then
        if (msg!="") and (msg!=null) then
            call ClearTextMessages()
            call DisplayTimedTextToPlayer(ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" )
        endif
        call StartSound( error )
    endif
    call KillSoundWhenDone( error)
    set error=null
endfunction

The Minimal Timer usage:
JASS:
globals
integer TIMERS_N=0
timer array TIMERS
endglobals

function NewTimer takes nothing returns timer 
    if (TIMERS_N==0) then 
        return CreateTimer() 
    endif 
    set TIMERS_N = TIMERS_N - 1 
    return TIMERS[TIMERS_N] 
endfunction 

function ReleaseTimer takes timer t returns nothing 
    call PauseTimer(t) 
    set TIMERS[TIMERS_N] = t 
    set TIMERS_N = TIMERS_N + 1 
endfunction

function InitTrig_TimerCreation takes nothing returns nothing
endfunction

etc. etc.
 
Level 7
Joined
Nov 12, 2005
Messages
299
> Are you going to design your own storage system?
Possibly, but there is little need since the way WarSoc operates should be easy to MUI (MPI actually). In addition there are already much better systems than handle vars around, very fast and quite usable.
However we have an almost complete gamecache replacement when it comes to saving, SQLite based.

Anyway loading screen chat is not really possible - you wouldn't be connected until after the map loads.

And turning some functions like MoveUnitToPolarProjection into natives would produce very, very little speed gain, pointless to do really.
 
Level 2
Joined
Mar 13, 2007
Messages
6
i request that DotA cannot use more then 12 players or the join while playing thing otherwise warcraft will implode on DotA, no joke, there will be about 99% DotA in the custom game list on bnet if you allow DotA to use it and the amount of Dota games will just increase. It will change from a nuisance to an epidemic.
 
Level 7
Joined
Nov 12, 2005
Messages
299
While I doubt that would happen, having a "WarSoced" DotA would be awesome regardless of anyone's opinion on the map - it would cause this project to grow rather quickly and through that all RtC maps would receive more attention.

@Silvenon
That would be nice if we could get an actual speed gain (as opposed to simply taking the X/Y of the location and removing it). I'll see what I can do when I get some spare time.
 
Level 21
Joined
Aug 3, 2004
Messages
710
PurplePoot, his question may be related to non-warsoc projects, that still will be able to work over lan. But i still don't see a reason to do, since you can simply use GetLocalPlayer() for it, and if we made a native for it, the speed would be the same, but less secure in terms of variables, since most GetLocalPlayer blocks requires carefull handling of variables so it doesn't cause desyncs.

Other than that, PurplePoot is completly right in the aspect of syncing, WarSoc will be the opposite of how warcraft III works normally, instead of doing things always synched, you have to write it so it's synched. This leaves more room for local things, but gives a higher risk of unseen desyncs.
 
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 27
Joined
May 30, 2007
Messages
2,872
I want a keyboard that's just one big touchscreen (preferably not glass and with some tactile options), that way you don't need a mouse and the whole keyboard could change to fit the games needs.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
HappyTauren said:
but you will be able to detect every key (if is pressed or not) so you will be able to use item if key is pressed.

Good enough for me.

Yeah, Pooty's idea is great, then we could avoid locations completely.

Oooh, I got an idea:

native GetAbilityOrderString takes integer abilityId returns string

Is that possible? I think that would be really useful.
 
Level 7
Joined
Nov 12, 2005
Messages
299
> Is that possible?
Maybe. But I'm not sure if this would be too useful as you can make a small system to get this order easily.

> what does that mean for spells?
No idea. You will probably be able to use something like an "any key is pressed" event and something like GetTriggerKey(), but the rest is up to the mapper.
 
JASS:
function chr takes integer i returns string
   local string abc = "abcdefghijklmnopqrstuvwxyz"
   local string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
   local string digits = "0123456789"
   if i >= 65 and i <= 90 then
      return SubString(ABC, i-65,i-64)
   elseif i >= 97 and i <= 122 then
      return SubString(abc, i-97,i-96)
   elseif i >= 48 and i <= 57 then
      return SubString(digits, i-48,i-47)
   endif
   return ""
endfunction

function ID2S takes integer itemid returns string
   return chr(itemid/256/256/256) + chr(ModuloInteger(itemid/256/256, 256)) + chr(ModuloInteger(itemid/256, 256)) + chr(ModuloInteger(itemid, 256))
endfunction

Would be very nice to have native that works like this. I dunno about S2ID though, there is one in cscache, but it uses cache =.=
 
Level 9
Joined
Jul 27, 2006
Messages
652
Any chance you could do some work on or even finish trackables? It would be nice too be able to use them properly ( e.g destroy them )
Could you also fix camera transisions, so an applied camera won't rotate in the complete opposite direction to what its supposed too.
Im sure you've already done this one but maybe fix the jass text editor in WE, so that you can undo and select properly. Maybe go as far as text colouring and all the other advantages of third party jass tools...
 
Level 7
Joined
Nov 12, 2005
Messages
299
> maybe fix the jass text editor in WE, so that you can undo and select properly
> Maybe go as far as text colouring and all the other advantages of third party jass tools...
This is what a tool/addon I made, TESH, is used for.
You can get it here or here.

I was thinking about maybe "finishing" trackables, however that would probably be pointless as we will add events for checking mouse clicks/movement thus making them pretty much obsolete.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Can you read the SLK tables to allow us to extract data from object editor fields, by any chance?

native GetAbilityObjectValue takes integer abilId, string dataField returns string

Would return everything as strings, for tables they could be seperated by commas. From there, parsing such as S2I could be applied as necessary.
 
Can you read the SLK tables to allow us to extract data from object editor fields, by any chance?

native GetAbilityObjectValue takes integer abilId, string dataField returns string

Would return everything as strings, for tables they could be seperated by commas. From there, parsing such as S2I could be applied as necessary.

I think that was in plan from start =)

Though I thought it different way, but yours is better :p
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
native H2I takes handle h returns integer

Since custom funcs are really slow, and H2I is really popular? It'd be nice, anyways (also, not having to put it into the script of every map), especially since you're eating up so much speed with all the synching anyways. (May as well be as efficient as possible!)

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

String2RawCode and RawCode2String... those are already easy enough

String2RawCode -- do you mean with a sort of "'RAWC'" rawcode and not the long number? (Of course, this only matters for aesthetic reasons)

RawCode2String -- Just store it as I2S('RAWC')+"this is a string" already ><

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

Will we be able to run this with Grimoire/WEHelper? *cough vJass cough*

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

I had a few more native ideas, but the site was down and now I've forgotten them -.-. I'll post them if I remember them, though.
 
Level 21
Joined
Aug 3, 2004
Messages
710
native H2I takes handle h returns integer

Since custom funcs are really slow, and H2I is really popular? It'd be nice, anyways (also, not having to put it into the script of every map), especially since you're eating up so much speed with all the synching anyways. (May as well be as efficient as possible!)
H2I is for some odd reason not possible right now, it causes a crash when used, but it's being looked into.

String2RawCode and RawCode2String... those are already easy enough

String2RawCode -- do you mean with a sort of "'RAWC'" rawcode and not the long number? (Of course, this only matters for aesthetic reasons)

RawCode2String -- Just store it as I2S('RAWC')+"this is a string" already ><
RawCode2String will convert the 'A000' integer rawcode into "A000" string value.
String2RawCode will convert "A000" string value into the 'A000' integer value. Useful for debug triggers since instead of doing a lot of checks, you can now just convert a simple string to a rawcode. Same for the other way around, if you don't remember what rawcode a unit has while debugging, you can just take it's rawcode and convert.

Will we be able to run this with Grimoire/WEHelper? *cough vJass cough*
It's actually highly recommended and the premade server/client solution will use vJass.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
JASS:
native log takes real power returns real//log of power
native ln takes real power returns real//ln of power
native abs takes real val returns real//abs of val
native max takes real a, real b returns real//larger of a/b
native min takes real a, real b returns real//smaller of a/b

The first two are just curiosities; I doubt they'd be used much, but they may come in handy some day, and it shouldn't be very hard to implement them.

The last three are currently BJs, and it would be nice to have a native equivelant for many situations (same idea as H2I)
 
Level 7
Joined
Nov 12, 2005
Messages
299
On some order event store the order string/id in a global variable.
When the some casting event (preferably begins) comes afterwards you already have it stored in that variable as it was most definitely the last order that happened at that point.
And, apart from this event, I see no real place where you would need it.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Bump

If possible,

native CancelOrder takes nothing returns nothing

Cancels the order issued from an EVENT_(PLAYER_)UNIT_ISSUED_(POINT_)(TARGET_)ORDER

Or something along the lines of that

(if possible...)

JASS:
native IssueQueuedTargetOrder takes unit whichUnit, string order, widget target returns boolean
native IssueQueuedPointOrder takes unit whichUnit, string order, real x, real y returns boolean
native IssueQueuedImmediateOrder takes unit whichUnit, string order returns boolean
native DropCurrentOrder takes unit whichUnit returns boolean
1,2,3 are fairly self explanatory, DropCurrentOrder issues stop if there are no more orders in the queue, else moves on to the next order

Again, not sure if this is possible.
 
Level 7
Joined
Nov 12, 2005
Messages
299
> CancelOrder
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.
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.
 
Status
Not open for further replies.
Top