Dizzledorfs

Villager
Member
Joined
Jan 28, 2017
Messages
14
Reaction score
19
First Language
English
Primarily Uses
Hey. I am working on a project in which I would like to encourage the kids to explore the map and click on things. So I am creating a badge system. So, they will get an Explorer Badge Lvl 1 for finding one hidden door and there are 4 hidden, so then they will end up being a Master Explorer when they get Badge Lvl 4. There will also be badges for several other things.

I have figured how to make a badge window appear when they find the spots, and how to make it check how many previously were located so it will know which badge to give the kid. But, now, I am trying to implement a way for them, on the main ESC menu, check which level they are at for each badge.

The menu appears fine in the window, and I have made it tell me which badge I have for each sections they have started. However, I am curious about a something.... There has got to be an easier way to do this than what I have done. See below...
Code:
◆Plugin Command:SetCommonEventMenuSettings Default Setup
◆Plugin Command:ClearCommonEventMenu
◆If:explorationLocations = 1
  ◆Plugin Command:AddCommonEventMenu 21
  ◆
:End
◆If:explorationLocations = 2
  ◆Plugin Command:AddCommonEventMenu 22
  ◆
:End
◆If:explorationLocations = 3
  ◆Plugin Command:AddCommonEventMenu 23
  ◆
:End
◆If:explorationLocations = 4
  ◆Plugin Command:AddCommonEventMenu 24
  ◆
:End
◆If:wildlifeLocations = 1
  ◆Plugin Command:AddCommonEventMenu 31
  ◆
:End
◆If:wildlifeLocations = 2
  ◆Plugin Command:AddCommonEventMenu 32
  ◆
:End
◆If:wildlifeLocations = 3
  ◆Plugin Command:AddCommonEventMenu 33
  ◆
:End
◆If:wildlifeLocations = 4
  ◆Plugin Command:AddCommonEventMenu 34
  ◆
:End
◆If:wildlifeLocations = 5
  ◆Plugin Command:AddCommonEventMenu 35
  ◆
:End
◆If:wildlifeLocations = 6
  ◆Plugin Command:AddCommonEventMenu 36
  ◆
:End
◆If:wildlifeLocations = 7
  ◆Plugin Command:AddCommonEventMenu 37
  ◆
:End
◆If:wildlifeLocations = 8
  ◆Plugin Command:AddCommonEventMenu 38
  ◆
:End
◆Plugin Command:DisableCommonEventMenuCancel
◆Plugin Command:OpenCommonEventMenu

So, as you can see, I have checked each possible outcome for two types of badges and then told it to show that particular Common Event Menu Item. I have them set up as separate common events instead of just one because I want them all to show up each time, just some as ??????? until they have found the items. Is there a way to simplify this code? Typically, in other languages, I would have set up a loop saying
Code:
for(i = 1; i < 8; i++)
{
     tempNumber = "3" + i
     PluginCommand: AddCommentEventMenu [tempNumber]
}

But that doesn't seem to make things happy in here. :) Anyway, sorry I babble, hope someone can help simplify this script.


YEP Menu Manager

YEP Common Event Menu
 

Latest Threads

Latest Posts

Latest Profile Posts

One of these days, I need to find/figure out how to replicate the Brave/Default system. Heheh...
Are ReSTAFFs a thing anymore? Just curious, not sure if this is thread-worthy, so just musing here
Mr_Petue wrote on ATT_Turan's profile.
please explain, why you are voting my commentary negativ.
Mr_Petue wrote on Eliaquim's profile.
please explain, why you are voting my commentary negativ.
Uploaded a new Video today where I play Minecraft "The Bridge" please check it out & let me know what you think of it!

Forum statistics

Threads
115,322
Messages
1,088,946
Members
149,975
Latest member
Jasler7
Top