One year later....
- RSS feed (per forum category)
- A way to follow a thread
Quote from Ymerejliaf: Go
Okay, that makes more sense, however, I can't find the value for the (owner of damaging unit). I was able to work out the events, but I can't get the other half of it to work. Is it a custom value that I need to enter or what? Sorry if this is annoying, like I said, I don't know how to do triggers....
Category: Unit -> Owner of Unit -> Damaging Unit
Category: Unit -> Set Unit Property (life current) -> Math arithmetic
Well anyway. The function itself works. The arrays are also working. There's no bug or anything here. Run the function manually, make sure everything is set etc.
If you don't believe run this
Event: Whatever Variables: UnitType types Actions: types = marine types = zealot types = zergling Repeat 5 times Create 1 types[Random integer 0 to 2] for player 1 at center of entire map
It appears the pathing cost function have issues with small spaces. (<1) This Behaviors is tied to route finding.
If function returns 65536 then unit sent from/to this point will be stuck trying to take shortcut thru wall even when the 'normal' route is open.
Anyway I consider this to be core bug.
Small theory on why it blocks the maze even with openings >1 wide. (potentially caused by rectangle blocks structure)
Hard really to help you based on your claims.
Often people say "i do that" when they actually miss their errors and do something slightly different.
The mentioned spawn,send unit method should test if path is indeed blocked without errors. Also it will show you where the unit actually goes in case it's blocked.
Other than that you may send me map in PM, point on where and when error happens and i will most likely find the error.
If your using pre placed units on map and you want let's say 'Rocks unit' to not be damageable by player 5 then your trigger will look look like this
Event: 'Rocks unit' takes damage Actions: if (owner of damaging unit) == 5 set triggering unit current life = triggering unit current life + damage taken amount; // this will simply heal the unit back if attacking player is the player that it should be immune to
If the player do not change then you can add another event to the same trigger with different unit.
the libNtve_gf_SendActorMessageToGameRegion() works without issues. Make sure your region is correct.
libNtve_gf_AttachActorToUnit(EventUnit(), "timoniumsourcetext", "Head");
This changes what you tried to do before. Static point actor vs attached to unit.
Quote from BasharTeg: Go
Interesting, thanks for the advice. Is there a practical difference between a While loop and a Repeat Forever loop (besides being able to use conditions for the while loop?) I've used both but have never really noticed any changes between the two.
Also, about how many times can a loop repeat in a single game tick before causing bad lag/crashes?
Well there's no such thing as repeat forever itself. In code, as you can see, it's: while (true),
Limit is around 690k operations per game tick i believe. Wait 0.0 pushes execution to next tick.
Still you need to count the fact that user may be running a lot of actions prior to your function call. This vary a lot. Personally i had issues with 6k+ loops
So count mod 1000 or 500 it's safe limit. Probably won't even reach it in single call yet it's worth to have it because error breaks everything.