On_construct - random action logic
Posts: 80
Trying to work out the logic here for random action syntax.
Essentially, I'm trying to give a 1% for an upgrade (or other action) to occur whenever this type of building is constructed. I've tried this layout with 'player_target_action'.
I assume check self refers to the actual object being created in this case.
However, I can't get the action to trigger no matter the set up here.
Posts: 817 | Subs: 5
Posts: 80
Do I need to have actions under the other action option?
Posts: 817 | Subs: 5
Posts: 80
Can you post an image of the requirements from your requirement_action? And I suppose that you test with a chance higher then 1%?
Sure
What Im trying to do is have a chance to grant this upgrade (which in turn grants a one time use ability) on action. Whenever the ability completes, it removes the upgrade from the player as to not allow reuse. This works fine, but granting the upgrade in this manner in the first place doesn't for whatever reason.
Posts: 817 | Subs: 5
Can you confirm that you test with a chance higher then 1%?
Posts: 80
You might can try to set "validate_all_sub_actions" to false. It has blocked some actions for me which did work just fine.
Can you confirm that you test with a chance higher then 1%?
I have 'validate_all_sub_actions' set to false and the 'owner_type' set to player. I tested it on weight 99 for the upgrade and weight 1 for the no upgrade. Still not showing up for some reason.
The ability IS set on the army and I have the correct structure set for the engineer.
Posts: 327
1. Check the upgrade itself doesn't have any requirements.*
2. Check the upgrade for who owns it, in your case, it should be the player. You shouldn't have to use a player action to add it.
3. Use a delay action to add the upgrade. I suggest a delay of 0.125. This is because you have the requirement set to make sure the upgrade is not present, however, the system could have already added the upgrade in advance, thus doing some fancy computer stuff to mess it up.
*Also, the upgrade you have might only work if you have the commander that enables that ability.
Posts: 80
3. Use a delay action to add the upgrade. I suggest a delay of 0.125. This is because you have the requirement set to make sure the upgrade is not present, however, the system could have already added the upgrade in advance, thus doing some fancy computer stuff to mess it up.
*Also, the upgrade you have might only work if you have the commander that enables that ability.
This is a good idea, I'll try this. I actually found when I was trying to remove the upgrade from the abilitiy on_end, it only worked WITH a delay.
Posts: 80
Perhaps I could try with putting the requirements on the upgrade itself, but that wouldn't prevent actually getting it.
Posts: 80
3. Use a delay action to add the upgrade. I suggest a delay of 0.125. This is because you have the requirement set to make sure the upgrade is not present, however, the system could have already added the upgrade in advance, thus doing some fancy computer stuff to mess it up.
Do requirement actions go before their requirements are checked?
For the life of me I cannot figure out what is causing this issue. It works as intended without the requirement action, but no combination of settings makes it work with requirements.
Posts: 327
Do requirement actions go before their requirements are checked?
No, the requirements are usually checked before the action is executed. Otherwise it wouldn't be a very effective requirement action, eh?
Posts: 80
No, the requirements are usually checked before the action is executed. Otherwise it wouldn't be a very effective requirement action, eh?
Right, that's what I figured. I'm just grasping at straws trying to understand the logic behind this.
Posts: 327
Posts: 80
So, lets go back to the first point. What exactly are you trying to do? Give a small chance of adding a ability on construct, just the upgrade, both, wot?
Correct, small chance of adding an ability on construct. The ability requires that upgrade, so granting the upgrade then gives the ability.
Posts: 327
The ability requires that upgrade, so granting the upgrade then gives the ability.
And here is where you went wrong. The upgrade does not grant the ability, it unlocks it. Unless you have the commander that actually adds that ability (If its a commander ability), then its not going to work at all. You have to add the ability through a, surprise surprise, add ability action.
Posts: 80
And here is where you went wrong. The upgrade does not grant the ability, it unlocks it. Unless you have the commander that actually adds that ability (If its a commander ability), then its not going to work at all. You have to add the ability through a, surprise surprise, add ability action.
Actually it works fine like that as you can see here
https://www.coh2.org/replay/67536/test
Since the ability is set army-wide. For whatever reason it won't work whenever there is a requirement action before hand. I may have to try to rework it through to use the add ability instead.
Livestreams
334 | |||||
12 | |||||
10 | |||||
4 | |||||
2 | |||||
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.602216.736-1
- 3.34957.860+14
- 4.1109614.644+10
- 5.276108.719+27
- 6.305114.728+1
- 7.916405.693-2
- 8.722440.621+4
- 9.261137.656+2
- 10.1041674.607-2
Replay highlight
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Board Info
8 posts in the last week
34 posts in the last month
Welcome our newest member, Falac851
Most online: 2043 users on 29 Oct 2023, 01:04 AM