ID:272944
Jun 27 2009, 11:01 am
|
|
How do i make a mob switch code like in Pokemon
|
In response to Geldonyetich
|
|
Geldonyetich wrote:
If I had to guess, you're probably referring to swapping Pokemon to and from your team.Want i need is to send the mob on the battle field to the team's box & send a new mob from the team's box to the battle field |
In response to Prf X
|
|
Prf X wrote:
Geldonyetich wrote: .Move() should be able to do this for you. |
In response to Geldonyetich
|
|
Geldonyetich wrote:
Prf X wrote: Is this right? mob/proc because it not working |
In response to Prf X
|
|
I can see two things wrong with that code.
First, input needs to assign its response to something, otherwise it does nothing. Second, Move() is a proc attached to atoms. It doesn't take the atom you're moving, that's implied by which mob you're invoking the proc off of. Rather, it takes the destination as an argument. So your code should look more like this: mob/proc When in doubt, use the F1 key reference in Dream Maker and look up each command you're trying to use. The reference would have both clarified how input() works and how .Move() works. |
In response to Geldonyetich
|
|
Here my mob switch codes & only parts of it works:
mob/proc they all send P to the field & give P all the stat but will not send the mob on the field to the mobs var, it seems to del the mob, Do not need all 4 edit, only need 1 edit, & here my make mobs code & it works: mob/verb/Make_Mobs() <BIG>Thank you</BIG> |
In response to Prf X
|
|
I think the problem is right here:
src.Move(locate(usr.mobs)) I'm pretty sure you can't .Move a mob to a variable you defined. You have to move it to an actual location as defined by by BYOND infrastructure. Like inside turf, mob, or obj. If you really want to use your own data structure for storing these mobs, you can, but what you're essentially going to have to do is create and destroy the mobs while saving their information somewhere else, such as a datum you defined. |
In response to Geldonyetich
|
|
To be more precise, you can Move() into any atom. Assuming usr.mobs is a list, you can't Move() into it.
Speaking of which, don't use usr in procs, original poster. |
In response to Geldonyetich
|
|
Geldonyetich wrote:
I think the problem is right here: > src.Move(locate(usr.mobs)) I'm pretty sure you can't .Move a mob to a variable you defined. You have to move it to an actual location as defined by by BYOND infrastructure. Like inside turf, mob, or obj. How? |
In response to Prf X
|
|
Prf X wrote:
How? Here's the information on how to create datums. Once you know that, consider assigning the important stats to a datum and then del the mobs when you recall them while doing a new to create mobs based off of information stored in datums. |
If I had to guess, you're probably referring to swapping Pokemon to and from your team.
There's many ways to go about it, but the easiest is probably to .Move() the mobs in and out of the player contents list.
Then you'd probably have something in the code of the Pokemon (or whatever) to make sure they don't don't do anything while they're in a player content list. Something like:
Otherwise they'd be doing weird things like trying to move or attack while they're riding around inside the player mob.