How would I make enemies spawn in a way, where whenever you enter a map they're chosen from a group, and randomly placed?
like, let's use it like a random encounter, you're walking along and get into an encounter, you get sent to the map, and when you get there, you see MobA, MobB, and MobC, you beat them, getting sent back to your previous location, then end up in another one a little later, and now instead of just those 3, you might see MobA, MobB, and MobD, or 3 MobAs, or 4 MobBs, etc.
I'm a noob at coding, like I've said in the 3(?) other requests I've asked, so help would be much appreciated.
(all other requests were pretty well spaced, so I'm not cluttering anything up or asking for everything >.>...)
ID:156969
Jun 22 2010, 9:12 am
|
|
Jun 22 2010, 10:25 am
|
|
Well, for this you may want to use the HUD for the player. Maybe you would want to move the player during the time when the battle is commencing to a new area, or do something such as make their icon state null and locate them to a new area temporarily. You also have to take in account what would happen if a player decided to log off during this sequence if your game saves.
|
In response to Darkjohn66
|
|
that is very true on the saving part, unfortunately, as a noob, I'm having a somewhat tough time understanding your "use the HUD" comment, I know what a HUD is (heads up display) but how would that help with what I'm looking for?
and the saving, maybe have the random encounter set a variable that resets when they log out so that they go back to their previous location? I've got the random encounter up to getting the player to and from the arena I want to use for the fight, but I'm wanting to know how to spawn the enemies randomly. And on that note, how would I have the game recognize when all the enemies are dead so I can have it send the player back without interrupting the fight? |
In response to JS173
|
|
The reason I made words click-able was with the inclination that you would read them before asking more.
With dieing, that would just be a true and false statement using the !(Not) operator. |
In response to Darkjohn66
|
|
Oh, sorry xD I didn't even notice the click-able words, sorry.
|
In response to Darkjohn66
|
|
OK, having read all the links, I'm still not seeing how a HUD would help with what I'm needing, but at least now I can say I read 'em >.>...also, I already have the random encounter sending the player to the arena, I just need the random spawning, and checking for the death of the NPCs.
I see how the ! operator would help, but that's if I set it up so it counts the number of randomly spawned enemies and set it up to something along the lines of: if(!0) ..() else M.loc=oldloc or something like that right? just trying to learn here. ^.^ |
In response to JS173
|
|
I see. I envisioned something of you going for a Pokemon-style system approach. What I believe that you are going for is building a new area onto the map. Something of a Final Fantasy Approach I am guessing? There is also an example of using this library here by Dession.
|
In response to Darkjohn66
|
|
hmm...yes, Final Fantasy IS closer to my style than Pokemon, but not exactly, I'm not wanting a turn based system, I'm looking for a way to make a map spawn random enemies, it'll be like this:
You appear near the middle, and somewhere in the map(not a big one, but room to run around) enemies will spawn near the walls, you fight like you would in a real-time run around kinda way like most non-random encounter RPG fighting system, Attack verb, skills, etc. used when you want, as long as you have the ability to use them. Once you kill them, or they kill you, you are sent back you your old location, and continue on your way, healing as necessary. I chose this kind of thing, 'cause I asked a few friends what they would like, and out of the choices, this was chosen the most, and I, myself, can't think of one game that uses this type of thing. |
In response to JS173
|
|
Still hoping for help, I've tried everything I can think of, and, unfortunately, none of the other stuff helped (I looked it all over), so I would appreciate help.
At the moment, all I need is some code to have the proc for spawning the mobs choose from all the locations around the player, but not walls, so that the mobs'll spawn at random areas along the walls around the player. If I can get that, I think I can work the rest myself, but having looked through everything I could find, nothing >.>...so, again, would appreciate help. I have the spawning set up to add 1 to a player's kp var(kill points) for every spawned mob, and the proc for the random encounter will continually check it, the kp goes down every time you kill a mob, and when it hits 0 you're sent back to your old loc. but since I can't get it to spawn the mobs like I want, it's all just useless code >.>...(and might not even work right...can't test it without figuring out the rest... |
In response to JS173
|
|
JS173 wrote:
At the moment, all I need is some code to have the proc for spawning the mobs choose from all the locations around the player, but not walls, so that the mobs'll spawn at random areas along the walls around the player. var/list/turfs = list() I have the spawning set up to add 1 to a player's kp var(kill points) for every spawned mob, and the proc for the random encounter will continually check it, the kp goes down every time you kill a mob, and when it hits 0 you're sent back to your old loc. Wrong. The only time the kp variable could possibly change is when you kill a mob. So, instead of continually checking it, ONLY check it when you kill a mob. |
In response to Garthor
|
|
none of you gave me EXACTLY what I wanted, but ,Garthor, yours was close enough for me to figure it out (ALMOST exactly, but with some differences, but, not getting exactly what I want helps me learn by having to figure it out xD) ^.^ thanks to all of you.
Now I'll look into randomly generating a map so I can make the random encounters 1) unique, and 2) not joinable unless you're in a party or something. at the moment, I have 14(well, 15 if you include the boss fights) types of arenas...and they're all actual maps, so using the process I'm using, anyone getting into the same type of encounter will end up in the same arena, and add more enemies to the field.(though won't effect the kills needed to exit the arena.) Again, thanks for the help ^.^ |