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

SHOUT IT OUT!

No ProfanityNumber of ShoutsRefresh Shout Box
Willy Pete: @Rosbone not dead yet. when that happens the font will switch to Papyrus :*(
Today, 00:16 AM
dasheepeh: it was an honor guys :guyokay:
Yesterday, 20:34 PM
aerafield: yeah I already prepared my "Can't believe there's comic mode for the 10 daily visitors even on this April 1st" :guyokay:
Yesterday, 20:29 PM
Rosbone: @dasheepeh I guess that means this site is officially dead :guyokay:
Yesterday, 20:19 PM
dasheepeh: no comic sans font for april 1st this year?
Yesterday, 19:56 PM
Willy Pete: @Lady Xenarra this you? https://i.imgflip.com/3e4thi.jpg
Yesterday, 02:53 AM
Lady Xenarra: Does anyone else think that USF needs buffs? It feels like they’re on life support sometimes
Yesterday, 02:36 AM
Willy Pete: @Rosbone Ahh I missed that memo. I still think its a bad decision though. Adds frustration for players and isnt gonna make them that much money
Last Thursday, 15:46 PM
Rosbone: It is also good they left it free until after the free to play weekend. Points for that.
Last Thursday, 09:34 AM
Rosbone: But I agree, the cost to get a full decent Coh game pushing $115 US is not the best idea. Especially when it needs so much more work for casuals.
Last Thursday, 09:32 AM
Rosbone: To be fair, it was a thank you to early fans right? They said it was not free for long and it would become a pay DLC at some point.
Last Thursday, 09:30 AM
Willy Pete: Re-releasing free DLC so they can charge new players money for it. Brilliant marketing strategy :clap:
Last Thursday, 04:31 AM
Soheil: Coh2 still broken server ?
25 Mar 2025, 18:27 PM
Rosbone: Congrats to Relic. Looks like Coh3 has finally usurped Coh2 s the popular Coh. You smell terrific. :snfQuinn:.
24 Mar 2025, 02:46 AM
Nickbn: and again someone else replies. I mean come on guys. Give @adamírcz a chance
22 Mar 2025, 14:00 PM
Willy Pete: @Nickbn you didn't ask a question, and this is a chat box...
20 Mar 2025, 13:11 PM
Nickbn: @Rosbone it's incredibly rude to speak on someone elses behalf, especially when a question is directly adressed to them. I understand your passion for the subject at hand but I want to hear from him.
20 Mar 2025, 10:16 AM
Rosbone: @Nickbn No, I am just saying people should not be using any Relic owned forum since they have proven they ban anyone who says true things about Coh3.
18 Mar 2025, 19:01 PM
Nickbn: @Rosbone do you speak on his behalf? I didn't know. In that case keep us updated please.
18 Mar 2025, 16:47 PM
Rosbone: #RelicModdedEchoChamber
16 Mar 2025, 17:54 PM

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

372 users are online: 1 member and 371 guests
Willy Pete
1 post in the last 24h
11 posts in the last week
81 posts in the last month
Registered members: 53137
Welcome our newest member, DJ Dingbat
Most online: 2043 users on 29 Oct 2023, 01:04 AM