Login

russian armor

On_construct - random action logic

21 Jan 2018, 17:23 PM
#1
avatar of Artigo

Posts: 80

Hello all,

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.

21 Jan 2018, 18:11 PM
#2
avatar of SneakEye
Senior Modmaker Badge

Posts: 817 | Subs: 5

You can set "owner_type" within the upgrade to "player" instead of using the "player_target_action".
22 Jan 2018, 16:28 PM
#3
avatar of Artigo

Posts: 80

Im not sure what I'm not doing correctly, but the upgrade is still not being granted correctly even when (in the requirement action) I only have the grant upgrade and have 'owner_type' set to player.

Do I need to have actions under the other action option?
22 Jan 2018, 19:41 PM
#4
avatar of SneakEye
Senior Modmaker Badge

Posts: 817 | Subs: 5

Can you post an image of the requirements from your requirement_action? And I suppose that you test with a chance higher then 1%?
23 Jan 2018, 00:53 AM
#5
avatar of Artigo

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.
23 Jan 2018, 08:56 AM
#6
avatar of SneakEye
Senior Modmaker Badge

Posts: 817 | Subs: 5

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%?
24 Jan 2018, 14:11 PM
#7
avatar of Artigo

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.
24 Jan 2018, 14:50 PM
#8
avatar of Lugie
Senior Modmaker Badge

Posts: 327

Well, lets check all the basic stuff and then move onto more in-depth troubleshooting.

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.
24 Jan 2018, 15:23 PM
#9
avatar of Artigo

Posts: 80

jump backJump back to quoted post24 Jan 2018, 14:50 PMLugie


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.
25 Jan 2018, 02:37 AM
#10
avatar of Artigo

Posts: 80

No dice. Tested with weight=99 and 2 second delay

Perhaps I could try with putting the requirements on the upgrade itself, but that wouldn't prevent actually getting it.
27 Jan 2018, 16:42 PM
#11
avatar of Artigo

Posts: 80

jump backJump back to quoted post24 Jan 2018, 14:50 PMLugie


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.
27 Jan 2018, 19:51 PM
#12
avatar of Lugie
Senior Modmaker Badge

Posts: 327

jump backJump back to quoted post27 Jan 2018, 16:42 PMArtigo


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?
27 Jan 2018, 21:27 PM
#13
avatar of Artigo

Posts: 80

jump backJump back to quoted post27 Jan 2018, 19:51 PMLugie


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.
28 Jan 2018, 01:49 AM
#14
avatar of Lugie
Senior Modmaker Badge

Posts: 327

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?
28 Jan 2018, 03:28 AM
#15
avatar of Artigo

Posts: 80

jump backJump back to quoted post28 Jan 2018, 01:49 AMLugie
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.
28 Jan 2018, 04:43 AM
#16
avatar of Lugie
Senior Modmaker Badge

Posts: 327

jump backJump back to quoted post28 Jan 2018, 03:28 AMArtigo


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.
28 Jan 2018, 17:24 PM
#17
avatar of Artigo

Posts: 80

jump backJump back to quoted post28 Jan 2018, 04:43 AMLugie


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.
1 user is browsing this thread: 1 guest

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

735 users are online: 735 guests
0 post in the last 24h
12 posts in the last week
24 posts in the last month
Registered members: 49851
Welcome our newest member, Eovaldis
Most online: 2043 users on 29 Oct 2023, 01:04 AM