ID:264060
 
client/base_num_characters_allowed = 3

world
mob = /mob/create_character

mob/create_character
var/mob/character
Login()
var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what skills you get in the game.","Character Background?") in list("Warrior","Cleric","Magician"))
if ("Warrior")
character = new /mob/You/Warrior()
if ("Cleric")
character = new /mob/You/Cleric()
if ("Magician")
character = new /mob/You/Magician()
character.name = charactername
src.client.mob = character
if(character.gender=="female")
character.icon_state="2"
character.loc=locate (2,2,1)
world<<"[character] has logged in!"
del(src)
..()



OK HERES WHAT POPS UP WHEN I CLICK COMPILE

PROBLEM 1
base_num_characters_allowed:warning: use of base_num_characters_allowed precedes its definition


PROBLEM 2
base_num_characters_allowed :warning: definition is here



PLZ HELP I REALLY NEED IT I FEEL LIKE STOMPIN ALL ON THIS LAPTOP....


OK I DUBBLED CLICKED AND THIS IS THE PROBLEM client/base_num_characters_allowed = 3
WHAT DO U MEAN I LISTED PROBLEM AT BOTTOM?
In response to Sesshomaru Yokai
step 1. dont use libraries, write things yourself (in regards to deadrons basecamp save system)
step 2. that code looks like its from ham warriors rpg starter, you might as well use my improved version of it if youre going to do that http://www.byond.com/games/Falacy/RPGStarter
Typing in all caps is obnoxious. Don't do it.
In response to Garthor
sorry garthor i was waiting for u to come to my thred!! but yeh u think u can help me out??
In response to Falacy
Falacy wrote:
step 1. dont use libraries, write things yourself (in regards to deadrons basecamp save system)

Libraries are made to be used, as they're prewritten things that are already better than what most people can do. Don't give terribly bad advice.

step 2. that code looks like its from ham warriors rpg starter, you might as well use my improved version of it if youre going to do that http://www.byond.com/games/Falacy/RPGStarter

As I said already, don't give bad advice. He should use Your First World or Step BYOND instead.
In response to Popisfizzy
Popisfizzy wrote:
Libraries are made to be used, as they're prewritten things that are already better than what most people can do. Don't give terribly bad advice.

Libraries are made for prefab situations, and if you were a half decent coder in the time it'd take you to figure out how to use somebodys library you could write your own code to do whatever you needed to do

As I said already, don't give bad advice. He should use Your First World or Step BYOND instead.

you can babel about those 2 things all you want, if youd actualy look at mine youd see its better then both of them. but whatever, go back to being useless Fizzle, you're the one that needs to stop giving bad advice
In response to Popisfizzy
i didnt ask for that help i asked if someone could tell me what to do to keep that from popin up the warning thingy
In response to Falacy
A good library is made to be dynamic, to fit to any situation. For example, my radix library will work for most situations that require a different base, unless you wish to have relatively exotic bases, like negative, fractional, or non-real bases, or wish to have negative numbers represented in a different way (like how negatives in binary are represented). Save for the last situation, my library covers a large percentage of the cases. Other libraries, like Lummox JR's SwapMaps and Theodis' Pathfinder are set up to work in almost all given situations, save for the most obscure. Both are complex enough that most people could not get anywhere close to implementing them, as well.

I've also seen your RPG Starter. It's, at best, mediocre in every aspect. It's a rip-off of a previously-existing, still terrible, library, with minor modifications made. It teaches poor programming habits, and it's just not good. Dantom and Deadron's library are, all-around, superior to yours/whoever's your ripped it off from.

Oh, and on that last bit about "bad" help. How is my help somehow bad when every bit of code I've posted in the last several months, and likely spanning long before that, has been much, much better than what you've posted?
In response to Popisfizzy
ok good then if u know how to use libraries plz tell me what to type in plz man
Firstly, next time you post code show it in <dm> tags, so that it's highlighted and easier to read (and won't have problems with HTML being unparsed).

Now, both of those errors stem from the same problem: fix the problem and both errors go away. What seems to be happening is that you're defining /client.base_num_characters_allowed twice. The first definition is in Deadron's library, so the second definition is somewhere in your code. Look for something like this:
client/var/base_num_characters_allowed

