So I've started to do some coding again, sort of, and I have a few questions and problems: these are in no particular order:

1) Has anyone been able to trigger proper bouncing off of cliffsides (ie they bounce off in roughly the right direction) and other protrusions with any sort of given knockback system?

2) What's a good way to detect cliffs and distinguish between them and hills? Also in the same respect, how can you trigger that a unit can slide up and down hills, but bounce or fly off of cliffs?

3) What is a good way to detect damage coming from ranged unit orb attacks and regular abilities?

4) How do you make floating texts only appear for a particular player? (I just don't know the syntax )

5) What would cause a trigger to skip actions without you telling it to? I seem to have this problem because all of my spells were working properly before and I tried adding in a new system to display damage dealt and now some spells don't seem to work, even though I thought they were completely isolated from the workings of the damage system.

6) Attached to this is my testmap, which contains the buggy system (using .GUI, sorry ) for making self-updating floating texts which update whenever a unit takes additional damage from the same source, and eventually dissipate and display the correct damage after a short period of time. How would you do this using JASS?

but at the same time, the upper and lower levels of walkable terrain is. Considering I'm currently measuring on a point basis, if I miss the point where it's unpathable, my units are just gonna keep going. Unless there's a specific way to check this already?

1) Has anyone been able to trigger proper bouncing off of cliffsides (ie they bounce off in roughly the right direction) and other protrusions with any sort of given knockback system?

Yes, I have. It is not in the resources section though. I use a vector library to easily calculate an object's "velocity" and "position" vectors while applying the "acceleration" vector to the velocity vector properly. This achieves the effect of real physics. It really isn't that difficult once you know the vector math behind it.

Quote:

Originally Posted by Drain Pipe

2) What's a good way to detect cliffs and distinguish between them and hills? Also in the same respect, how can you trigger that a unit can slide up and down hills, but bounce or fly off of cliffs?

If you're triggering a slide, then you can find the current cliff-level before you update the unit's position and then again after. If the two values are not the same, then the unit has officially moved down/up a cliff level. You could use different comparison operators to achieve different results. The function is: GetTerrainCliffLevel;

Quote:

Originally Posted by Drain Pipe

3) What is a good way to detect damage coming from ranged unit orb attacks and regular abilities?

Most orb effects yield buffs on an affected unit, which you could detect using the EVENT_UNIT_DAMAGED unit event. Orb effects can also be applied to melee attacks, so if you can imagine every unit is given an "invisible" orb ability then you would be able to detect when an instance of damage has come from a trigger (or a regular ability) or a physical attack.

Quote:

Originally Posted by Drain Pipe

4) How do you make floating texts only appear for a particular player? (I just don't know the syntax )

JASS:

ifGetLocalPlayer() == specificPlayerthen// create and setup the floating text within this blockendif

In the previous code specificPlayer refers to a variable reference to the player that you would like to display the text-tag (floating text) for. For example, if it were the case that specificPlayer was set to reference the player Player(0) then the text-tag would only be displayed to player one.

This is what I could answer off the top of my head, I'll look into your other queries. **I just saw the name of your map now, and its kind of funny - I have a map I'm working on named "Heroes" as well.

This is something that I saw when looking through your "Damage setup" triggers.

You should add a "Custom Script: DestroyGroup( udg_TempStartGroup )" to remove the group handle. It doesn't make much of a difference because the group is only referenced once, but its always nice to try and be 100% clean.

Trigger:

Do Multiple ActionsFor each (Integer A) from 1 to 1600, do (Actions)

Loop - Actions

The idea of updating these text-tags every 0.05 seconds, in which you loop through 1600 indexes doesn't seem very efficient to me. I think there might be a better (and quicker) way to go about this. If anybody pops out at me while I'm reading this I'll try and explain it.

1) I got as far as units, but cliffsides don't work the same way because it doesn't collide with another object. I had an idea to create 3+ expanding points which stopped when they hit a cliff jump, then use those points to create a best fit line and use that as my bouncing reference (ie my virtual wall) I'm worried this might lag a lot so i wanted to know if there was a better method for bouncing off of cliffsides.

2) Ok that's what I did, well sort of. Each cliff is actually 128 higher than the previous one so i just did a multiplier to check for that difference and it worked ok...

3) The problem is that I don't need an orb effect for regular melee units because of how i setup my detection (ie all damage not coming from attack comes directly from the hero) The problem with orb effects is i tried using cold arrows and when I tried to get the damage, it returned 0. And it's useless if you want to have damage dealt based on attack damage dealt, so that doesn't work for me either if there is an ability that works and doesn't return 0 damage then I'll use that. Or I'll cheat.....

4) Thanks I'll try and work that in right away.

BTW that damage detection is pretty much a copy of the really leaky one I saw on here but it's the only non-jass way I could setup my preliminary system.

