- Joined
- May 25, 2012
- Messages
- 17
- Reaction score
- 4
- First Language
- English
- Primarily Uses
Hello,
I was hoping someone with a little more skill might look over my current event design and tell me if it is the best way to implement this idea.
Overall Event Goal: To create a series of 10 search locations, with 5 of the 10 locations randomly containing treasure. As the player searches each location, a NPC character also is searching other locations. I've included the non-parallaxed version of the map below with some quick blobs to indicate potential search locations (in-game, there is a animated sparkle).
My plan was to create a series of 10 switches named DM_t1 through DM_t10 to represent treasure, and DM_s1 through DM_s10 to represent searched. So, at the beginning of the event, I would randomly select 5 events and flip the corresponding "DM_t#" switch. Then, the player would move to a location, and search. Once searched, the corresponding "DM_s#" search switch would flip.
As this is going on, there is an NPC sprite on the map. At each location, when the player searches, the NPC sprite is randomly moved to an unsearched location. The NPC then searches that location. In the end, the NPC and the player will have each search 5 locations.
1. So, I'm not a programmer by any means, but this is how I was thinking no trying to implement this. At the start, select a random number between 1-10. If the "DM_t#" switch for that number is not flipped, then turn it on, if it is already on, select a new number. Do this until 5 switches are on.
2. The player moves to a location, searches and gets the results. After that, a random number is selected again. If the "DM_s#" switch is not ON, then move the NPC character to that location and flip the switch (adjusting their treasure variable in the process if there is treasure). Do this until the number randomly selected corresponds with a location that has not been searched yet.
I think this will work, but I also think I am doing this terribly inefficient. How long is it going to take for the random number system to randomly select the last location? So, the player has searched 5 locations, the NPC 4, meaning only one is left unsearched. Based on this system, the game has to wait until it randomly selects that 1 number (10% chance). Additionally, this method requires setting up a lot of conditional branches as I go. I don't have a problem with that, but again, I think there is probably a easier solution that I am simply overlooking (I'm a noob, what can I say
).
Here is a link to a simple picture, not sure it is even really necessary, but I thought I would include it: http://i.imgur.com/7eGIdkz.jpg
Thanks in advance for any help or ideas! I really appreciate it!
YummyTiger
I was hoping someone with a little more skill might look over my current event design and tell me if it is the best way to implement this idea.
Overall Event Goal: To create a series of 10 search locations, with 5 of the 10 locations randomly containing treasure. As the player searches each location, a NPC character also is searching other locations. I've included the non-parallaxed version of the map below with some quick blobs to indicate potential search locations (in-game, there is a animated sparkle).
My plan was to create a series of 10 switches named DM_t1 through DM_t10 to represent treasure, and DM_s1 through DM_s10 to represent searched. So, at the beginning of the event, I would randomly select 5 events and flip the corresponding "DM_t#" switch. Then, the player would move to a location, and search. Once searched, the corresponding "DM_s#" search switch would flip.
As this is going on, there is an NPC sprite on the map. At each location, when the player searches, the NPC sprite is randomly moved to an unsearched location. The NPC then searches that location. In the end, the NPC and the player will have each search 5 locations.
1. So, I'm not a programmer by any means, but this is how I was thinking no trying to implement this. At the start, select a random number between 1-10. If the "DM_t#" switch for that number is not flipped, then turn it on, if it is already on, select a new number. Do this until 5 switches are on.
2. The player moves to a location, searches and gets the results. After that, a random number is selected again. If the "DM_s#" switch is not ON, then move the NPC character to that location and flip the switch (adjusting their treasure variable in the process if there is treasure). Do this until the number randomly selected corresponds with a location that has not been searched yet.
I think this will work, but I also think I am doing this terribly inefficient. How long is it going to take for the random number system to randomly select the last location? So, the player has searched 5 locations, the NPC 4, meaning only one is left unsearched. Based on this system, the game has to wait until it randomly selects that 1 number (10% chance). Additionally, this method requires setting up a lot of conditional branches as I go. I don't have a problem with that, but again, I think there is probably a easier solution that I am simply overlooking (I'm a noob, what can I say
Here is a link to a simple picture, not sure it is even really necessary, but I thought I would include it: http://i.imgur.com/7eGIdkz.jpg
Thanks in advance for any help or ideas! I really appreciate it!
YummyTiger


