| 11-04-2003, 05:44 PM | #1 |
Im trying to make a text-based command line type trigger for creating units (amoung other things). What I want to do is make it so that you can enter any unit type and store it in a variable. This variable string would then be used to create the unit in question and the number of units desired to be created. For example, to give peasant a new variable and then create 4 peasants you would write(";" and ";;" enable and disable commands): ";" "peasant(x)" "x(4)" ";;" Another way to look at it would be this: ";" "unitname(shortcut) "shortcut(amountspawned) ";;" The problem is that I don't know how to make it accept any unit-type, allow any numbers, or allow any variables. I have made string variables but the string event will not allow me to use any variables because "no variables of this type exist." Help on any of these issues, or things that I have not meantioned but may come up, would be greatly appreciated. Thank you. :hammer: For a little background, I'm making this trigger for a "God's Land" level. Hold your stones, allow me to explain! I plan on using completly original material and maping. Here is a list of the currently planned features: -easy, efficient, non-processor expensive "God" commands -conditions or time limit that strip "God" of his powers, clear the old values, set to "new round" conditions, and start a player(s) vs god battle in a smaller melee map, winner becomes god -better spawn point method -possibly some type of cinematic for god switching etc -possibly different modes of " God" play PS: Does anyone know how to make a completely, or nearly, invisible unit, whats worked best for you? |
| 11-04-2003, 05:55 PM | #2 | |
Quote:
Just make it a If "text" typed as an exact match of "text" then create "unit" for triggering player. Ok it will need a little work, but that sould allow you to create all of the units you want. Another option would be to have a menu window popup and let the user pick different units and ammounts. This could also be accessable through a trigger like above, and will look very proffesional. IDISacredIDI Not sure this will help, but its another way of looking at your problem without variables. |
| 11-04-2003, 05:59 PM | #3 |
well you could make it so a command is executed with the semicolon turning it on... that aprt is easy event: entered chat string matches exactly ";" action: if triggering player = player 1 red then enable trigger "unitcreatered" else do nothing if triggering player = player 2 blue then enable trigger "unitcreateblue" .... etc event: chat message entered contains "number" as a substring action: set variable n=(convert string to integer(substring 8,9) unitcreatered event: chat message entered contains "create" as a substring action: create "n" of type convert string to unit type(substring 8,25) for player 1 red at ... wherever turn off this trigger this should work out. You need a create trigger for each palyer, only one number subtring trigger, and one enabling trigger.... so if I typed: ; that would turn on my create function then i typed: number 7 that would set n = 7 then I type: create peasant that would create 7 peasants for me at the given point. I hope this works out for you and helps. |
| 11-04-2003, 06:02 PM | #4 |
better add a "cooldown" for the create trigger, or u could get seriously "hurt" that way :) just add a turn off this trigger; wait 10 sec; turn on this trigger :) |
| 11-04-2003, 06:12 PM | #5 |
it already automatically turns itself off when you are done.... not sure what you mean |
| 11-04-2003, 06:17 PM | #6 |
well, imagine that the map is finished, and we're playing it :) so, if u'r a slow-typer (u type really slow) and me typing really fast, like 100 words in a min, who do you think would win... u would type that "spawn 10 footman" 5 times, while i'd type it 15 times... just an example :) |
| 11-04-2003, 06:19 PM | #7 |
Thanks for the quick replies people, got them 5 minutes after I made this post. I'll look into the different possiblilities for the trigger. Oh, and when you talk about menus, are you talking about the simple buttons or some type of custom menu with "scroll" buttons for increasing number? And about the cooldown, should I do some type of number limit and wait time? The point of the tournament or point system for detirmining who becomes god was to weed out the ignorant and unskilled gods, including those without typing skills. Also, does anyone know how to set players to hide text from everyone (I also wanted to include a command for hiding all the text entered in command mode from all non-god players, then of course reset to the normal value once command mode is disabled, this would prevent annoying chat switching for god and allow for a faster game)? How exactly do substrings work? |
| 11-04-2003, 11:58 PM | #8 |
Substrings are pieces of a string... the numbers in a substring corespond to the space in the string. so substing(10,12) is characters 10-12, including spaces... |
