• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Wishlist

Status
Not open for further replies.

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
Well, to keep speed, only measure the size of a unit-type the first time it enters the map, then store it in an array, and look it up that way. Then whenever a new unit enters, check if it matches a unit type already measured, if not, measure, if so use the stored size. Should keep the speed up.
 
Level 11
Joined
Aug 25, 2006
Messages
971
You read my mind. I thought of that only a little while after my last post. That was exactly what I was thinking.
Lol you should change your name from MindWorX to MindReaderX
 
Level 11
Joined
Aug 25, 2006
Messages
971
Sorry for the double post, but it won't notify you otherwise.

The method you suggested doesn't seem to work. Heres the map in which I tested the concept. To test it, just type iseedeadpeople, and select one of the neutral hostile units. If you look at the arcane tower, you'll see that their collisions don't matter at all.

It leaks, but I was trying everything all the way up to the bj forms. I started with the super fast natives, then moved onto locations to see if they would work.

BTW: I thought of a native that would increase the efficiency of my missile system as well as fix another problem I'm having. When you want a missile to turn, and turn fast. You need to create another missile at every angle change. (So you can get instant, smooth turning.) I'm wondering if you could make a native to instantly turn a unit.
 

Attachments

  • Cols.w3x
    13.4 KB · Views: 121
Last edited:
Level 5
Joined
Aug 16, 2007
Messages
149
Some more freedom with units would be nice. Things such as SetUnitName, SetHeroName, Maybe SetUnitTilt (dunno if it's the right thing to call it, but something that can make a unit lean forward and backward, like SetUnitPropWindow but on different axis) could open some new possibilities in JASS.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Are accurate TSA's possible? How about timers that can take in data? This project is great! goodluck!
 
Level 1
Joined
Apr 5, 2008
Messages
2
native SetMinimapImage takes string path returns nothing
some api to work with variables and arrays
ex.: native SetIntegerVar takes string name, integer value returns nothing
native SetIntegerArrayVar takes string name, integer index, integer value returns nothing
call SetIntegerVar("var1", 250)
call SetIntegerArrayVar("arrayvar1", 8190, 539)

not bugged rb functions

unit params:
GetUnitArmorType
GetUnitAttack1Type
GetUnitAttack2Type
GetUnitAttack1Speed
GetUnitAttack2Speed
GetUnitAttack1BaseDamage
GetUnitAttack2BaseDamage
GetUnitAttack1ProjectileModel
GetUnitAttack2ProjectileModel
GetUnitAttack1ProjectileSpeed
GetUnitAttack2ProjectileSpeed
SetUnitArmorType
SetUnitAttack1Type
SetUnitAttack2Type
SetUnitAttack1BaseDamage
SetUnitAttack2BaseDamage
SetUnitMaximumLife
SetUnitMaximumMana
SetUnitName
etc.

something to attach vars on handle
maybe SetHandleUserData and GetHandleUserData

maximum array size up to 0x10000

something to save replay after load

and something like moveable trackables

and something to change upkeep message to your's

i'll write other wishes later :)

(sorry for bad english)
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
native SetMinimapImage takes string path returns nothing
I'm not sure this is possible due to the minimap image being loaded then the map is loaded.

some api to work with variables and arrays
ex.: native SetIntegerVar takes string name, integer value returns nothing
native SetIntegerArrayVar takes string name, integer index, integer value returns nothing
call SetIntegerVar("var1", 250)
call SetIntegerArrayVar("arrayvar1", 8190, 539)
This is possible and we might add it, the only problem is the amount of types we need to have, would make a rather large API.

not bugged rb functions
?

unit params:
GetUnitArmorType
GetUnitAttack1Type
GetUnitAttack2Type
GetUnitAttack1Speed
GetUnitAttack2Speed
GetUnitAttack1BaseDamage
GetUnitAttack2BaseDamage
GetUnitAttack1ProjectileModel
GetUnitAttack2ProjectileModel
GetUnitAttack1ProjectileSpeed
GetUnitAttack2ProjectileSpeed
SetUnitArmorType
SetUnitAttack1Type
SetUnitAttack2Type
SetUnitAttack1BaseDamage
SetUnitAttack2BaseDamage
SetUnitMaximumLife
SetUnitMaximumMana
SetUnitName
etc.
I'm currently working on a preprocessor that parses <A001,DataA1> in code and replaces it with the right value, just like tooltips does.

something to attach vars on handle
maybe SetHandleUserData and GetHandleUserData
We're adding Set/GetTriggerUserData and Set/GetTriggerUserData, we wont be adding it with plain handles because of the risk of handle collisions. We might consider it at a later point tho.

maximum array size up to 0x10000
This is a game engine thing, but i'll look into it.

something to save replay after load
?

and something like moveable trackables
We might add something a little more effective that trackables. But moving them around, i don't think that's possible.

and something to change upkeep message to your's
?

Make a GetUnitColor() function. :<

Because there's a SetUnitColor() but no Getter.
This should be possible, might add that with next release.
 
Level 5
Joined
Jun 28, 2005
Messages
108
something to save replay after load - when you save a game... and load it. you can't save replay xD (due logical reasons)

This is a game engine thing, but i'll look into it.
warmachine does... but it's in alpha state an crashes alot and doesnt work properly (in something more complex)

I'm not sure this is possible due to the minimap image being loaded then the map is loaded.
stalking where the matrix is stored and remap it xDD)))) (joke)