Also, I know that 1600 cycles is very inefficient, that's why I was wondeirng how I'd set this up differently in JASS (i'm slowly making the transition)

that 1600 is basically 16 groups of 100 possible units running at 1 time. If a unit exists in a slot, then it updates the FT for that unit and cycles through for all units. This is the only way I could think of to make it MUI for 12 players (since i'm not sure which 12 are users and which 4 are neutral...)

Yeah that might cut it down to about 1/4-1/10th of it's used space since the FT instances last about 2-3 seconds before the slot is voided. Hmmm, I could also use the more efficient way of replacing the values from the last slot to the current slot. That way the system would only be running at about 5% capacity for most of the time, and for large unit groups, maybe 20-25%. Could be interesting to see how much faster it goes. In all actuality, unless there's a full house and every type of player is used, this system uses a very small portion of its capacity. Each player is about 6% of the systems capacity. So if no creeps are used then it's already using 24% less space each time it runs through, if i set it up right.

For my floating text system, I've tried updating it so that it uses less space as to run faster, here's what I have thus far (Note the system right now is restricted to only display damage done by player 2 (blue), which is the player slot you take if you run the testmap from WE):

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

DamagedUnitGroup_int_Player[(Player number of (Owner of (Damage source)))] Less than or equal to 100

Then - Actions

Set DamagedUnitGroup_int_Player[(Player number of (Owner of (Damage source)))] = (DamagedUnitGroup_int_Player[(Player number of (Owner of (Damage source)))] + 1)

Else - Actions

Set DamagedUnitGroup_int_Player[(Player number of (Owner of (Damage source)))] = 1

Else - Actions

For each (Integer A) from (100 x ((Player number of (Owner of (Damage source))) - 1)) to ((100 x ((Player number of (Owner of (Damage source))) - 1)) + DamagedUnitGroup_int_Player[(Player number of (Owner of (Damage source)))]), do (Actions)

Loop - Actions

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

Most of the middle of last second trigger you can ignore, but I need you to pay attention to the last 6 lines, not including the ingame message display (that was used for testing) and from the begining to the display of the first in game message. Those last 6 actions are supposed to be what would allow me to swap data from the current slot to the position of the maximum slot and bring in the dtata from the last slot of that set of data to the position of the current slot. In essence replace the expired FT with the last one, delete the data in the last slot, and reduce the max slot number by 1 (since the previous last slot was just emptied, or so I think it is). I also start at the largest number and move down so that I don't replace an expired slot with another expired slot (though theoretically that would fix itself in the next run of the trigger).

Now for the most part, the system, seems to run fine, but every so often, a floating text will be left hanging there so somewhere there's a leak of information, I just cannot seem to find it.

Now I'm currently trying to do this using .GUI to see if it can be done and if the method works. Later I'll try converting it to JASS but I want this to work properly before i do that.

So this is where you guys come in. If you see something that does not look right, or that I'm doing something wrong with my algorithms, please post it, because I've looked over this code countless times and I'm not getting anywhere. Every attempt I make that I think will fix the error, does nothing.

About cliffs (and hills), you should be using GetLocationZ and working out the average terrain normal from a small sample area around the target point. Check out any physics systems if you're interested.

Basically the whole idea is to create self-updating floating texts that will constantly update the damage they display for a unit, as long as it is within a very short time frame (currently damage instances are set to update the FT if they are within 0.35 seconds between each instance). The main reason for this is because I had some abilities that fired multiple small projectiles, or dealt small amounts of damage rapidly, so i figured this system would give the player a much better estimate of how much damage their ability was doing for a single unit. Right now it's not quite accurate for what I wish to make it out to be (once I actually finish my damage detection system) but it displays everything properly, for the most part.

Anyways, dl the map and try it out for about 2-3 minutes and you can see how the systems display looks.... and you will also notice the weird bug which I have been unable to locate in which floating texts are left undestroyed and all displayed across the playing field.

that's not normally how it works, I just set it up to go through that one value (normally it's 1-12, so 1 cycle through for every player slot. As far as reading the code, there's only about 8 lines that you need to focus on, 6 of those are the last 6 lines of the code, not counting the game displayed messages.

what the system does is it tracks up to 100 units (as it is right now) of which it will display the damage they take, per player but it stores all units, damage, floating texts, etc in one giant array of 1200 slots. I split up that array and only cycle through slots that actually have information, ie

For bouncing off cliffs, the easiest way is to use the vector library to get the terrain normal vector at the collision point, flatten it's z value and then use it to modify the projectile's velocity vector (by subtracting from it it's projection onto the normal multiplied by two).

@Antiarf: vector library? link or is it a function or what? I might have to modify my knockback system to work that in.
@Dark: Hmmm, the problem isn't associated with the colors.

BTW I've taken my system out of the big map and just put in by itself. You can all look and see for how it works a lot quicker now... each unit actually has 2 floating texts attached to them: one follows them around and updates itself and follows the unit, and then when the timer expires, that first one is destroyed and a second short duration floating text is created (this one isn't defined or attached to any variable so it shouldn't bug out).

[edit] found the problem although I still don't understand it. Apparently if I can't transfer information between floating texts by just setting one as another...I have to manually create and update a new floating text, or something like that.

Hopefully others might find this useful. Now I know it's just .GUI but it's the most efficient way I've been told of for keeping track of the data and updating everything so I hope yall enjoy.