| 09-28-2002, 04:30 AM | #1 |
Guest | Im trying to make a trigger that will give the player total control over the Camera View: Angle of Attack. I want a trigger so that whenever a player types AOA (Number between 1 and 360) It will set the angle of attack to the number between 1 and 360 that they typed. I'm pretty sure that I figured out the event, that seemed simple, But my problem is that i cant figure out how to set my Real Variable AOA to the number written by the player after he/she writes AOA. (theres a periodic trigger that will set the angle of attack to the variable AOA by the way) Any help is greatly appreciated, thx in advance |
| 09-28-2002, 01:53 PM | #2 |
Ummm, it shouldn't be too hard. Here are the steps you will need to take. 1. Use an event(Multiple events for each additional player) that responds if the chat message contains "AOA". 2. Then have the ChatMsg stored into a varaible String. 3. Then use a parser to get the number. Using the parser have it pull the second group of stuff being the number the User wanted the AOA to be. 4. Then store it into an integer using S2I (this converts a string to an string into Integer) 5. Using the appropriate Function all you will have to do is have the integer put into that function and WAmmy. Done I have developed most of the stuff above for my Commander. So if you need anymore help or Basicly the required Scripting just ask. Good Luck. :D |
| 09-28-2002, 07:22 PM | #3 |
Guest | Thanks for the help, but I still have a couple questions... 1. Whats a parser? 2. And how will I make sure that the trigger only takes place if the number after AOA is between 0 and 360? (im thinking a second event: Player 1 - (Red) types a chat message containing (String(Random integer number between 0 and 360)) as A substring. , but im not positive that would work ) |
| 09-28-2002, 07:50 PM | #4 | ||
Guest | Quote:
Quote:
Well, that would choose a random number and then compare it to the string. So if they typed 87 and the random number chosen was 234 it wouldn't match. You have to first get the number out of the string, and then do integer comparisons to see if its greater than or equal to 0 and less than or equal to 360. But.... AOA can actually only be 270-360 anyway. 180-270 is upside down, 0-180 would be "underground" in most cases and is not accepted in game. |
| 09-29-2002, 09:06 AM | #5 |
Guest | excuse my newbiness, but what action uses a parser? could someone write out the trigger so i can understand this? im lookin around like mad for this parser thing sorry |
| 09-29-2002, 09:20 AM | #6 |
yes... can anyone teach us how to make a string parser... coz it's darn difficult... perhaps any built-in function ? i need a parser that can remove for instance : "list" from the chat string "list command"... so i can have "command" as another string instead of "list command' |
| 09-30-2002, 12:52 AM | #7 | |
Guest | Quote:
|
| 09-30-2002, 02:41 AM | #8 |
what if i wanna do some string function like : adding or subtracting substrings like String1 - "list" or "list" + String1 ? |
| 09-30-2002, 03:12 AM | #9 | |
Guest | Quote:
i cant find a way to use the substring function to extract the second substring (after AOA) so thats why im still going crazy trying to figure out how to do this trigger. if i find out how to do this I'll post the trigger |