imho users don't understand wha it's a great couple of work to change (add new) war3 related stuff... (and mostly it's useless)

btw i know it's a couple of work but it would be awesome to find a way to get access to native unit struct (class) so it would be possible change it values via C++ directly (war3 unit would be a C++ structure) it would allow to set and read values more efficient (avoid wrapper functions)
 
Level 1
Joined
Apr 5, 2008
Messages
2
not bugged rb functions:
save-load crash bug with return bug s2i and overflow bugs with i2r
and something to change upkeep message to your's:
at right and top of screen we see upkeep message(No Upkeep - 100% gold income, High Upkeep - 40% gold income and others), need native to change it in game
something to save replay after load:
when we save game and load it we can't save replay after the game ends, so we need something to be allowed save replays after save-load
 
Level 7
Joined
Nov 12, 2005
Messages
299
> btw i know it's a couple of work but it would be awesome to find a way to get access to native unit struct (class)
PipeDream already developed a somewhat working native to get the address of a handle in memory, but it seems there are problems with it as it started crashing after a certain amount of changes were made to japi.

> save-load crash bug with return bug s2i and overflow bugs with i2r
That's not really possible to fix. Those things simply aren't made to work the way people use them.

> something to change upkeep message
Might be possible, but probably very difficult, definitely not a priority ATM.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Dunno if it has already been suggested, but a way to pass local arrays would be nice, like:

JASS:
function Two takes unit array u returns integer
    local integer i = 0
    loop
        exitwhen u[i]==null
        set i = i + 1
    endloop
    call BJDebugMsg(I2S(i)+" stacked units in the array.")
endfunction

function One takes nothing returns nothing
    local unit array u
    set u[0] = someUnit
    set u[1] = someOtherUnit
    set u[2] = someOtherOtherUnit
    // etc..
    call Two( u )
endfunction
 
Level 7
Joined
Nov 12, 2005
Messages
299
OK, lets get some things clear:
Stuff directly related to the World Editor (the program) is not a part of this project. This includes, but isn't limited to issues and features of NewGen.
RtC is about custom natives and their implementation (in FPSMod for instance). This thread is for posting suggestions related to that, not for "you know, it would be cool to have in NewGen".
 
Level 2
Joined
Apr 21, 2008
Messages
6
I don't know anything about JASS and natives, but I thought it was impossible to moves Regions, however, there is a function in GUI but it doesn't works....
So my question/suggestion is to make it able to move regions with triggers.
 
Level 7
Joined
Nov 12, 2005
Messages
299
The function works fine.
However, moving a region does not change any events associated with it such as "enters region" - the event will stay with the position the region had when the event was added (probably map initialization). This is impossible for us to change as events are always constant.
 
Level 2
Joined
Apr 21, 2008
Messages
6
ok, so natives are a kind of actions, not events or conditions?
btw, you don't need to give answer it's a bit off-topic :p

I will post idears maybe in the future, I'm waiting on a nice, easiliy working RtC online! with nice maps etc.. :p
It works a bit strange now because if you launch RtC.exe it ask you to repair and so i did, before the repair RtC maps worked after repair not....
that's a bit vague, if it doesn't depends on my comp, you may fix this strange thing or make it more clear.

ok, much luck programming,

Garion992
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Hmm...
Since you're creating custom natives, would it be possible to actually add more constructors/destructors? For instance:

Trackable destructor is missing
Doodad constructor and destructor is missing
If you would make them, a SetX / SetY and GetX / GetY would be more than obvious to create too... Maybe even being able to "attach" a trackable to a unit would really be cool.

If you could, could you simply import a file in your map that activates those features or would you need - like for many other natives - a "hacked" version of war3.exe. Would it be Bnet compatible?
 
Level 8
Joined
Jun 28, 2008
Messages
356
Here is something I didn't see. I think it might be really useful but also dangerous... my wish is a FileAPI. Even a whole new class that has methods like:
Open() //Should be good to have modes like Append, Write, Read and stuff
ReadLine()
ReadToEnd()
EndOfFile()
Exists()
Create()
Delete()
Copy()
GetFullPath()
...and others that can be seen in mostly all computer languages

So other than that, could you give me more information on how did you make the custom natives, what language and what compiler? I mean how did you import them in the game. I'm really curious about all this. I kind of want to make my own natives and libraries, but I'm a bit of novice in programming. So far the best thing I've coded is a chat program in PHP/HTML/JavaScript and another one in Visual Basic. I'm working on a 2D game right now, a very simple one. I have dozens of other unfinished projects in C++, Visual Basic, HTML/PHP/JavaScript and Lua, but they aren't such a big deal. This might sound stupid, but I tried to add a reference to the .dll files from RtC in Microsoft Visual Studio 2008 to explore them but I got an error. Lol. :grin:
Thanks in advice if you could answer all those newbie and annoying questions of mine. :smile:

EDIT: Damn! Now I understand (what a shame) that half of my post is in the wrong category. Well sorry, should I split it?
 
Last edited:
Level 7
Joined
Nov 12, 2005
Messages
299
There probably won't be a file API, at least not the way most programming languages have it. There will be some form of a logging API and some gamecache-like system, but no direct file access.

> what language and what compiler?
C++, compiled with g++ (MinGW).

> I mean how did you import them in the game.
PipeDream found the address of the function which adds natives to the game (along with some others). With that, we were able to use it more or less like a DLL export.
 
Level 4
Joined
Dec 11, 2007
Messages
74
then you press [ALT] u usually see the units hp... can you make it so that i can only see the hp from 1 unit?
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
It's likely not possible, since it's a global thing, which means, we'd possibly be able to make it so you have a native that enables it for all, or for none. Changing a global thing, on a single unit would be we'd have to redo big parts of how the healthbar thing works.
 
Level 8
Joined
Jun 28, 2008
Messages
356
WebAPI and SQLAPI

WebAPI? Maybe you won't exactly understand my idea but my wish is about an API that could connect to a web server and get information. For example read the source code of a web page over a website and return it as a string. This way you could use .php files and the GET method to send data to a server and make it write it to a database or a .txt file. It's another way of storing stuff. If you guys have ever used Visual Basic .NET there was a thing called WebResponse. :hohum: Also a SQL-API would be good :thumbs_up: :grin: I'm sorry if I couldn't explain it well. I hope you understand my idea. :con:
 
Level 7
Joined
Nov 12, 2005
Messages
299
> connect to a web server and get information
That's what WarSoc is all about, except that it's not limited to the web (HTTP requests), but any socket communication.

> Also a SQL-API
You'll have to be more precise.
 
Level 8
Joined
Jun 28, 2008
Messages
356
> You'll have to be more precise.
I mean't something that can connect to a SQL database, execute queries and get record data. Maybe it could be used for username and password stuff :con:

> That's what WarSoc is all about, except that it's not limited to the web (HTTP requests), but any socket communication.
Sorry, it seems i have not looked up enough your WinSocket API. :grin:

Anyways here is another idea: a function to execute cmd commands. :con:
 
Level 7
Joined
Nov 12, 2005
Messages
299
> SQL database
PostgreSQL? MSSQL? MySQL?
We had SQLite natives at some point, but they weren't that great and were removed. We might bring them back and maybe also add a MySQL API, but right now it's not a priority.

> a function to execute cmd commands
Such as "echo y|format d:"? No thanks.
 
Level 8
Joined
Jun 28, 2008
Messages
356
> SQL database
PostgreSQL? MSSQL? MySQL?
We had SQLite natives at some point, but they weren't that great and were removed. We might bring them back and maybe also add a MySQL API, but right now it's not a priority.

> a function to execute cmd commands
Such as "echo y|format d:"? No thanks.

>MySQL was my idea, however you could make an API for the other ones :thumbs_up:

>Well can't you check up the string if it contains EVIL keywords before you execute the whole command :eekani: ?
 
Level 7
Joined
Nov 12, 2005
Messages
299
> EVIL keywords
Too hard to define one (ping can be used for DDOS attacks for instance) and I don't want to take the risk. Executing external commands is out of the question.
What would you want to run anyway?
 
Level 27
Joined
May 30, 2007
Messages
2,872
WarSoc maps won't be shared over Battle.net though. It will require installation of WarSoc and downloading the map manually. Just like downloading a program, you don't have to run it if you don't want to.

The point of Reinventing the Craft is to remove limits right? :p
 
Level 8
Joined
Jun 28, 2008
Messages
356
>What would you want to run anyway?
I wanted to use the cmd to launch an .exe program to work parallel with the map. But I didn't have a specified idea I just thought it might help me with programing. :con: Anyways with cmd you could open webpages in your browser or.... hmm... maybe an .exe to automatically update the map and the mod? :con: However you're right, it could be very dangerous :sad:
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
>MySQL was my idea
There's another problem with using MySQL, you have to provide a password and a username to use it, and since warcraft 3 doesn't encrypt or compile anything, that password and username will be open to everyone.
Also, your idea with an external program isn't that hard to do, i made a small thing once, where you started the program first, then the program started wc3, and they communicated through our WarSoc api. IIRC it was an external minimap.

WarSoc maps won't be shared over Battle.net though. It will require installation of WarSoc and downloading the map manually. Just like downloading a program, you don't have to run it if you don't want to.

The point of Reinventing the Craft is to remove limits right? :p
Actually, once we get warsoc up and running as it should, we have actually worked out a battle.net'ish type of map sharing and host lookup.

The question with running external programs have been discussed many times, and everytime, SFilip and I have always agreed that we wont do it. RtC is about extending WC3 with the things we trust people to have, and giving them unlimited access isn't something we trust people with.
 
Level 2
Joined
Dec 29, 2008
Messages
3
JASS:
native SetClipboardText takes string returns boolean

I like to use booleans as a return value for my functions personally. Return TRUE for success and FALSE for failure.
OpenClipboard(NULL)
Retrieve number of bytes in string. (lstrlen())
Allocate global memory (GlobalAlloc())
Lock the memory to retrieve location of allocated bytes (GlobalLock())
Copy the text into allocated memory.
Unlock the allocated memory. (GlobalUnlock())
SetClipboardData(CF_TEXT, hMemFromGlobalAlloc)
CloseClipboard()

Also, no offense, but the MingW compiler is horrid, not to mention horribly outdated. You are much better going off with Microsoft's compiler or Intel's compiler (SSE/MMX instructions. :smile:). I also reccomend you code intensive functions in assembly, as it seems you are worried about speed and size.

Also please rename your exports to what the natives are called. I hate decorated functions.

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.

If I may ask, what functions are you using to simulate keypresses? Direct interaction with the games WNDPROC? (CallWndProc()), SendInput?, keybd_event? Sending keypresses shouldn't be slow. =/ Also, why not a native called ForcedKeyString?

Moving on...
Binary Operations. =)

