HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Obscure trigger problem.

06-22-2003, 03:55 PM#1
Norbo
Well, Norbo's War v2.4 is unbelievably close to being finished.. and I've got quite a few people yelling at me to finish it every time I log into B.net.. so..

I have one last problem. I know I am just missing something basic, and I'm going to kick myself for it. I took a picture of the trigger body..

My problem is that, when I say "01 give unit" or "12 give unit" it does nothing. Absolutely nothing. I'm aware of the space in the condition where it says "must be equal to ' give unit'", and it isn't the problem...

So, what do you all think?
06-22-2003, 04:49 PM#2
Guest
Have you figured out whether it's a problem with the conditions or the actions? Like if you temporarily deactivate all the action triggers and instead just put a single, "Game - Display to (All players) for 10 seconds the text: @#%!@#%" action, will it show that text string?
06-22-2003, 05:07 PM#3
Guest
I think I may see something that might help. You seem to be asking the player for a two-digit number (e.g. 01) of the player number whom you want to give the unit, but in the first condition, the trigger specifies 3 through 11 - as if you were expecting a single-digit number, or thought that string digits begin counting at zero instead of one. I think you want 4 through 12.

In other words, "01 give unit" spelled out with the substring number for each letter is:
0-1, 1-2, space-3, g-4, i-5, v-6, e-7, space-8, u-9, n-10, i-11, t-12. That's 4-12, not 3-11.

Does 4 through 12 work? I replicated your trigger, and 3-11 did nothing for me either, but 4-12 works.
06-22-2003, 05:13 PM#4
Norbo
Really now! Interesting. I know of that 3-12 substring, I thought it would count that SPACE I put in the mentioned string.. ' give unit'.


I am pretty sure it's a problem with the conditionals. I had it 4-12 and on 'give unit', maybe i'll try the variation. Thanks.
06-22-2003, 05:16 PM#5
Guest
Oops, back to the drawing board. I see you had 3-12 and a space before your "give unit" text. (There is a space there, right?) So that's not it.

I'll let you know if I have any other ideas.


