Though, to be honest, using behaviors is more appropriate here, as you can set times and what have you, but I believe this will solve your problem trigger-wise.
As the unit gains energy back, just do it backwards.
Changing catalog values through triggers tends to get buggy, so be ready to look for overly-complicated fixes.
EDIT: Silly me, I'll leave my post attached but if you use "set unit property" and in the slot with the number use arithmetic it works just as well and probably work smoother.
You almost have it. What happens is it will run forever until the player has less than the max.
However, each time you level the amount of EXP it takes increases.
So, the way I went around that was to only subtract the current max EXP, then increase it, then check again.
I could only do it one time, but honestly I don't know how to do that and still get enough levels.
For instance:
Player kills a unit with 500 EXP bounty.
Player only needs 100 EXP to level currently.
Player would only level once in my old system, so player would be left with 400 EXP sitting around.
In my new system, they will level to the correct level but it lags and is not a very good way to do triggering in general.
However, what I am looking for is an alternative to the While loop. I figured out a way without a lag spike (increased the wait) but it will still likely lag if 2+ players level at the same time.
I don't mind the workaround, just so long as it works better than my current system.
I didn't want to make a gigantic title like I usually do.
Anyway, I need to make a trigger for my custom EXP trigger but I need it to repeat until the current value is less than the maximum value of EXP that that unit/player can have at one time.
I am using boss bars and not the normal EXP system, for those curious.
What I have so far:
When the unit kills another unit or a unit owned by a player in a specific player group hits a unit in a different group, it will run the trigger.
After that, the trigger itself is a while trigger, which will check the conditions until they are met (I.E. it will continue to level the unit until it's EXP is less than the max it needs to level).
But that's where it gets laggy. When it runs, it will check the conditions every .1 seconds or until 2 seconds. So it will generate a huge lag spike while it calculates the EXP and levels.
By themselves they work, because I was using a different system that only ran once before and worked like a charm. So it must be the while action. I just don't know any alternatives.
Any help is appreciated, and for those who need more technicals:
I didn't test it but it should work. Though I've had trouble with using just (greater than, less than) < or > so you may have to mess with the numbers a little to get it to work properly.
As hobbidude said, you need a wait trigger between each camera change or else it's going to fidget, bug, or crash. This wait should be as long as it takes (or longer) for the camera to be fully applied.
Like Fuzzy said, but also, the reason I didn't put a while loop or "wait 1.0 game time seconds" is to simulate a boss bar, more or less. Having a wait can get a little confusing especially for units with a health regen of 1.1+ and I could never figure out a way to simulate the actual regeneration better than a wait of 1 seconds.
So I am making a custom EXP trigger. I'll save you the details and get right to the problem.
I am new to using the trigger editor to change unit properties. Until now I didn't think it was possible. Which is really the only reason I am asking this question.
Tofu is a type of food made by coagulating soy milk, and is often used to replace meat as the main source of protein by vegetarians. People hate it because they think vegetarians have a holier-than-thou attitude.
0
@tdhsst: Go
It's a little tricky, but to work it in triggers first of all you'll need to do some calculations.
You need to know how much speed is at 100%, 50%, and so on.
Since you know this, then you need to figure out how much speed should be subtracted for each unit of energy (lets say 1).
Based on the information, it seems to be a 1:1 ratio. So then you do something along these lines:
Though, to be honest, using behaviors is more appropriate here, as you can set times and what have you, but I believe this will solve your problem trigger-wise.
As the unit gains energy back, just do it backwards.
Changing catalog values through triggers tends to get buggy, so be ready to look for overly-complicated fixes.
EDIT: Silly me, I'll leave my post attached but if you use "set unit property" and in the slot with the number use arithmetic it works just as well and probably work smoother.
0
@LaxSalmon: Go
You almost have it. What happens is it will run forever until the player has less than the max.
However, each time you level the amount of EXP it takes increases.
So, the way I went around that was to only subtract the current max EXP, then increase it, then check again.
I could only do it one time, but honestly I don't know how to do that and still get enough levels.
For instance:
However, what I am looking for is an alternative to the While loop. I figured out a way without a lag spike (increased the wait) but it will still likely lag if 2+ players level at the same time.
I don't mind the workaround, just so long as it works better than my current system.
0
I didn't want to make a gigantic title like I usually do.
Anyway, I need to make a trigger for my custom EXP trigger but I need it to repeat until the current value is less than the maximum value of EXP that that unit/player can have at one time.
I am using boss bars and not the normal EXP system, for those curious.
What I have so far:
When the unit kills another unit or a unit owned by a player in a specific player group hits a unit in a different group, it will run the trigger.
After that, the trigger itself is a while trigger, which will check the conditions until they are met (I.E. it will continue to level the unit until it's EXP is less than the max it needs to level).
But that's where it gets laggy. When it runs, it will check the conditions every .1 seconds or until 2 seconds. So it will generate a huge lag spike while it calculates the EXP and levels.
By themselves they work, because I was using a different system that only ran once before and worked like a charm. So it must be the while action. I just don't know any alternatives.
Any help is appreciated, and for those who need more technicals:
This is the main trigger which runs everything else when a unit levels. If you must know more, I can provide it, but it's pretty huge.
0
@fishy77: Go
Max player count would be an integer or real variable (depending on how much accuracy you need.)
And then to pick a random player:
I didn't test it but it should work. Though I've had trouble with using just (greater than, less than) < or > so you may have to mess with the numbers a little to get it to work properly.
0
@jamison0136: Go
As hobbidude said, you need a wait trigger between each camera change or else it's going to fidget, bug, or crash. This wait should be as long as it takes (or longer) for the camera to be fully applied.
0
@tdhsst: Go
Awesome ideas! The map is, again, on hold, but I still appreciate the effort!
Sorry it took so long by the way, I didn't think anyone would reply, to be honest.
0
@Sherlia: Go
Then do like you did before.
It's not a problem. I am glad to help anyone who needs my help when I can. :)
0
@FuzzYD: Go
A+!
I was wondering if there were mods for boss bars, then I realized I was too lazy. :(
@Sherlia: Go
Like Fuzzy said, but also, the reason I didn't put a while loop or "wait 1.0 game time seconds" is to simulate a boss bar, more or less. Having a wait can get a little confusing especially for units with a health regen of 1.1+ and I could never figure out a way to simulate the actual regeneration better than a wait of 1 seconds.
0
@Sherlia: Go
If you must have a dialog for health, do something along the lines of:
These are the variables, now time for the creation trigger:
And now the loop trigger:
This will lag your game pretty bad though, for health I suggest boss bars. They work the same and take MUCH less effort both for you and your map.
0
So I am making a custom EXP trigger. I'll save you the details and get right to the problem.
I am new to using the trigger editor to change unit properties. Until now I didn't think it was possible. Which is really the only reason I am asking this question.
The offending section of triggers are:
I have others that change weapon damage, life armor level, etc...no problem with those.
Here are the errors:
gt_ToInfinityandbeyondS is the trigger name, in case anyone was wondering.
So is this a problem with my triggering? If so how do i fix it? Or is it a bug in the editor I have to work around?
Something I should mention, I will not work in the data editor for the life/energy regeneration unless absolutely necessary.
0
I am truly stumped on this one, so hopefully this isn't another easy fix like the last few posts I've made.
Anyway, how do you go about selecting a unit (in this case the unit that your mouse is on) and then ordering your unit to attack it.
I am trying to use martinolsson's TPS engine, without the "shooter" aspect, as some of my units are melee.
I've tried just ordering the unit to attack the camera target, but it starts and then immediately stops.
When I remove martinolsson's TPS engine library, my unit will attack a position but even if I have the camera over a unit will not attack that unit.
Any ideas?
EDIT: also just tried using a separate trigger with "unit selected/highlighted/clicked" and then set a variable to the triggering unit. Didn't work.
0
@LostMapmaker: Go
Well, I would use an action definition if I were you. In fact I could make you one if you like.
0
@LostMapmaker: Go
I'm not much of an advanced user, but I usually solve this problem by storing the value in a variable.
E.G.: When the unit is using the ability store the value by changing a variable
or
You can have the EXP variable as either a real or an integer, I use integers because it's easier but I imagine it should work both ways.
EDIT: just now realized, you already said my way. Suffice it to say I'm pretty sure it's your only option.
0
lol'd.
Thanks for explaining though. :)
0
@Mephs: Go
What is TOFU and why does everyone hate it so much?