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

Malfunction?

Status
Not open for further replies.
I'm using a trigger which gives EXP based on the point value of the killed unit. It works for all units except for one, for whatever reason.
Whenever the barbarian chieftain is killed, the player recieves an odd amount of levels. It doesn't actually seem to give any particular set amount; sometimes a jump from level 3 to 13, sometimes a jump from level 5 to 9, but either way, it's not working properly with this unit. I've checked the unit's point value, and it is not even high enough to constitute 1/5 of a level. I've also checked and re-checked my trigger. Does anyone know what could possibly have gone wrong?

And as for the unit, I have triple-checked its point value, which is 60. The amount of EXP required for such jumps caused by some sort of error would require thousands of EXP.
What's even weirder is, it shows the correct amount in the floating text which I've put into the trigger, even when it gives the incorrect amount of EXP...

  • Kills
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Set tempPoint = (Position of (Triggering unit))
      • Set tempGroup = (Units within 1200.00 of tempPoint)
      • Unit Group - Pick every unit in tempGroup and do (Hero - Add (Point-value of (Unit-type of (Triggering unit))) experience to (Picked unit), Show level-up graphics)
      • Floating Text - Create floating text that reads (+ + (String((Point-value of (Unit-type of (Triggering unit)))))) at tempPoint with Z offset 0.00, using font size 8.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Custom script: call DestroyGroup(udg_tempGroup)
 
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
Trigger comments:
your trigger leaks...do like this...

Set tempPoint = (Position of (Triggering unit))
Set tempGroup = (Units within 1200.00 of temPoint

Then clean afterwards...

=======

Dont use single If/then/else statements, use the loop one...and dont put "Do Nothing"...

you dont need to make tempPoint again for floating text, use above unit instead (picked unit)...

you dont need picked hero=true coz normal units cant get experience...
 
Firstly, it already has Set tempPoint = Position of Triggering unit and Set tempGroup = Units within 1200 of tempPoint...
you obviously did not look at my trigger script very well..
Secondly, it is impossible to not put Do Nothing unless you have it set to the Multiple Actions, on seperate lines.
And, the second tempPoint was because my original trigger did more than that, I removed that part, but forgot to remove the second creation of a tempPoint.
My original trigger did several things such as give gold and items based on the level, point value, and type of the creep. I cut that part out, as it worked properly and didn't need to be reviewed.

As for it checking for a hero, that's because I wanted it to be pre-set to check for a condition, just in case I ended up creating mercenaries, or some sort of hero which I did not want to gain EXP. I have it set to check for hero because any unit getting EXP will be a hero, so that the check does nothing. It's just there so that if I ever have heroes that I don't want to get EXP, all I have to do is change it to, say, not give EXP to summoned units, or not give EXP to units with some other specific classification. For now, that classification check does nothing, it's there in preparation for later.

So, other than pointlessly criticizing my trigger and pointing out problems that don't even exist, do you know why the trigger seems to not work with the one particular unit?

Btw I removed the condition check for now, as that is not necessary for checking whether or not the trigger carries out the needed function, giving the right amount of EXP. The trigger is not any shorter than it used to be, anyway (not that it was very long, I try to keep my triggers short unless they need to be otherwise)
 
defskull, that is not the problem. I already know how to use an If/Then/Else Multiple Functions, I said that earlier.
My trigger does not even have an If/Then/Else in the first place
The problem is that for one particular unit, it seems to be acting up.
Is anyone going to address the actual problem, instead of sitting here telling me things I already know? I already know how to make a damn trigger, I need to know what's going on with the particular problem I'm asking about. My trigger functions, it's the problem with one particular unit that is the issue... You aren't reading what I type, you're seeing one tiny piece of it and replying without any thought...
 
Level 2
Joined
Feb 8, 2011
Messages
31
Is the chieftain a hero, and have you had issues with other heroes giving incorrect exp?

You should answer my question. I can think of at least one thing that explains why your trigger appears to be malfunctioning with that specific unit but only if your answer is 'yes'.

Trigger comments work just fine in these...
  • IfThenElse
    • Events
    • Conditions
    • Actions
      • If (((Triggering unit) is A structure) Equal to True) then do (Unit - Kill (Triggering unit)) else do (-------- nothing --------)
 
The chieftain is a unit, not a hero, for those who were wondering. It's a unit, not even categorized as special. It's in the same category as all of the other units which are killed for EXP, at least, the ones owned by the P12. The only categorization difference is that this unit has classification Ancient.
And no, I did not just now change the script. The only thing I've changed in the script is to remove the condition check, as that was part of a different function of the trigger not related to the EXP bug.
The leak checks were already part of my trigger in the first place. Considering the fact that maps I've made a year ago already have custom script to patch leaks, you shouldn't think this one wasn't already. You just didn't look very closely... It was the first 2 lines of the actions, so I have no idea how you managed to miss them...
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
I told you, that's not your trigger before, it's like this...you just edited it...

  • Set tempGroup = (Units within 1200.00 of tempPoint)
  • Set tempPoint = (Position of (Triggering unit))
  • Unit Group - Pick every unit in tempGroup and do (Hero - Add (Point-value of (Unit-type of (Triggering unit))) experience to (Picked unit), Show level-up graphics)
  • Set tempPoint = (Position of (Triggering unit))
Anyway, it will cause error, why? because you're 'ADDING' experience...

example if you killed a peasant and it's point value is 100, then you're not
just adding 100 but adding the 25 XP of the kiled peasant, thus your XP gain is 125...

tauren has 115 XP gain, so if you kill that you will gain 115+point value = 215!...
 
Level 6
Joined
Dec 9, 2010
Messages
121
Hmm.. this is very odd. I made a test map, which I will attach to this post, that uses this system for exp gain. The thing is, I gave the classification Ancient to one of my units, and it didn't seem to have any effect.

Can I see the map in question? Maybe you disabled the exp in a different way than I did? I used a trigger to set the player's exp gain rate to 0.00%. Did you use Gameplay Constants? If so, I'd bet that you misunderstood one of the exp table values or something.

It could also be something that you didn't mention, and didn't know about, but Idk. The trigger itself works fine, as proved by my test map, which uses almost the exact same code.

Anyway, if you get back to me with the map, I could take a look at it.
 

Attachments

  • Test Map Triggered Exp.w3x
    20.7 KB · Views: 51
Yes, I knew that the trigger worked fine, I simply needed to know which aspect of the map itself could cause the trigger to work improperly. That's why I was annoyed by people constantly wasting my time trying to point out faults that didn't even exist, because I had already stated that the trigger worked for all but the one unit. I've used it with hundreds of other units of various levels and point values, and had no problem, however the ONE unit doesn't seem to work.
Thank's for finally responding to the real issue.
 
Status
Not open for further replies.
Top