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~
ID:174676
![]() Jul 26 2003, 12:19 pm (Edited on Jul 26 2003, 12:50 pm)
|
|
Gokuss4neo wrote:
Please Help! 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 |
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") |
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~ |
Gokuss4neo wrote:
mob |
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~ |
You assigned Gold a text value, and you check for numerical value, type mismatch! Instead of Gold="40000" use Gold=40000
|
~GokuSS4Neo~
(Sorry for the bump but I really needed it, and I have waited an hour!)