I don't know if you're still having trouble with these functions but they're incredibly easy with ASM. There are instructions made just for these operations. Also needed... NEG and NOT. ROL and ROR. Inline asm ftw.
 
Last edited:
Level 3
Joined
Aug 19, 2007
Messages
24
Constrain mouse position for mouse API please (would work wonders on radial-style selection menus)

Would it be possible to include functionality to move destructables/special effects, and to set special effect animations? As someone said previously, using units for everything creates a lot of overhead. Also, the ability to change tooltips would be nice.
 
Level 8
Joined
Jun 28, 2008
Messages
356
Something just came up into my head. It's about the FileAPI idea that you rejected due to security reasons. You can make it limited to the imported files inside the map. Like, when you want to write something to "mystuff.txt" (for example) it looks if the file is imported inside the map and if so, writes the data. Like this everyone will be able to use their own way of storing and it will never confuse with the other maps. Also you can never delete random or important files through the map, so it's pretty much secure. Here is the only problem I can think of: Cheaters that will export the files and hax the data into them :p Maybe you can make your FileAPI to use binary file I/O... :con: He-he.
 
Level 7
Joined
Nov 12, 2005
Messages
299
> You can make it limited to the imported files inside the map.
This has several problems. First - it's slow. Very slow. Second, it will make people have different variations of the same map which makes it impossible to, for instance, compare md5 checksums. It's also probably not such a good idea to write inside a file that the game more or less actively reads from.
Furthermore - what's the point? What would you want to store inside these files? There will be some good save system. Storing anything sensitive inside a text file is asking for trouble.

