I had no idea that was a way to use substrings. You just drastically improved my quality of life.
- Registered User
Member for 13 years, 6 months, and 7 days
Last active Fri, Dec, 21 2018 06:10:05
- 0 Followers
- 90 Total Posts
- 0 Thanks
Sep 13, 2013Posted in: Triggers
So I have started work on a save system using only a single string. If a mission hasn't been completed then its value is 0, if it's been completed in victory then the value is 1, if its been failed then the value is 2.
So if mission one was failed, mission two, and three were completed, and the player is currently on mission four... Then the string would look like this: 2 1 1 0
Now, once the string is made, its very easy to get the information I want. I can just use Word of String to know the past outcome of any given mission. So if I want to know if the player failed mission three, I could just ask If Word 3 of String == 2.
The problem I am having is saving the string. It doesn't seem like there is a Word of String function to save to just one specific part of a string. I have to load each part of the string separately from the bank, and then re-save the entire string each time I want to update a single part of it. And I need a different trigger for every mission since it's a different word in the string for each mission.
Saving each mission to it's own key seems tedious, but my main concern is it might exceed the file size limit for banks, so I am trying to avoid that. In addition to missions I also have weapons, items, and unlocks I want to save. So it's important that it's compressed as much as possible.
There has got to be a better way. If anyone has any advice it would be very helpful. Even if it's an entirely different way to go about it. Thanks.
Sep 3, 2013Posted in: Triggers
Basically using variables in events never works out. For instance, if you have a periodic event that happens every x seconds, if you change x it won't change how often it occurs. Instead you would use a variable wait in the actions. It's just the way it is :/
Sep 2, 2013Posted in: Triggers
With data, you would want an ability that when you press the hotkey it would swap the ability with a second one which uses it on your hero. Then you either select the target for the first ability, or push the hotkey again to use the second swapped ability.
Aug 7, 2013astralcv posted a message on [Solved] Help with Turn Rate using Make Unit Face AnglePosted in: Triggers
Also the description of how each part works was very useful in understanding what was going on. I was able to make it on my own because of that rather then just copy/paste your code. Thank you very much.
Aug 6, 2013Posted in: Triggers
You could re-upload the map every day and manually set the current day as a variable. Then check to see the difference between the manually set variable and the one stored in the players bank is.
Kinda heinous, and definitely hardcore but it would work.
Aug 6, 2013astralcv posted a message on [Solved] Help with Turn Rate using Make Unit Face AnglePosted in: Triggers
I have been working on this project for awhile now, and while there is always other stuff to work on, I keep coming back to this problem trying to fix it and I keep getting stuck. It's very important to the gameplay that it functions properly and it's been about a week now and I can't seem to figure it out so I've decided to see if anyone can help solve this one for me.
Now what I want is to make my units turn to the Angle I choose at a constant rate using triggers.
I am using this action to make the turns:
Unit - Make Unit face Angle over X seconds
So ideally if tell the unit to turn 180 degrees, it should take say, 3 seconds. And if I tell it to turn 60 degrees it should take 1 second.
My first attempt at modifying the action looked like this:
Unit - Make Unit face Angle over ((Abs(Angle)) - (Abs(Facing of Unit)) / 60.0) seconds
The problem I am running into with this: If say the Angle is say -90 and the unit is facing 90. It takes the absolute of both, and 90 - 90 = 0, and turns it instantly.
If I remove the absolute, then I run into other problems like: (-90degrees - 90degrees) / 60 = -3. Often times the game doesn't enjoy turning units in a negative amount of time. Or (180 - -180) / 60 = 6. So if you are slightly to the left it takes 6 seconds to turn, but if you are slightly to the right, it's instantly.
My other variation that seems like it has promise is instead of controlling the time it takes to make a turn, I am limiting the distance it is allowed to turn per interval. That idea looks like this:
General - If (Conditions) then do (Actions) else do (Actions) If Angle < (Facing of Unit) Then Unit - Make Unit face ((Facing of Unit) - Turn Speed) over 0.1 seconds General - If (Conditions) then do (Actions) else do (Actions) If Angle > (Facing of Unit) Then Unit - Make Unit face ((Facing of Unit) + Turn Speed) over 0.1 seconds
With Turn Speed being the number of degrees at which it should increment toward the Angle I want.
This works pretty well, it adds Turn Speed to the direction it's facing in increments of .1 seconds. Making the turn rate consistent. However it has it's own issues. If say, my unit is facing -175 degrees, and I want it to face the Angle of 170. In-game that is only appears 15 degree's apart, however mathematically -175degrees is less then 170degrees. So instead of going the 15 degrees I want, it goes the full 345 degrees in the opposite direction. Which is not awesome.
And for this variation, if I use absolute to solve the above problem, then it can't tell if the Angle I want is on the right or the left side since they both return positive and it usually ends up only making left turns.
If anyone can offer up a fix to either of these, or has a different suggestion entirely it would be great. As I said, I have been coming back to this problem for awhile and it's becoming apparent hat I can't get it to function on my own. Any help would be very much appreciated.
Jul 30, 2013Posted in: Data
With the Missile Redirect effect you could just place some persistents at offsets around your unit and keep redirecting it until your ready to launch it or do whatever with it. Might need to change its turn rate/lateral acceleration to make it seem more like a rotation and not a choppy point a to point b thing.
Jul 17, 2013Posted in: Triggers
So, for a basic orbit, you don't need anything complex.
Just need to throw this in a loop and set your Distance. Add in whatever delay you want to make it smooth.
Variable - Modify Rotation: + 1.0 If Rotation > 360 Then Set Rotation = 0 Unit - Move (Orbiting Unit) instantly to (((Position of (Orbited Unit)) offset by Distance towards Rotation degrees) (Blend)
Now, if you want a decaying orbit or whatnot, you just need to adjust distance. So if unit accelerates, increase Distance, if it decelerates, decrease Distance. Unless I am missing something, you should already have the ability to emulate the effects of gravity by modifying the angle, distance, and speed.
Jul 2, 2013astralcv posted a message on Make a carrier's interceptors automatically attack even during move command in WoLPosted in: Data
Under the Weapon for the Carrier: Carrier - Interceptor Launch go into Options+ and uncheck Only Fire While Attacking. That might do it.
May also need the Flag - Transient checked on the Hangar ability.
Sadly I am not too familiar with the Arm Magazine abilities, but I am pretty sure the solution your after is somewhere in the Options+.
Jun 25, 2013Posted in: Triggers
When you begin to cast some spells like fungal growth for instance, it creates a splat actor that follows your mouse cursor until you select a target.
If you could find a way to track the position of a actor/model you might be able to use cursor splats to track the mouse cursor exactly.
Jun 17, 2013Posted in: Triggers
Yah, unfortunately I don't think there is any trigger way to change inventory hotkeys. And I would have no idea where to find the defaults in the data editor... if it's even there. I recently had quite the difficult time adjusting the physics and gravity of a map. I wanted to add a more interesting way to deflect projectiles. Come to find out every mover has it's own setting for how much gravity effects it and it's basically impossible to change it on the fly.
Maybe someone else will be able to help ya. Anyhow, best of luck.
Jun 16, 2013Posted in: Triggers
Only ways that I personally know to get that effect is to bypass it entirely. First way I know of is to use something like this...
Hotkey Trigger Events UI - Player 1 presses Q key Down with shift Allow, control Allow, alt Allow Actions Trigger - Turn Mouse Trigger On
Mouse Trigger Events UI - Player Any Player clicks Left mouse button Down. Actions Trigger - Turn (Current trigger) Off Unit - Order (Your unit) to Use (Instant) Item at Point/Unit(Replace Existing Orders)
Of course if the item you want to use is instant like the marines stim pack or whatever, then you wont need a second trigger to select a target.
Second way would be to simply give the ability you want the unit to cast to the actual unit holding the item through the "equip" option of items, then set a button with a hotkey and allow the unit to cast the ability itself as though it had it. But that's not really a trigger solution.
There might be other ways, but those are the two I can think of.
Jun 15, 2013Posted in: Triggers
Just simply record everything a unit does as it does it and set it as a variable and store it to the bank. So if you get a kill, add 1 to a variable and store it. If your unit gains exp, store it. If your unit gains a behavior, then set a variable to true and store it, if the behavior can stack multiple times then use an integer variable, add 1 and store it. Ect... You'll need to do this for every aspect of your unit.
Then next time the game loads, you'll want to set each variable as the stored value for each bank key and apply them to the unit again. Then you can go on adding kills/exp and such to the variables.
I like to store information as it happens so I can have the most up-to-date information for my units and have the game be as close as possible to where it was when the player left off. Alternatively you can have a periodic event that will store all the unit information every few seconds.
If you want to record many units, like 100's, 1000's or even like 30 or more, then DO NOT bank them. Simply tell your players to use "resume from replay" that they added in HoTS. It's basically like banking the entire game without any work and an amazing way to pick up where you left off in a single player map.
Jun 15, 2013astralcv posted a message on Zerglings run away after a short while and stops attackingPosted in: Triggers
I believe this is a data editor fix not a trigger one. Make sure and check the fields Movement: Acquire Leash Reset Radius and Movement: Acquire Leash Radius and Sight Radius
The first two should be the value of -1 for infinite chasing. You also need to make sure they have enough vision radius. If they can't see a unit they will stop chasing it as well.
- To post a comment, please login or register a new account.