Attack Method Limit

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Soaponarope
Artisan
Posts: 190
Joined: Wed Sep 16, 2009 4:18 pm

Attack Method Limit

Post by Soaponarope »

Is there any way to make it so a monster can have more than 3 ranged attack methods? Some of my monsters can do a lot and I use new attack methods to trigger relays which need to be timed to the monster's action. Having only three options can be quite limiting for me.

I can add more for players by using menus, but have no idea how to expand the monster's options without using movement attack methods.
User avatar
Lord_BoNes
Jack of all trades
Posts: 1064
Joined: Mon Dec 01, 2008 12:36 pm
Location: Ararat, Australia.

Re: Attack Method Limit

Post by Lord_BoNes »

The way I would do it:
Have your attack method activate a relay (let's call it RELAY_1 for reference).

Create a new counter (value = 1).

Create a new relay (RELAY_2) and setup its condition to check if the counter < 1, set target to the counter (de-activate). You use this relay to reset the counter.

Create another 2 relays (RELAY_3 & RELAY_4) setup both conditions to check if the counter = 1. Then, set RELAY_3's chance to activate to 50%. Set both relay's top target to the counter (activate). These 2 relays are your actual "effect activation" relays... each has a 50/50 chance of activating, if triggered one after another (RELAY_3 then RELAY_4)...
This is because they both reduce the counter's value (by activating the counter), making it no longer equal to 1. So, if RELAY_3 activates, then RELAY_4 won't because the condition will fail... but, if RELAY_3 doesn't activate (50% chance) then the counter stays at 1 and RELAY_4 (having 100% chance to activate) will fire.

Now, all that's left to do is go back to RELAY_1, and setup the target-list (from top to bottom, activate) RELAY_2, RELAY_3, RELAY_4... they MUST be activated in the correct order, so this part is important!
Here's what happens when RELAY_1 fires, it triggers RELAY_2, which resets the counter if it is less than 1, then the other 2 relays fire, and your effect happens... one way OR the other.

To increase the number of possible options (you can have up to 7 possible outcomes) just divide the number of relays left in the chain into 100%... so if you have 4 possible outcomes, the first relay would have 25% (100/4), the second would have 33% (100/3) then the last two would be the same as above, 50% (1/2) & 100% (1/1, last option in the list). Then you just need to execute them in the right order and all should work as expected.

Just a note: if you build this relay chain all on the one tile, just copy and paste to make more, however, the relay conditions DON'T copy and paste (they stay pointing to the original counter), you'll need to update the cloned tile's relay checks, but that's all that needs fixing.

I hope this has helped you solve your issues.
 
Image

1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin

Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
Post Reply