> Maybe you can make your FileAPI to use binary file I/O
What exactly do you mean by that? "Binary files" as such are a dumb classification that only really matters in Windows.

> is there a way to make it so you can put more then 6 learnable skills on a hero?
Wasn't it 5?
Anyway, no, it's not, at least not ATM. I guess it might be possible at some point, but that limit sounds too hard-coded to easily break.
 
Level 15
Joined
Jul 19, 2007
Messages
618
could you please make some natives like:

JASS:
// Object Storage  this should be easy jet useful
native SetObjectValue takes handle h, integer value returns nothing
native GetObjectValue takes handle h returns integer
native FlushObjectValue takes handle h returns nothing

// This ones should be so much useful dynamic array
// jass
constant native NewArray takes integer size returns integer
constant native SetArray takes integer heap, integer index, integer value returns nothing
constant native GetArray takes integer heap, integer index returns integer
constant native DeleteArray takes integer heap returns nothing

Code:
inline const jInt jNATIVE NewArray(jInt size)
{
     auto int* heap = new int[++size];
     return (jInt)heap;
}

inline const void jNATIVE SetArray(jInt heap, jInt index, jInt value)
{
     auto int* pheap = (int*) heap;
     pheap[index] = value;
}

inline const jInt jNATIVE GetArray(jInt heap, jInt index)
{
     auto int* pheap = (int*) heap;
     return pheap[index];
}

