wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-07-2009, 05:26 PM   #1
Tot
6
 
Tot's Avatar
 
Join Date: Oct 2008
Posts: 841

Tot will become famous soon enough (53)Tot will become famous soon enough (53)

Default how to get the rect a player is currently viewing?

I need a method to get the rect a player is currently viewing

something like:
Collapse JASS:
function GetPlayerCurrentView takes player p returns rect
     local rect r
     //!!INSERT BRAIN HERE!!
     return r
endfunction

bye
__________________
Current Projects:
  • Masters Of WarCraft: Some mixture of AoS and RPG
    Terrain: 100%, Coding: 75%, Heroes: 0%, Items: 0%, Creeps: 0%, Upgrades: 0%
  • hunting emos
____________________________________
scheiss kack dreck sausacksau bundeswehr
Tot is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-07-2009, 06:28 PM   #2
Seshiro
User
 
Seshiro's Avatar
 
Join Date: Aug 2008
Posts: 158

Submissions (1)

Seshiro is on a distinguished road (20)

Default

Only possible with RTC natives afaik
Seshiro is offline   Reply With Quote
Old 12-07-2009, 06:39 PM   #3
Tot
6
 
Tot's Avatar
 
Join Date: Oct 2008
Posts: 841

Tot will become famous soon enough (53)Tot will become famous soon enough (53)

Default

I thaught it's possible with GetCameraTarget(), GetCameraEye(), GetCameraField(), I'm only too stupid to do it.
__________________
Current Projects:
  • Masters Of WarCraft: Some mixture of AoS and RPG
    Terrain: 100%, Coding: 75%, Heroes: 0%, Items: 0%, Creeps: 0%, Upgrades: 0%
  • hunting emos
____________________________________
scheiss kack dreck sausacksau bundeswehr
Tot is offline   Reply With Quote
Old 12-07-2009, 06:46 PM   #4
DioD
obey
 
DioD's Avatar
 
Join Date: Feb 2006
Posts: 1,532

Submissions (4)

DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)

Send a message via ICQ to DioD
Default

its possible but data will be async only (cannot be used in multiplayer)
DioD is offline   Reply With Quote
Old 12-07-2009, 06:50 PM   #5
Tot
6
 
Tot's Avatar
 
Join Date: Oct 2008
Posts: 841

Tot will become famous soon enough (53)Tot will become famous soon enough (53)

Default

Quote:
Originally Posted by DioD
its possible but data will be async only (cannot be used in multiplayer)

f***
__________________
Current Projects:
  • Masters Of WarCraft: Some mixture of AoS and RPG
    Terrain: 100%, Coding: 75%, Heroes: 0%, Items: 0%, Creeps: 0%, Upgrades: 0%
  • hunting emos
____________________________________
scheiss kack dreck sausacksau bundeswehr
Tot is offline   Reply With Quote
Old 12-07-2009, 06:55 PM   #6
DioD
obey
 
DioD's Avatar
 
Join Date: Feb 2006
Posts: 1,532

Submissions (4)

DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)

Send a message via ICQ to DioD
Default

you always can play with sync, there is at least 3 systems to sync data, 1 have major chance of malfunction, 1 have delay and one uses units selections and interrupt controls.
DioD is offline   Reply With Quote
Old 12-08-2009, 08:48 AM   #7
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Collapse JASS:
function getPlayerCameraRect takes player p returns rect
    local real minX   = 0.
    local real maxY   = 0.
    local real minY   = 0.
    local real maxY   = 0.
    local real curX   = 0.
    local real curY   = 0.
    local real curZ   = 0.

    if GetLocalPlayer() == p then
        set curX = GetCameraTargetPositionX()
        set curY = GetCameraTargetPositionY()
        set curZ = GetCameraTargetPositionZ()
        set minX = curX - curZ / 2
        set maxY = curX + curZ / 2
        set minY = curY - curZ / 2
        set maxY = curY + curZ / 2
    endif
    
    return Rect(minX, minY, maxX, maxY) 
endfunction
That would be the function. I don't know if it would cause desync, I just made it in a minute.

Can someone test my code? I don't remember if it was like that.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 12-08-2009 at 02:05 PM.
Anachron is offline   Reply With Quote
Old 12-08-2009, 09:18 AM   #8
Viikuna-
User
 
Viikuna-'s Avatar
 
Join Date: Feb 2009
Posts: 203

Viikuna- will become famous soon enough (44)Viikuna- will become famous soon enough (44)

Default

Well, you can get that rect and its no problem, but the thing is that syncing that data is slow, so it kinda limits its usability to asynchronous stuff.

You can still use it for asynchronous stuff, though. Like Opossum does in his RegionalFog -fog system thingy, for example.
__________________
No Marlo, no game.
Viikuna- is offline   Reply With Quote
Old 12-08-2009, 09:23 AM   #9
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Hmm, so what about my function? Will it return the correct value and will it desync?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 12-08-2009, 09:54 AM   #10
DioD
obey
 
DioD's Avatar
 
Join Date: Feb 2006
Posts: 1,532

Submissions (4)

DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)

Send a message via ICQ to DioD
Default

damn stupid question...

all players expect one wont create handle, will this desync?
DioD is offline   Reply With Quote
Old 12-08-2009, 02:05 PM   #11
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Hm so now?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 12-08-2009, 04:10 PM   #12
Viikuna-
User
 
Viikuna-'s Avatar
 
Join Date: Feb 2009
Posts: 203

Viikuna- will become famous soon enough (44)Viikuna- will become famous soon enough (44)

Default

Well, it kinda depends.

Some handles are asynchronous, others are not. Create texttag for one player and it works, do same thing with unit and you desync.
__________________
No Marlo, no game.

Last edited by Viikuna- : 12-08-2009 at 04:11 PM.
Viikuna- is offline   Reply With Quote
Old 12-08-2009, 04:15 PM   #13
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Hmm I see. I wonder if blizzard could fix it?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 12-08-2009, 04:15 PM   #14
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

That would desync in the case of you doing anything with the rect that requires sync'd data. For instance, enumerating units in the rect or spawning something in the rect. If that rect were only handled via asynchronous actions, it'd work fine.
__________________
Rising_Dusk is offline   Reply With Quote
Old 12-08-2009, 04:18 PM   #15
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

I now officially hate blizzard.

Edit: To stay on topic:
What actions are asynchronous?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 12-08-2009 at 04:18 PM.
Anachron is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 07:40 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2020, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services