They Are Billions
Custom Levels for They Are Billions
Add custom levels to They Are Billions by subscribing to these workshop items!
Подробнее
ApplyRules(“Ranger TimeAction -10%”) - Why does this not work?
I'm trying to execute some code to make rangers attack 10% faster. From what I have been able to gather, it's either ApplyRules(“Ranger TimeAction -10%”) or maybe ApplyRules(“RangerAttack TimeAction -10%”). However, for both of these functions, I'm getting:

Error Executing Sequence: Function bad arguments list: ApplyRules(“Ranger TimeAction -10%”)

Then

Error evaluating expression: Variable referenced not initialized: RangerTimeAction

Do I just have the function wrong, or is this a bug?
< >
Сообщения 14 из 4
You need a ; behind the bracket. Also try using numerical values instead of %’s if the above doesn’t work. The value of non-vet ranger TimeAction is 1000 (500 for vet), it should work when changing it to 900.

So ApplyRules(“RangerAttack TimeAction=900”);

The error is probably from a typo.
Отредактировано Amove; 24 июн. 2024 г. в 20:59
Idk, I keep getting this error no matter how I try and code the function. Does the function as you wrote it work in a map for you? The ; is for separating multiple functions, I have other ApplyRules working just fine solo without the ; separator.

ApplyRules(“Ranger TimeAction = 900”);ApplyRules(“RangerVeteran TimeAction = 400”)
ApplyRules(“Ranger TimeAction =900”);ApplyRules(“RangerVeteran TimeAction =400”)
ApplyRules(“Ranger TimeAction=900”);ApplyRules(“RangerVeteran TimeAction=400”)
ApplyRules(“RangerAttack TimeAction = 900”);ApplyRules(“RangerAttackVeteran TimeAction = 400”)
ApplyRules(“RangerAttack TimeAction =900”);ApplyRules(“RangerAttackVeteran TimeAction =400”)
ApplyRules(“RangerAttack TimeAction=900”);ApplyRules(“RangerAttackVeteran TimeAction=400”)
This is straight from several maps that worked for me. ApplyRules("SoldierRegularAttackVeteran TimeLoad=300; SoldierRegularAttackVeteran TimeAction=333; RangerAttackVeteran Damage+2; RangerAttackVeteran TimeLoad=180; RangerAttackVeteran TimeAction=400");
This was definitely some sort of bug. I had the initial format wrong ("Ranger" instead of "RangerAttack"), but it seems like that may have caused the events in the communicator to bug out. All I did was take your code, which worked, and then backtracked after the error "cleared" to get right back to the function formats I was using before that are now working. *headscratch*

Thank you for helping me work through this!
< >
Сообщения 14 из 4
Показывать на странице: 1530 50