ID:174676
 
How can I stop this in-game error :

runtime error: type mismatch
proc name: Make a guild (/mob/verb/Make_a_guild)
usr: Gokuss4neo (/mob/characters)
src: Gokuss4neo (/mob/characters)
call stack:
Gokuss4neo (/mob/characters): Make a guild("Guild")

Thankz

~GokuSS4Neo~
Please Help!

~GokuSS4Neo~

(Sorry for the bump but I really needed it, and I have waited an hour!)
In response to Gokuss4neo
Gokuss4neo wrote:
Please Help!

~GokuSS4Neo~

(Sorry for the bump but I really needed it, and I have waited an hour!)

You really need to learn the forum rules

Your not allowed to bump a post unless 24 hours (Exactly) has past, and its not on the main page
In response to Wanabe
I thought it was 1 hour!!! Oops sorry!

~GokuSS4Neo~
In response to Gokuss4neo
Check the procedure, make a guild. The error means that your trying to give a variable a value its type wont permit.

Exemple:
var/number as num
number="Hello"

The probleme here is the variable number is declared as a num, or number. This means the variable is made to hold only numbers and not to hold text. Here, I give a num variable text which will give me a type mismatch error. There are 3 solutions I can see:

1. Change the data you input
var/number as num
number=6

2. Change the variable type
var/number as text
number="Hello"

3. Dont specifie a type
var/number
number="Hello"

(One thing I dont know, and if someone could tell me, if I give number a numerical number, will I be able to use it later as text? Ex:
var/number
number=6
number="Hello")
In response to FranquiBoy
Sorry but I cannot find any incorrect Variables, here is my code:

mob
verb
Make_a_guild(msg as text)
set category = "Communication"
if(usr.Guild=="N/A")
if(usr.Gold>= 20000)
alert("This cost 20,000 Gold!")
alert("Are you sure you want to do this, money is NOT refundable!")
switch(input("Are you sure you want to make a Guild?","Create Guild",text) in list ("Yes","No"))
if("Yes")
usr<<"Ok!"
usr.Gold -= 20000
src.Guild = "[msg]"
usr<<"Your Guild is created!"
src.verbs+=typesof(/mob/Guild_Basic_Member/verb/)
src.verbs += /mob/Guild_Leader/verb/Invite_New_Member
src.verbs += /mob/Guild_Leader/verb/Kick_Guild_Member
src.verbs += /mob/Guild_Leader/verb/Guild_Leader_Say
src.verbs += /mob/Guild_Leader/verb/Make_a_new_Leader
world<<"[msg] Guild has been created by [usr]!"
if("No")
usr.Gold -= 0
usr<<"that is fine"
else
usr<<"Sorry you do not have enough Gold! You need 20,000!"

else
usr<<"Sorry you are already in a Guild!"


~GokuSS4Neo~
In response to Gokuss4neo
I can't see anything wrong with the variables either! Maybe it's something else...

-=RoMkAbAnT=-
In response to Gokuss4neo
Gokuss4neo wrote:
mob
verb
Make_a_guild(msg as text)
set category = "Communication"
if(usr.Guild=="N/A")
if(usr.Gold>= 20000)
alert("This cost 20,000 Gold!") //I use alert as an input method, try this: var/tmp/somevariable=alert("This cost 20,000 Gold!","Ok")
alert("Are you sure you want to do this, money is NOT refundable!") //Same Here
switch(input("Are you sure you want to make a Guild?","Create Guild",text) in list ("Yes","No")) //And I dont trust that text, I would take it out, then see if it works
if("Yes")
usr<<"Ok!"
usr.Gold -= 20000
src.Guild = "[msg]"
usr<<"Your Guild is created!"
src.verbs+=typesof(/mob/Guild_Basic_Member/verb/)
src.verbs += /mob/Guild_Leader/verb/Invite_New_Member
src.verbs += /mob/Guild_Leader/verb/Kick_Guild_Member
src.verbs += /mob/Guild_Leader/verb/Guild_Leader_Say
src.verbs += /mob/Guild_Leader/verb/Make_a_new_Leader
world<<"[msg] Guild has been created by [usr]!"
if("No")
usr.Gold -= 0
usr<<"that is fine"
else
usr<<"Sorry you do not have enough Gold! You need 20,000!"

else
usr<<"Sorry you are already in a Guild!"


~GokuSS4Neo~
In response to FranquiBoy
They are not the problem (I have tested them as you said, and how I had them originally and got the same error)

In-game I don't even get to the Alerts! After entering the GUild Name it stops and gives me the error I put in the first post!

~GokuSS4Neo~
In response to Gokuss4neo
Check usr.Guild and usr.Gold, post the code were they are declared
In response to FranquiBoy
atom/movable
var
Gold = "40000"
mob
var
Guild = "N/A" as text

~GokuSS4Neo~
In response to Gokuss4neo
You assigned Gold a text value, and you check for numerical value, type mismatch! Instead of Gold="40000" use Gold=40000
In response to FranquiBoy
Thank YOU!!!!
You not only helped me, but every other N00b that might want a Guild Demo!!!

You shall be in the credits!!!

~GokuSS4Neo~

P.S Thankz!