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

Creating a Camera System

Status
Not open for further replies.
Greetings, I'm trying to create a camera system, but I might need some help developing it.
The point of it is that it allows collecting X / Y data of the players camera, which can easily help creating a on-screen inventory system. ( Hopefully )

I am currently creating it in GUI, but still both Jass and GUI are welcome here, anyhow I do not allow vJass, DGUI, zinc or any similiar things in here.

If you are interested of helping me out with this, you can post suggestions, feedback and thelike to this thread ( or via Visitor Message ), so that I can update the script itself.

First template will come either today or tomorrow, be patient.
 
Last edited:
<<UPDATE TO SYSTEM>>
[hidden="Reveal Update]
  • Template INI
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ## Switch. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CCS_eMainIndex Equal to 0
        • Then - Actions
          • -------- [ ] --------
          • Trigger - Turn on Template ACT <gen>
          • -------- [ ] --------
        • Else - Actions
      • -------- ## Let's create the cameras. --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • -------- [ ] --------
          • Set CCS_eMainIndex = (CCS_eMainIndex + 1)
          • Set CCS_eIndex = (CCS_eIndex + 1)
          • Custom script: set udg_CCS_oCamera[ udg_CCS_eIndex ] = CreateCameraSetup()
          • Custom script: set udg_CCS_oPosX[ udg_CCS_eIndex ] = CameraSetupGetDestPositionX( udg_CCS_oCamera[ udg_CCS_eIndex ] )
          • Custom script: set udg_CCS_oPosY[ udg_CCS_eIndex ] = CameraSetupGetDestPositionY( udg_CCS_oCamera[ udg_CCS_eIndex ] )
          • -------- [ ] --------
  • Template ACT
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- [ ] --------
      • Custom script: local real oCamX = 0
      • Custom script: local real oCamY = 0
      • For each (Integer CCS) from 1 to CCS_eIndex, do (Actions)
        • Loop - Actions
          • -------- [ ] --------
          • Set CCS_tPoint[0] = (Target of (Current camera))
          • Set CCS_tPoint[1] = (Target of CCS_oCamera[CCS])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (X of CCS_tPoint[0]) Not equal to (X of CCS_tPoint[1])
            • Then - Actions
              • Set CCS_oPosX[CCS] = (X of CCS_tPoint[0])
            • Else - Actions
          • -------- [ ] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Y of CCS_tPoint[0]) Not equal to (Y of CCS_tPoint[1])
            • Then - Actions
              • Set CCS_oPosY[CCS] = (Y of CCS_tPoint[0])
            • Else - Actions
          • -------- [ ] --------
          • Custom script: call RemoveLocation( udg_CCS_tPoint[0] )
          • Custom script: call RemoveLocation( udg_CCS_tPoint[1] )
          • Custom script: call CameraSetupSetDestPosition( udg_CCS_oCamera[ udg_CCS ], udg_CCS_oPosX[ udg_CCS ], udg_CCS_oPosY[ udg_CCS ], 1 )
      • -------- [ ] --------
Yes, I am fully aware that the system uses local player content, yet I'm going to make it MPI.[/hidden]
 
Well, this system does not function like 90% of the others, infact, it could be 100% different than any in the internet already.
Currently I am rewriting the actual system to Jass, so that it can be used as a single-liner.

Infact, after I started to develop this, I couldn't call it much of a "Camera System", as it mostly just returns data from the player's camera, it does not move or enchant the camera itself.
Though, objects can be placed on the screen, and that works rather easily.
Once I find a way to function the units without causing a desync, this system is ready to go.
 
Are you sure about that ?
Also, this thread is quite becoming a discussion between us two at this moment, might want to continue on either VM or PM.

But, it should be possible if you for examble~ Use GetLocalPlayer() to make sure the unit is the local players ? The only issue atm is using functions to move a unit, or do anything with a unit with local content. Displaying the data for each player does not cause a desync.

I believe if you can make a condition to check if the unit is owned by the local player, it should not cause a Desync.
As I am new with Local Player, here is just a examble of how it could work, it might not work.
JASS:
function checkUnitForLocalPlayer takes unit oUnit returns unit
local player oLocalPlayer2 = GetOwningPlayer( oUnit )
if ( GetLocalPlayer() == oLocalPlayer2 ) then
return null
else
return oUnit
endif
endfunction
// Yes, this most likely would create a Desync.
// Infact, it would create a Desync.

