ID:142660
 
Code:
mob/Login()
if(!loc) Move(locate(/area/Hong_Kong))
return ..()

mob
var/first = 0

area/Hong_Kong
name="Hong Kong"
desc="A sliver of land, controlled by the British, in China."
Entered(O)
if (mob/var/first==0)
O << "You start your merchant business in Hong Kong."
return ..()
else
O << "Welcome to Hong Kong."
verb/goto_Tokyo()
if(loc) Move(locate(/area/Tokyo))
first= mob/var/first + 1
return

/area/Tokyo
name="Tokyo"
verb/goto_Hongkong()
if(loc) Move(locate(/area/Hong_Kong))
return
////////////////////////

area/var/stablity = 100

area/var/armssup = 25//arms in inventories

area/var/armsprod = 15//production of arms

area/var/armsdemnd = 10//demand for arms


Problem description:
loading Taipan.dme
Taipan.dm:13:error:mob:undefined var
Taipan.dm:13:error:var/first:undefined var
Taipan.dm:19:error:Move:undefined proc
Taipan.dm:20:error:first:undefined var
Taipan.dm:20:error:mob:undefined var
Taipan.dm:20:error:var/first:undefined var
Taipan.dm:26:error:Move:undefined proc

Taipan.dmb - 7 errors, 0 warnings (double-click on an error to jump to it)


I absolutely cannot figure out what is wrong.
What's wrong is exactly what it says is wrong. What you're doing for where it says "mob: undefined var" is trying to divide mob by var/first. To define a path(and you already know this), you put /atom. So use /mob/ for paths. However, that isn't going to fix it. You want to use the variable you already defined, so use usr.first. You also used == 0, which can be a problem - use !usr.first or usr.first == FALSE.

As for Move being an undefined proc, you must define something to move. In this case you would use src since it is not a mob verb - In other words, use src.Move.
        if (mob/var/first==0)


This is wrong. You need to do this:

if(ismob(O))
var/mob/M = O
if(M.first == 0)
//etc...


And where you are getting the Move() errors, you need to change those to usr.Move(). usr is valid in verbs.
In response to Darkmag1c1an11
usr is not valid in Entered(). Don't suggest he use it there.
In response to Garthor
Didn't realize it was in Entered() when I posted. I'm sure he would've been able to figure it out.
In response to Darkmag1c1an11
Darkmag1c1an11 wrote:
Didn't realize it was in Entered() when I posted. I'm sure he would've been able to figure it out.

"I absolutely cannot figure out what is wrong."

Surely that sentence should tell you everything.
In response to Garthor
Garthor wrote:
        if (mob/var/first==0)

This is wrong. You need to do this:

if(ismob(O))
> var/mob/M = O
> if(M.first == 0)
> //etc...

And where you are getting the Move() errors, you need to change those to usr.Move(). usr is valid in verbs.


Thank you.
In response to Garthor
mob/Login()
if(!loc) Move(locate(/area/Hong_Kong))
return ..()

mob
var/first = 0

area/Hong_Kong
name="Hong Kong"
desc="A sliver of land, controlled by the British, in China."
Entered(O)
if(ismob(O))
var/mob/M = O
if(M.first = 0)
O << "You start your merchant business in Hong Kong."
return ..()
else
O << "Welcome to Hong Kong."
verb/goto_Tokyo()
if(loc) usr.Move(locate(/area/Tokyo))
first= mob/var/first + 1
return

/area/Tokyo
name="Tokyo"
verb/goto_Hongkong()
if(loc) usr.Move(locate(/area/Hong_Kong))
return
////////////////////////

area/var/stablity = 100

area/var/armssup = 25//arms in inventories

area/var/armsprod = 15//production of arms

area/var/armsdemnd = 10//demand for arms



loading Taipan.dme
Taipan.dm:13:error:O:value not allowed here
Taipan.dm:13:error::empty type name (indentation error?)
Taipan.dm:14:error:O:undefined var
Taipan.dm:14:error:= :expected a constant expression
Taipan.dm:15:error::empty type name (indentation error?)
Taipan.dm:16:error::duplicate definition
Taipan.dm:16:error:O:duplicate definition
Taipan.dm:16:error:"You start your merchant business in Hong Kong.":duplicate definition
Taipan.dm:16:error:<< :instruction not allowed here
Taipan.dm:17:error:..:instruction not allowed here
Taipan.dm:17:error:return :instruction not allowed here
Taipan.dm:17:error::duplicate definition
Taipan.dm:19:error:O:duplicate definition
Taipan.dm:19:error:"Welcome to Hong Kong.":duplicate definition
Taipan.dm:19:error:<< :instruction not allowed here
Taipan.dm:14:error::empty type name (indentation error?)
Taipan.dm:22:error:first:undefined var
Taipan.dm:22:error:mob:undefined var
Taipan.dm:22:error:var/first:undefined var

Taipan.dmb - 19 errors, 0 warnings (double-click on an error to jump to it)
In response to Ryackov
If that sentence is the absolute truth, then you aren't a competent coder.
In response to Darkmag1c1an11
Darkmag1c1an11 wrote:
If that sentence is the absolute truth, then you aren't a competent coder.
I'm still learning. I've figured out how to cut down on some bugs:
mob/Login()
if(!loc) Move(locate(/area/Hong_Kong))
return ..()

mob
var
first = 0

area/Hong_Kong
name="Hong Kong"
desc="A sliver of land, controlled by the British, in China."
Entered(O)
if(src.first = 0)
O << "You start your merchant business in Hong Kong."
return ..()
else
O << "Welcome to Hong Kong."
verb/goto_Tokyo()
if(loc) usr.Move(locate(/area/Tokyo))
first= src.first + 1
return

/area/Tokyo
name="Tokyo"
verb/goto_Hongkong()
if(loc) usr.Move(locate(/area/Hong_Kong))
return
////////////////////////

area/var/stablity = 100

area/var/armssup = 25//arms in inventories

area/var/armsprod = 15//production of arms

area/var/armsdemnd = 10//demand for arms

loading Taipan.dme
Taipan.dm:14:error:src.first:undefined var
Taipan.dm:14:error::empty type name (indentation error?)
Taipan.dm:15:error:O:duplicate definition
Taipan.dm:15:error:"You start your merchant business in Hong Kong.":duplicate definition
Taipan.dm:15:error:<< :instruction not allowed here
Taipan.dm:16:error:..:instruction not allowed here
Taipan.dm:16:error:return :instruction not allowed here
Taipan.dm:16:error::empty type name (indentation error?)
Taipan.dm:18:error:O:duplicate definition
Taipan.dm:18:error:"Welcome to Hong Kong.":duplicate definition
Taipan.dm:18:error:<< :instruction not allowed here
Taipan.dm:15:error::empty type name (indentation error?)
Taipan.dm:21:error:first:undefined var
Taipan.dm:21:error:src.first:undefined var

Taipan.dmb - 14 errors, 0 warnings (double-click on an error to jump to it)