What's new

Creating "Loops" with multiple skills in a skillset.

iTzCascadexX

Member
Premium Supporter
Supporter
Moderator
Quality Assurance
Joined
Nov 2, 2015
Messages
164
Hi, Community.

Might be a tough one, but is it possible to create a loop when writing your skills, for example:
Code:
- summon{type=Melee;radius=5;amount=1;repeat=30;repeatInterval=20} @self

This repeats a mob spawn 30 times, spawning in 1 mob per second, underneath that line, I want something like this:

Code:
- command{cmd="ex flag server raid_mob_count:+:1"} @self

(Note: The above command is Denizen)

The problem I'm having at the moment, is that this counter is always at 1, no matter how many spawns there are (this count is also negated as mobs are killed).

I'm curious if there's a way to loop this without spawning a stupid amount of mobs. (I know you can call skills, I think this would be the way forward, but I'm not entirely sure, hence why I'm asking)

Cheers.
 

Rickyling

Community Manager
Community Manager
Supporter
Moderator
Quality Assurance
Joined
Jul 24, 2015
Messages
672
Hi, Community.

Might be a tough one, but is it possible to create a loop when writing your skills, for example:
Code:
- summon{type=Melee;radius=5;amount=1;repeat=30;repeatInterval=20} @self

This repeats a mob spawn 30 times, spawning in 1 mob per second, underneath that line, I want something like this:

Code:
command{cmd="ex flag server raid_mob_count:+:1"} @self

(Note: The above command is Denizen)

The problem I'm having at the moment, is that this counter is always at 1, no matter how many spawns there are (this count is also negated as mobs are killed).

I'm curious if there's a way to loop this without spawning a stupid amount of mobs. (I know you can call skills, I think this would be the way forward, but I'm not entirely sure, hence why I'm asking)

Cheers.
You could make the skill call itself.

Like:
Code:
Skill1:
  Skills:
  - command{cmd="ex flag server raid_mob_count:+:1"}
  - delay 10
  - skill{s=Skill1}

Obviously you probably want it to only run a certain number of times, so you could use a scoreboard to keep track of that?
 

jaylawl

Developer
Developer
Community Manager
Premium Supporter
Supporter
Quality Assurance
Joined
Sep 16, 2015
Messages
1,822
just send 1 command, no repeats in mythicmobs, to denizen and let denizen handle the looping of stuff.
 

iTzCascadexX

Member
Premium Supporter
Supporter
Moderator
Quality Assurance
Joined
Nov 2, 2015
Messages
164
You could make the skill call itself.

Like:
Code:
Skill1:
  Skills:
  - command{cmd="ex flag server raid_mob_count:+:1"}
  - delay 10
  - skill{s=Skill1}

Obviously you probably want it to only run a certain number of times, so you could use a scoreboard to keep track of that?

There is an easier way without scoreboards. Simply run a skill on mob spawn to increment the value, and decrement the value on death.

If there's a need for more complicated skills using this method, I'll seek advice on using scoreboards to track that.

Thanks for the hasty response.

(Code example, I'll give it away for free):

Code:
RaidCountIncrement:
Skills:
- command{cmd="ex flag server raid_mob_count:+:1"} @self
- command{cmd="ex narrate '<server.flag[raid_mob_count]>' targets:<[email protected]>"} @self
RaidCountDecrement:
Skills:
- command{cmd="ex flag server raid_mob_count:-:1"} @self
- command{cmd="ex narrate '<server.flag[raid_mob_count]>' targets:<[email protected]>"} @self

(Bare minimum level, the "ex narrate" is for debug, you can ignore that.)

just send 1 command, no repeats in mythicmobs, to denizen and let denizen handle the looping of stuff.

This would work too, however I don't have instant access to Denizen on my Server (I'm not fully knowledgeable with it), I'll forward your reply to the person that does.

Cheers.
 
Top