EDIT: Hmm, yes, I do now see why it is Impossible, but, I will research this no matter what.
 
<< UPDATE >>
- Stable Version is out.
- Supports MPI.

  • Template INI
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ## Switch. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CCS_eMainIndex Equal to 0
        • Then - Actions
          • -------- [ ] --------
          • Trigger - Turn on Template ACT <gen>
          • -------- [ ] --------
        • Else - Actions
      • -------- ## Let's create the cameras. --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • -------- [ ] --------
          • Set CCS_eMainIndex = (CCS_eMainIndex + 1)
          • Set CCS_eIndex = (CCS_eIndex + 1)
          • Custom script: set udg_CCS_oCamera[ udg_CCS_eIndex ] = CreateCameraSetup()
          • Custom script: set udg_CCS_oPosX[ udg_CCS_eIndex ] = CameraSetupGetDestPositionX( udg_CCS_oCamera[ udg_CCS_eIndex ] )
          • Custom script: set udg_CCS_oPosY[ udg_CCS_eIndex ] = CameraSetupGetDestPositionY( udg_CCS_oCamera[ udg_CCS_eIndex ] )
          • Set CCS_tPoint[0] = (Center of (Playable map area))
          • Destructible - Create a Summer Tree Wall at CCS_tPoint[CCS_eIndex] facing (Random angle) with scale 1.00 and variation 0
          • Set CCS_oDummy[CCS_eIndex] = (Last created destructible)
          • Custom script: call RemoveLocation( udg_CCS_tPoint[0] )
          • -------- [ ] --------
  • Template ACT
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- [ ] --------
      • Custom script: local real oCamX = 0
      • Custom script: local real oCamY = 0
      • For each (Integer CCS) from 1 to CCS_eIndex, do (Actions)
        • Loop - Actions
          • -------- [ ] --------
          • Cinematic - Clear the screen of text messages for (All players)
          • Camera - Set Player 1 (Red)'s camera Distance to target to 3000.00 over 0.00 seconds
          • Game - Display to (All players) the text: «ScreenDataCollect...
          • Game - Display to (All players) the text: ( ± Screen X ~ + (String(CCS_oPosX[CCS])))
          • Game - Display to (All players) the text: ( ± Screen Y ~ + (String(CCS_oPosY[CCS])))
          • -------- [ ] --------
          • Set CCS_tPoint[0] = (Target of (Current camera))
          • Set CCS_tPoint[1] = (Target of CCS_oCamera[CCS])
          • -------- [ ] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (X of CCS_tPoint[0]) Not equal to (X of CCS_tPoint[1])
            • Then - Actions
              • -------- [ ] --------
              • Set CCS_oPosX[CCS] = (X of CCS_tPoint[0])
              • -------- [ ] --------
            • Else - Actions
          • -------- [ ] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Y of CCS_tPoint[0]) Not equal to (Y of CCS_tPoint[1])
            • Then - Actions
              • -------- [ ] --------
              • Set CCS_oPosY[CCS] = (Y of CCS_tPoint[0])
              • -------- [ ] --------
            • Else - Actions
          • -------- [ ] --------
          • -------- [ MPI Test ] --------
          • Destructible - Remove CCS_oDummy[CCS]
          • Set CCS_oDummy[CCS] = No destructible
          • Custom script: set udg_CCS_oDummy[ udg_CCS ] = CreateDestructableZ( 'B000', udg_CCS_oPosX[ udg_CCS ], udg_CCS_oPosY[ udg_CCS ], 1000, 90, 1, 0 )
          • -------- [ ] --------
          • Custom script: call RemoveLocation( udg_CCS_tPoint[0] )
          • Custom script: call RemoveLocation( udg_CCS_tPoint[1] )
          • Custom script: call CameraSetupSetDestPosition( udg_CCS_oCamera[ udg_CCS ], udg_CCS_oPosX[ udg_CCS ], udg_CCS_oPosY[ udg_CCS ], 1 )
      • -------- [ ] --------
 
Status
Not open for further replies.
Top