Code:
Problem description:
see im working on this project that is pokemon, and i have issues with runtime error: BYOND Error: bad mob
proc name: Read (/mob/Read)
usr: null
src:
call stack:
Read(Players/louisthe10.sav (/savefile))
Menu()
Menu (5,9,1) (/turf/Menu): Click(Menu (5,9,1) (/turf/Menu), "Main.map1", "icon-x=1;icon-y=20;left=1;scre...")
I know its because im saving a mob (the pokemon) under the mob the client.
ID:2129406
Aug 9 2016, 4:38 pm
|
|
In response to Lummox JR
|
|
their pretty basic and standard and i dont want a advanced system. i like the k.i.s.s keep it simple stupid method because im still a rookie. and i also like things compressed. small as they can possibly be.
mob/proc i had this in another post but they guy didn't really explain anything to a point where i could understand. i want to keep it the way it as it worked for other games. the problem only persists of getting a bad mob after you get your starter Pokemon. i have used similar save code for another project and it worked fine. i think its just because Im saving mobs under mobs. by the way thank you for taking your time to read this and help me, ive been stuck on this for days on end. trying different systems and this was most efficient for me. Could it be because Pokemon mobs are labeled as mob/Pokemon and the vars are labed as just mobs? and i need some notes to help me understand certain functions. please and thank you. |
This will obviously depend on how you want to call back on their Pokemon but...
You can use a list of mobs for the player's Pokemon (this is if you have defined your Pokemon as mobs) mob Then when the player chooses a starter you can save that starter into their Pokemon list. mob Now as long as you don't define the variables as tmp they will save your pokemon. This is just an idea of how it would work, I am sure there are better ways out there... |
In response to Nailez
|
|
Nailez wrote:
mob/PartyPokemon[6] = list(null, null, null, null, null, null) This is called double-initialization because the [6] already initializes the variable as a list of 6 nulls. The verbose, non-square-bracket syntax is: var list/PartyPokemon = new /list (6) |
There's goto abuse in that code. You should have it in a while loop, and continue instead of goto.
|
In response to Nailez
|
|
runtime error: cannot write to indexed value in this type of list
proc name: SelectStarter (/mob/proc/SelectStarter) usr: (src) src: Demon (/mob) src.loc: Floor10 (59,65,2) (/turf/Floor10) call stack: Demon (/mob): SelectStarter(null) Prof Shinn (/mob/Prof_Shinn): Talk() mob However it did elmeinate the bad mob runtime error so thank you but now i got a new one xD |
In response to Nailez
|
|
mob/var i think i know why its not working but what should it look like. in the current code it sets as usr.PkmInven++. how do i code it so the max can be 6? |
Okay so in this code:
src.PkmInInven[1] = SelectedPokemon Your trying to set the PkmInInven to the Pokemon. But I just put that as an example, you don't need to put that. The error your getting is because your trying to set the first item in the PkmInInven list as the selected pokemon but you cant because PkmInInve is not defined as a list. So SelectStarter should look like this: mob |
As for limiting the amount of pokemon you can have...
If pokemonlist is the list of pokemon in the party (which is limited to 6) then you can do a check to see if pokemonlist length is < 6 when you add a pokemon to it. if(pokemonlist.len < 6) There are probably other ways as well. |
In response to Lummox JR
|
|
so instead of goto(MENU)
i do While(MENU)? |
Maybe something like:
mob And everywhere you have not put goto(MAINMENU) you put CanContinue = 1 and remove goto(MAINMENU) So for your "Load" part if("Load") I'll let you fix up the rest of the proc. |
now i have another issue. should i post it in here sense its related to the list issue?
|
And than just simple load character and list should be also loaded.