1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Camera Zoom

Discussion in 'World Editor Help Zone' started by Illidan_Hunter, Jul 5, 2012.

  1. Illidan_Hunter

    Illidan_Hunter

    Joined:
    Dec 22, 2008
    Messages:
    479
    Resources:
    0
    Resources:
    0
    My trigger:
    • Camera - Set (Triggering player)'s camera Distance to target to (((Real((Entered chat string))) / 100.00) x 1650.00) over 1.00 seconds


    I want to set the camera to the % of the chat string I enter. For example, if I type '-cam 120' the zoom will be set to 120% of the standard W3 camera. Any ideeas how to do this?
     
  2. NarGalloth

    NarGalloth

    Joined:
    Apr 19, 2011
    Messages:
    441
    Resources:
    0
    Resources:
    0
    I don't know if it's possible to make that. However, you could try this event:

    • Player - Player 1 (red) types a chat message containing (-cam + (String(NUMBER))) as An exact match


    In the action you posted, change [Entered chat string] for NUMBER. (A real variable, call it however you want)

    In "NUMBER" you can write 120, 140, 160... whatever you want. I didn't try if it works, but I suppose that if you create some triggers with this, you could make the player able to zoom the camera to several different zooms. Then, you could send a message to the player and inform him about the different zooms he can set.
    I don't know if this can be made in order to accept any number you write, maybe others can help you with that.

    I hope this helped.

    Regards
     
  3. Mcasdf

    Mcasdf

    Joined:
    May 13, 2009
    Messages:
    248
    Resources:
    0
    Resources:
    0
    Use substring, it checks if "-cam" is in the message
    Player - Player 1 (Red) types a chat message containing -cam as A substring

    The condition is that the 4 first characters are exactly "-cam"
    (Substring((Entered chat string), 1, 4)) Equal to -cam

    Then set the variable to everything after: (5th char is a space so we skip it)
    Set variable = Real( substring((Entered chat string), 6, 100) )

    :)
     
  4. Illidan_Hunter

    Illidan_Hunter

    Joined:
    Dec 22, 2008
    Messages:
    479
    Resources:
    0
    Resources:
    0
    Thank you for your assist, Mcasdf. This helped me understand the subtrings function as well as fixing my trigger. I will add you to the credit list.

    Thread can be closed.