EDIT: Yeah, sorry, I posted this at virtually the exact same time that you responded. I was wrong, a space and then "give unit" should work fine - at least it is in my map. Sorry, I thought I was on to something. :( I'll keep working on it; in the meantime, could you try to verify that it's a problem in the conditions?
06-22-2003, 05:26 PM#6
Dead-Inside
Hmm... Tell me (So I can rewrite your trigger and make it actually work), what do you want to do?
Transfer control? If so, how?

Regards
Dead-Inside
06-22-2003, 05:40 PM#7
Guest
OK. This is idea #2 from me. ;)

I've replicated the trigger with all of its conditions. Every single one seems to check out - I've tested each - except for one: Number of units in (Units currently selected by (Triggering player)) Greater than 0. That condition just seems to stop the entire trigger cold. No matter how many or in what manner I select units, that condition doesn't pass. I'm almost certain that condition is your problem, or at least one of the problems.

Like I said, all of the rest of the conditions work, at least for me. The number comparisons, ally comparisons (I set up a little 2v2 map to check), etc.

I'm going to fiddle around trying to find a workaround now.
06-22-2003, 06:05 PM#8
Guest
I'll take a screenshot and double-check things and have it reposted in a short while. :D

EDIT: Whoops, nevermind that about the screenshot, because I don't have anywhere to upload it to. Anyway, here's the fixed trigger:

Events:
Player: Player 1 (Red) types a message containing give unit as A substring
Conditions:
(Substring((Entered chat string), 3, 12)) Equal to give unit
(Integer((Substring((Entered chat string), 1, 2)))) Greater than 0
(Integer((Substring((Entered chat string), 1, 2)))) Less than 13
(Integer((Substring((Entered chat string), 1, 2)))) Not equal to (Player number of (Triggering player))
((Player((Integer((Substring((Entered chat string), 1, 2)))))) slot status) Equal to Is playing
((Triggering player) is an ally of (Player((Integer((Substring((Entered chat string), 1, 2))))))) Equal to True
Actions:
----- Collect information on the selected units -----
Set UnitsSelected = (Units currently selected by (Triggering player))
----- If no units were selected, display error message and stop trigger -----
If ((UnitsSelected is empty) Equal to True) then do (Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: You must first select the units that are to be given to another player.) else do (Do nothing)
If (UnitsSelected is empty) Equal to True) then do (Skip remaining actions) else do (Do nothing)
----- Reset ownership variable and make sure all the selected units belong to the triggering player - if not, stop trigger -----
Set UnitsBelongToOthers = False
Unit Group - Pick every unit in UnitsSelected and do (If ((Owner of (Picked unit)) Not equal to (Triggering player)) then do (Set UnitsBelongToOthers = True) else do (Do nothing)
If (UnitsBelongToOthers Equal to True) then do (Game - Display to (Player Group((Triggering player))) for 10.00 the text: You may not give away other players' units.) else do (Do nothing)
If (UnitsBelongToOthers Equal to True) then do (Skip remaining actions) else do (Do nothing)
----- If the trigger made it this far, then everything looks OK, so change ownership of the unit(s) -----
Unit Group - Pick every unit in UnitsSelected and do (Unit - Change ownership of (Picked unit) to (Player((Integer((Substring((Entered chat string), 1, 2))))))) and Change color)
Game - Display to (Player group((Triggering player))) for 5.00 seconds the text: Unit(s) have successfully changed ownership.


Notes:
1.) Add the other players' chat messages to the Events list.
2.) Note that the conditions now contains a third number check, this one making sure that the number is not equal to the player who's typing the message. Not necessary, but keeps players from pointlessly giving units to oneself.
3.) As I stated earlier, the unit group condition was bugged and stopping the trigger cold every time for some reason. I don't really know exactly why, but its function has been replicated in the Actions where the unit group is checked to make sure it isn't empty.
4.) Small thing, but the checking to make sure that the unit(s) actually belong to the player typing the message has been redone. It was possible, if players allied, to select both one's own and an ally's units in a group and then, if the old (Random unit in [selected unit group]) statement happened to end up with your own unit and thus check out OK, it would be possible to give away all the units in the group, including the ally's. I assume that was not the intention.
5.) The actions that have to do with player generals have not been included. This is because your graphic cut off the trigger, so I couldn't see what those actions were supposed to be doing. You'll have to re-enter the Generals stuff if you want that functionality to stay in.

If you want the map that I made this test trigger on, I'll e-mail it to you. I think my e-mail is in my profile, or find it on www.geocities.com/brittlesnaparm - I don't want to post it here for fear that spambots will find it.

Good luck. :D
06-22-2003, 06:24 PM#9
Norbo
Dead-Inside, yes. All it does is switch the selected unit(s) to another player (player defined by saying XX give unit).

Interesting.. I've discovered other strange instances of conditions just stopping the trigger, or heck-- dependant variables divides by dependant variables when both are >1 stop the trigger. Must be just a WC3 oddity..

I look forward to that workaround, heh. This small bug is keeping me from releasing 2.4.. and I told the bunch of people following me around I'd be done by saturday, heh.

*EDIT*

Well, rather than adding another superfluous post, I'll just use this one--

Thanks a bunch for your help, I'm gonna try that out. Now those people will stop yelling at me. 0_o
06-22-2003, 06:41 PM#10
Guest
Just to let you know, I edited my post and typed out the finished version of the trigger a couple of posts up - I was going to just leave the edited post, but since you had gotten the last word on the thread, I was afraid you might not scroll up and see it.

Let me know if you have any problems.
06-22-2003, 07:03 PM#11
Dead-Inside
Okay... Look...

Player X types give unit as a substring

Set SelectedUnit = (Units currently selected by (Triggering player))
If ((Triggering player) is an ally of (PlayerNumber(Substring((Entered chat string), 1, 2)))) Equal to True and (Substring((Entered chat string), 3, 12)) Equal to give unit and Units in (SelectedUnit) belongs to player (triggering player) = true do Pick every unit in Selected unit and do (Change ownership of (Picked unit) to (Player((Integer((Substring((Entered chat string), 1, 2))))))) and Change color) else do Display message: "Something"

It couldn't be easier... In one long, tight, action...

Regards
Dead-Inside
06-22-2003, 07:20 PM#12
Norbo
Thanks Dead-Inside, but the other away appears to be working, and allows for easier inclusion of the other functionalities in the trigger.