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

[Solved] Some problems...

Status
Not open for further replies.
Level 7
Joined
Mar 5, 2009
Messages
254
Hello guys,

Problem 1 :
i've been trying to make a command where when the player types -zoom 500 or zoom 1500 as a substring for example it will set the player's camera field of view to the entered chat string With should be 500 or 1500 in the other case.I made this trigger,but it really doesn't work,it just sets the camera field of view always to something like 100 no matter what i type.Any ideas how to fix it ? :eekani:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -zoom as A substring
    • Conditions
    • Actions
      • Camera - Set Player 1 (Red)'s camera Field of view to (Real((Entered chat string))) over 2.00 seconds
Problem 2 : I've seen in some rpgs when you type -save and the code is saved to a .txt file in your wc3 folder,does anyone know how can i do this?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
it's a substring, not the whole entered chat string.

- ' 1
z ' 2
o ' 3
o ' 4
m ' 5
' 6
x <- Here goes the zoom value '7
x ' 8
x ' 9
x ' 10

"So, it's Real Substring (7, 10)" so it takes values from 7th character to 10th character.

You can check if the Substring(7,10) is higher than 1500, set it to 1500. If it types 0000, set it to 500, so you can have minimum and maximum values.
 
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -zoom as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 6) Equal to -zoom
    • Actions
      • Camera - Set Player 1 (Red)'s camera Field of view to (Real(Substring(Entered chat string), 7, (Length of (Entered chat string))) over 2.00 seconds
String comparison "-zoom " has a space after the word "-zoom".
You would want to use Camera's Distance to Target instead of Field of View.

Edit: Thought Spartipilo was the one asking and he in fact replied ;p
 
Status
Not open for further replies.
Top