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

Zoom {zoom command, for example "-zoom 600"}

Status
Not open for further replies.
Level 28
Joined
Jan 26, 2007
Messages
4,789
Congratulations, you are the 5th person who said this and the 5th person I gave this system :cute:


  • CamZ
    • Events
      • Player - Player 1 (Red) types a chat message containing -Zoom as A substring
      • Player - Player 2 (Blue) types a chat message containing -Zoom as A substring
      • Player - Player 3 (Teal) types a chat message containing -Zoom as A substring
      • Player - Player 4 (Purple) types a chat message containing -Zoom as A substring
      • Player - Player 5 (Yellow) types a chat message containing -Zoom as A substring
      • Player - Player 6 (Orange) types a chat message containing -Zoom as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, (Length of (Entered chat String)))) Equal to Empty String
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • Set Camera_Distance = (Real((Substring((Entered chat string), 7, (Length of (Entered chat String))))))
      • Camera - Set (Triggering player)'s camera Distance to target to Camera_Distance over 0.20 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Camera_Distance Greater than or equal to 3000.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Distance to target to 3000.00 over 0.20 seconds
          • Set Camera_Distance = 3000.00
          • Game - Display to (All players matching ((Triggering player) Equal to (Matching player))) for 6.00 seconds the text: |c00ff0000Zoomed ou...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Camera_Distance Less than or equal to 500.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Distance to target to 500.00 over 0.20 seconds
          • Set Camera_Distance = 500.00
          • Game - Display to (All players matching ((Triggering player) Equal to (Matching player))) for 6.00 seconds the text: |c00ff0000Zoomed in...
        • Else - Actions
Example:
"-Zoom 2600" will set the camera distance to 2600

Min = 500
Max = 3000
If you break these limits (like -zoom 8000), it will automatically be set to the limit (in this case 3000).

This is one of the triggers in my map DoomRaiders ORPG (open source, you can check it in my signature... but this is one of the best triggers in it, though, apart from my anti-swear system).

I think this is a pretty easy trigger... so it should also be easy to modify, but if you still can't get it work, I'll help you out.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
alright i just need the zoom from like 200 to 1000

Check the trigger and try to understand it.
Instead of blindly copy/pasting triggers that other people give you, try to learn something from them ^^

It really isn't a hard trigger and it's very obvious how you can change the min/max zoom.
If you really have no idea, then I'll tell you, but you will probably say "aww, that was obvious".
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
how do i set camera_distance?

It's a variable
To set variables, open the trigger editor, press the yellow 'X' (on top of the screen), when you have opened the Variable Editor, click on the green X and insert these settings:

Variable Name: Camera_Distance
Variable Type: Real
No array

Then press "Ok" and you can set it like I did in my trigger ;)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
and what is (Real((Substring((Entered chat string), 7, (Length of (Entered chat String))))))

I'll try to explain this step by step...



So, you have the if/then/else-action, click on "New Condition" for it and then do:

  1. In the condition, click "Real Comparison"
  2. Click on the first data you can change and select "Conversion - Convert String to Real"
  3. The standard should be "Real(Entered Chat String)", instead of the "Entered Chat String", select "Substring"
  4. Now you should see this: "Substring(String, 1, 5)" if you don't, retrace the steps until you see it.
  5. Replace the "String" with "Event Response - Entered Chat String".
  6. Replace the first number (1) with 7
  7. Replace the second number with "String Length" (it should automatically be set to "String Length of (Entered Chat String)".
  8. Click on "Ok" everywhere you can until you're back in the normal trigger-screen and there it is! the function you want.
This function checks the entered string (for example -zoom 805) from the 7th character ( = 8) until the last character ( = 5).
So it reads this: "-zoom 805"
get the point? ;)
 
Level 2
Joined
Apr 22, 2008
Messages
14
Set the condition to "String Comparison" and click on the red data (the 'incorrect data').
After you've clicked on it, simply press Enter (don't do anything else), then it'll be an empty string.

ummm but i needed it for the previous question in the real comparison
i cant put the empty string in the real comparison
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
There is no empty string in the real comparison...

If you mean this: "(Substring((Entered chat string), 7, (Length of (Entered chat String)))) Equal to Empty String".
Then it's the same as the real comparison, but you start with a String Comparison (it doesn't have a "Real" in front of it, that's how you can see it).
Set the "greater than or equal to" to "equal to" and set the empty string as I've said in my previous post...
 
Level 2
Joined
Apr 22, 2008
Messages
14
"Set Camera_Distance = (Real((Substring((Entered chat string), 7, (Length of (Entered chat String))))))"

i set the camera_distance but how do i put (Real((Substring((Entered chat string), 7, (Length of (Entered chat String)))))) as my value?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789

So, you have the if/then/else-action, click on "New Condition" for it and then do:

  1. In the condition, click "Real Comparison"
  2. Click on the first data you can change and select "Conversion - Convert String to Real"
  3. The standard should be "Real(Entered Chat String)", instead of the "Entered Chat String", select "Substring"
  4. Now you should see this: "Substring(String, 1, 5)" if you don't, retrace the steps until you see it.
  5. Replace the "String" with "Event Response - Entered Chat String".
  6. Replace the first number (1) with 7
  7. Replace the second number with "String Length" (it should automatically be set to "String Length of (Entered Chat String)".
  8. Click on "Ok" everywhere you can until you're back in the normal trigger-screen and there it is! the function you want.

The only thing you need to change in this quote is the first step, just ignore it and start with the second step.
 
Level 2
Joined
Apr 22, 2008
Messages
14
alright thank you a lot
time to test to see if it works

{EDIT}
it works!! thanks
 
Last edited by a moderator:
Status
Not open for further replies.
Top