ID:180001
 
Ive got this code and it moves the shopkeeper not the item to the inventory how would i move the item to the inventory?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")
if("Nothing")
return 0
usr<<"Cya come again!"
Valderalgx wrote:
Ive got this code and it moves the shopkeeper not the item to the inventory how would i move the item to the inventory?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")
if("Nothing")
return 0
usr<<"Cya come again!"

doesn't look like it moves anything anywhere.

where's the move statement?
In response to Skysaw
Skysaw wrote:
Valderalgx wrote:
Ive got this code and it moves the shopkeeper not the item to the inventory how would i move the item to the inventory?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")
if("Nothing")
return 0
usr<<"Cya come again!"

doesn't look like it moves anything anywhere.

where's the move statement?

oops here is the code

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list (Scouter","Nothing"))
if("Scouter")src.Move(usr)
if("Nothing")
return 0
usr<<"Cya come again!"

There
In response to Valderalgx
Valderalgx wrote:
Skysaw wrote:
Valderalgx wrote:
Ive got this code and it moves the shopkeeper not the item to the inventory how would i move the item to the inventory?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")
if("Nothing")
return 0
usr<<"Cya come again!"

doesn't look like it moves anything anywhere.

where's the move statement?

oops here is the code

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list (Scouter","Nothing"))
if("Scouter")src.Move(usr)
if("Nothing")
return 0
usr<<"Cya come again!"

There

src.Move(usr) moves the source to the user, none of those has to do with any kind of object.I suggest you read up on some basics first. (FAQ, Guide, Reference, Look at some demos, tutorials, and Libraries)

Alathon
In response to Valderalgx
Valderalgx wrote:
mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list (Scouter","Nothing"))
if("Scouter")src.Move(usr)
if("Nothing")
return 0
usr<<"Cya come again!"

The reason the shopkeeper is the one that's moving is because the shopkeeper is src. What you probably want to do is create a new object for "Scouter", and then move that into usr.

Lummox JR
In response to Alathon
Alathon wrote:
Valderalgx wrote:
Skysaw wrote:
Valderalgx wrote:
Ive got this code and it moves the shopkeeper not the item to the inventory how would i move the item to the inventory?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")
if("Nothing")
return 0
usr<<"Cya come again!"

doesn't look like it moves anything anywhere.

where's the move statement?

oops here is the code

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list (Scouter","Nothing"))
if("Scouter")src.Move(usr)
if("Nothing")
return 0
usr<<"Cya come again!"

There

src.Move(usr) moves the source to the user, none of those has to do with any kind of object.I suggest you read up on some basics first. (FAQ, Guide, Reference, Look at some demos, tutorials, and Libraries)

Alathon



ok, now why wont this work?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")/obj/scouter.loc=locate(usr)
if("Nothing")
return 0
usr<<"Cya come again!"




obj/scouter
In response to Valderalgx
Valderalgx wrote:
Alathon wrote:
Valderalgx wrote:
Skysaw wrote:
Valderalgx wrote:
Ive got this code and it moves the shopkeeper not the item to the inventory how would i move the item to the inventory?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")
if("Nothing")
return 0
usr<<"Cya come again!"

doesn't look like it moves anything anywhere.

where's the move statement?

oops here is the code

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list (Scouter","Nothing"))
if("Scouter")src.Move(usr)
if("Nothing")
return 0
usr<<"Cya come again!"

There

src.Move(usr) moves the source to the user, none of those has to do with any kind of object.I suggest you read up on some basics first. (FAQ, Guide, Reference, Look at some demos, tutorials, and Libraries)

Alathon



ok, now why wont this work?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")/obj/scouter.loc=locate(usr)
if("Nothing")
return 0
usr<<"Cya come again!"




obj/scouter

Read up on the "new" proc in the reference. Here's a handy-dandy link for you: http://www.byond.com/docs/ref/info.html#/proc/new
In response to Skysaw
Skysaw wrote:
Valderalgx wrote:
Alathon wrote:
Valderalgx wrote:
Skysaw wrote:
Valderalgx wrote:
Ive got this code and it moves the shopkeeper not the item to the inventory how would i move the item to the inventory?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")
if("Nothing")
return 0
usr<<"Cya come again!"

doesn't look like it moves anything anywhere.

where's the move statement?

oops here is the code

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list (Scouter","Nothing"))
if("Scouter")src.Move(usr)
if("Nothing")
return 0
usr<<"Cya come again!"

There

src.Move(usr) moves the source to the user, none of those has to do with any kind of object.I suggest you read up on some basics first. (FAQ, Guide, Reference, Look at some demos, tutorials, and Libraries)

Alathon



ok, now why wont this work?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")/obj/scouter.loc=locate(usr)
if("Nothing")
return 0
usr<<"Cya come again!"




obj/scouter

Read up on the "new" proc in the reference. Here's a handy-dandy link for you: http://www.byond.com/docs/ref/info.html#/proc/new

ok so now i have
mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")var/obj/scouter = new(src)
if("Nothing")
usr<<"Cya come again!"
return 0


obj/scouter

and it gives me this:Shop2.dm:9:scouter :warning: variable defined but not used
In response to Valderalgx
Skysaw wrote:
Valderalgx wrote:
Alathon wrote:
Valderalgx wrote:
Skysaw wrote:
Valderalgx wrote:
Ive got this code and it moves the shopkeeper not the item to the inventory how would i move the item to the inventory?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")
if("Nothing")
return 0
usr<<"Cya come again!"

doesn't look like it moves anything anywhere.

where's the move statement?

oops here is the code

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list (Scouter","Nothing"))
if("Scouter")src.Move(usr)
if("Nothing")
return 0
usr<<"Cya come again!"

There

src.Move(usr) moves the source to the user, none of those has to do with any kind of object.I suggest you read up on some basics first. (FAQ, Guide, Reference, Look at some demos, tutorials, and Libraries)

Alathon



ok, now why wont this work?

mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")/obj/scouter.loc=locate(usr)
if("Nothing")
return 0
usr<<"Cya come again!"




obj/scouter

Read up on the "new" proc in the reference. Here's a >handy-dandy link for you: >http://www.byond.com/docs/ref/info.html#/proc/new

ok so now i have
mob/shopkeeper/Click()
switch(input("Item","What do you want?") in list("Scouter","Nothing"))
if("Scouter")var/obj/scouter = new(src)
if("Nothing")
usr<<"Cya come again!"
return 0


obj/scouter

and it gives me this:Shop2.dm:9:scouter :warning: variable defined but not used

How would i make scouter locates in the usr's inventory if they hit scouter?
In response to Valderalgx
Try something along the lines of this:

if("Scouter")
new/obj/Scouter(usr)
In response to Nadrew
Nadrew wrote:
Try something along the lines of this:

if("Scouter")
new/obj/Scouter(usr)

OHHHH! I got VERY close, but i guess precision matters. Thanks!
In response to Valderalgx
Valderalgx wrote:
Nadrew wrote:
Try something along the lines of this:

if("Scouter")
new/obj/Scouter(usr)

OHHHH! I got VERY close, but i guess precision matters. Thanks!

No problem,but I still disagree with you making a dbz game but oh well do as you please.