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

[Crash] GetLocalPlayer() Problem & reals

Status
Not open for further replies.
There seems to be an issue here with GetLocalPlayer()?

[trigger=]
smartcast kick
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Pass me!
Actions
Set playerd = (Owner of (Triggering unit))
Set mousex[0] = 9.00
Set mousey[0] = 9.00
Custom script: if GetLocalPlayer() == udg_playerd then
Custom script: set udg_mousex[0] = GetMouseX()
Custom script: set udg_mousey[0] = GetMouseY()
Custom script: endif
Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Human Mortar Team - Flare (Point(mousex[0], mousey[0]))
[/trigger]

Though this works.
[jass=]
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, R2S(GetMouseX()) + ", " + R2S(GetMouseY()))
[/code]

Could someone show me how to change it into something that doesn't disconnect others?

Edit: Maybe I posted in the wrong section... Though I really don't know how to make something like this besides a basic copy of what I saw.
 
Last edited:

Deleted member 219079

D

Deleted member 219079

Last edited by a moderator:
You need to sync the mouse location.

[vJASS] - SyncInteger
[vJASS] - Sync (Game Cache)

Edit: I think that Point(...) generates location, you need to remove it.

Edit 2: Alternatively you can cover the whole map in trackables. (Edit: Found nice GUI trackable tutorial: Trackables)

Not really, it isn't run enough times for lag to be a problem with that location leak. Focused more on why one example works while the other doesn't work, is it because it is just a string and the other actually interacts with the game?

Trackables will be the alternative when memory hack gets destroyed by Blizzard, just until then it is nice to be able to click/use orders anywhere on the map and the clicks still work unlike with trackables that still to this day can't even detect right/left clicks. Funny that with memory hack you might be able to move a trackable.

Edit: The first two links you posted for sync'ing are only for integers aren't they?
 

Deleted member 219079

D

Deleted member 219079

What, you're trying to justify a leak? :D

Yes, but you still need to sync the coordinates like I said.

No. Even if they were you could cast the real into integer.
 
you can't really do that, sync requires much more time than you think. sending custom packets yet to be secured, so this game principle (using mouse pos for gameplay) barely possible
So much for memory hack making use of mouse then... =(

Guess I could use trackables with a height-grid or a copy of a playing area if this really doesn't work.
 

Deleted member 219079

D

Deleted member 219079

Wouldn't the decimals be lost?
Accessing memory from the script - it's time of the revolution

Given //! runtextmacro TYPECAST_NEW ("real","R2IEx","I2REx")

JASS:
struct S
    static method onInit takes nothing returns nothing
        local real original = 3.14159
        local integer cast = R2IEx(original)
        local real result = I2REx(cast)
        call BJDebugMsg("original: " + R2S(original) /*
            */ + "; result: " + R2S(result))
    endmethod
endstruct
Gives same number.
 
Probably not fastest, but for such rare calls it would be okay: ObserverMode and PlayerCameraData

Though, are you sure you do not wanna get simply the X/Y of the issued spell point? There is SpellTargetX() and SpellTargetY() for it.

I was working on making a type of smart cast system for a friend for the map he is currently editing. To smart cast is to just press the ability or key and the ability points to the direction of where the mouse cursor is.

Edit: However I have spotted another cool feature in memory hack and that might be the ability to finally move a trackable, really hope that doesn't somehow require sync'ing as well... Edit2: Might actually be fine to sync since I doubt people would seriously try to toggle it on/off a lot.
 
thats where custom net packets will be useful, but that far away from gui level of understanding

Just because I use JASS/GUI doesn't mean I can't learn to understand what you can. Is it a feature still hidden/locked away in memory that hasn't been found or made into a function or just no documentation on it yet?
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
Just because I use JASS/GUI doesn't mean I can't learn to understand what you can. Is it a feature still hidden/locked away in memory that hasn't been found or made into a function or just no documentation on it yet?
I only mean you have to be really into it to find a way to confirm they aren't fake (from any hacker for instance). there is packet sender in the lib already, yet I didnt bothered with it, due to mentioned reason.
 
I only mean you have to be really into it to find a way to confirm they aren't fake (from any hacker for instance). there is packet sender in the lib already, yet I didnt bothered with it, due to mentioned reason.

Ah, okay. Thanks =)

Could I ask if you know about moving trackables, do those functions actually work?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
The idea of syncing mouse coordinates does work and is what StarCraft II/Heroes of the Storm does. It does have latency though however that latency need not be that bad. Just the way WC3 implements sync as well as other factors might result in very bad latency.
 
Status
Not open for further replies.
Top