And remove the var bit.

If that doesn't fix your problem, you must have another error somewhere, which is somehow causing this one.
In response to Popisfizzy
ok i did that and it worked but now i have a diffrent problem the same pop up box keeps coming up create char loadchar when i click either one of them the same box pops up
In response to Sesshomaru Yokai
Post your current code in <dm> tags to make it easier for others to help you. I've not used this library, so I don't know how it works. Others may be more informed.
In response to Popisfizzy
sigh ok
Code:
client/var/base_num_characters_allowed = 3

world
mob = /mob/create_character

mob/create_character
var/mob/character
Login()
var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what skills you get in the game.","Character Background?") in list("Warrior","Cleric","Magician"))
if ("Inuyasha")
character = new /mob/You/Warrior()
if ("Kagome")
character = new /mob/You/Cleric()
if ("Sesshomaru")
character = new /mob/You/Magician()
character.name = charactername
src.client.mob = character
if(character.gender=="female")
character.icon_state="2"
character.loc=locate (2,2,1)
world<<"<B>[character] has logged in!"
del(src)
..()


when i log in the popup box pops up createchar loadchar delete char and when i click 1 of them it pops again... :

In response to Sesshomaru Yokai
Are you using programs from old posts on the Code Problems board?
You know, it's probably not the best idea to use code that people are having PROBLEMS with.

edit:
Also, the problem is that when you connect a player to a new mob, it calls mob/Login for that mob.
So you're going to have to either make sure it doesn't call it again if they're already logged-in, or change the default mob type and make that mob type have the "new character" Login() procedure.
In response to Keeth
no this is from deadron library..
In response to Sesshomaru Yokai
Sesshomaru Yokai wrote:
Code:
client/var/base_num_characters_allowed = 3
>
> world
> mob = /mob/create_character
>
> mob/create_character
> var/mob/character
> Login()
> var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
> switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what skills you get in the game.","Character Background?") in list("Warrior","Cleric","Magician"))
> if ("Inuyasha")
> character = new /mob/You/Warrior()
> if ("Kagome")
> character = new /mob/You/Cleric()
> if ("Sesshomaru")
> character = new /mob/You/Magician()
> character.name = charactername
> src.client.mob = character
> if(character.gender=="female")
> character.icon_state="2"
> character.loc=locate (2,2,1)
> world<<"<B>[character] has logged in!"
> del(src)
> ..()
>

when i log in the popup box pops up createchar loadchar delete char and when i click 1 of them it pops again... :

Hehehe. Some day, you'll laugh at this post. (I made numerous easy mistakes when I started out in BYOND though, so don't sweat it)

What's going on is that you're calling mob.New() in mob/PC, but you're still calling it from mob/create_character, which in turn calls its Login() again.

So every time you click the button, you are logged into another mob. You have an infinite loop.

//WARNING! CODE UNTESTED AND UNFORMATTED!
//THIS CODE IS FUNKED SEE MY REPLY TO MY OWN POST!

client/var/base_num_characters_allowed = 3

world
mob = /mob/create_character

mob/create_character
var/mob/character
Login()
var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what skills you get in the game.","Character Background?") in list("Warrior","Cleric","Magician"))
if ("Inuyasha")
character = new /mob/PC/Warrior()
if ("Kagome")
character = new /mob/PC/Cleric()
if ("Sesshomaru")
character = new /mob/PC/Magician()
character.name = charactername
del src.client.mob //you need to delete the current mob, otherwise you'll continue to call Login() from this mob as well
src.client.mob = character //Edit* I must have been really tired when I wrote this because I never would have used src in a verb otherwise
if(character.gender=="female")
character.icon_state="2"
character.loc=locate (2,2,1)
world<<"<B>[character] has logged in!"
del(src)
..()


I changed /You to /PC, because You may not technically be you when you debug more complicated code, and that can be confusing at 3 in the morning and you've been coding for 4 hours. PC = player character

Good luck making the Inyasha game. My wife loves that show, so for her sake I hope it turns out great.
In response to Rockinawsome
kk ty man
In response to Rockinawsome
What? No, that's totally wrong, and what you are suggesting would just disconnect the player.
Page: 1 2