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

Camera Bounds

Status
Not open for further replies.
Level 9
Joined
Jan 3, 2010
Messages
359
i've created this trigger:
  • Events
    • Every 0.50 seconds of game-time
  • Conditions
  • Actions
    • set point = Position of (hero)
    • set rect = rect centered at (point) width 2000 height 2000
    • Camera - set camera bound for (player 1) to (rect)
    • Custom Script - call RemoveLocation(udg_point)
    • Custom Script - call RemoveRect(udg_rect)
but it always crashes the game, whats wrong with it ?
 
It doesn't crash for me, but I guess it's because the camera bounds stack with the preset boundaries of the map, causing the game to crash. You might want to create a preset Region and use "Region - Move region" action instead. In case that crash still occurs, you will need some maths to get the MinX/Y and MaxX/Y of your region to make a check if they are stacking with the respective values of the Playable Map Area rect.
 
Level 9
Joined
Jan 3, 2010
Messages
359
It doesn't crash for me, but I guess it's because the camera bounds stack with the preset boundaries of the map, causing the game to crash. You might want to create a preset Region and use "Region - Move region" action instead. In case that crash still occurs, you will need some maths to get the MinX/Y and MaxX/Y of your region to make a check if they are stacking with the respective values of the Playable Map Area rect.

is that so ?
oh yeah, maybe locked camera affect the camera bounds ?
i used this :
  • Events
    • every 0.1 seconds
  • Conditions
  • Actions
    • lock camera target to (hero)
    • set camera distance to target to 1000
    • set camera rotation to 180
 
Camera - Lock camera target doesn't need to be implemented within a trigger that runs periodically. Using it once will retain the lock effect. The periodic trigger will be used for the distance to target, for the angle of attack (prevents mouse wheel to affect the camera's angle) and the rotation (for the unit's facing).
Locked camera is a better solution than the one you tried before.
 
Level 9
Joined
Jan 3, 2010
Messages
359
Camera - Lock camera target doesn't need to be implemented within a trigger that runs periodically. Using it once will retain the lock effect. The periodic trigger will be used for the distance to target, for the angle of attack (prevents mouse wheel to affect the camera's angle) and the rotation (for the unit's facing).
Locked camera is a better solution than the one you tried before.

hmm ..
still crashes :'(

but when i changed the width and height of the rect to maximum of 1000, it doesn't crash ....
weird ....
 
Status
Not open for further replies.
Top