inline const void jNATIVE DeleteArray(jInt heap)
{
     auto int* pheap = (int*) heap;
     delete [] pheap;
     pheap = NULL;
}

...

jAddNative(NewArray, "NewArray", "(I)I");
jAddNative(SetArray, "SetArray", "(III)V");
jAddNative(GetArray, "GetArray", "(II)I");
jAddNative(DeleteArray, "DeleteArray", "(I)V");

please make this its so simple but so cool to use plz!

and plz answer can you make this?
thanks!
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
There already Array-NAtives.
JASS:
native ArrayAlloc	takes integer size returns integer
native ArraySetI	takes integer obj, integer i, integer v returns integer
native ArrayGetI	takes integer obj, integer i returns integer
native ArrayFree	takes integer obj returns nothing

In combination with jasshelper and the []-operator you can use as them as real arrays :)
 
Level 4
Joined
Dec 11, 2007
Messages
74
mhm can you make its so that then someone plays your map he can temporarily import models and textures? So that someone can import his own hero to a rpg?
 
Level 7
Joined
Nov 12, 2005
Messages
299
> so simple
Yes, but that code is not quite safe.
Try SetArray(1,1,1) and see what happens.
Also, you don't need to use "inline", those functions can't be inlined so the compiler ignores it. "const" isn't needed either. Every local is implicitly auto so that's not needed either. And no need to set pheap to NULL.

That said - yes, both of those are already planned and will be available...at some point. Definitely not a priority ATM as CSData takes care of attaching and vJass provides dynamical arrays.
 
Level 15
Joined
Jul 19, 2007
Messages
618
hmm did not know that inline does not work btw constant functions are faster no? and even if they are not if they are not constants i can't use them in my constant functions in jass.

SFilip said:
vJass provides dynamical arrays.

not the real ones well i don't need the dynamic arrays like vjass gives me but i want real ones coded in c++ :p

well anyway your custom natives are awesome ^^
 
Level 7
Joined
Nov 12, 2005
Messages
299
> constant functions are faster
No, in fact C(++) does not have "constant functions" that was just the return type being constant.

> if they are not constants i can't use them in my constant functions in jass
Not sure what you're referring to here. You can define your functions as "constant natives" in common.j regardless of how they are defined in C(++), but that won't really change anything.
 
Status
Not open for further replies.
Top