In response to Oblivian
On 7/18/01 5:20 pm Oblivian wrote:
Remember to put new() in there. It should be : new/obj/knives/knife(src), src is the location and /obj/knives/knife is the type of object to create.
To make it so the player sees all the items he owns inside a statpanel, first do some reading on Stat() proc. In the example for that proc, it shows you how to make it stat the user's inventory. Basically, this is all you would have to do:
mob/Stat()
stat(src.contents)

Simple eh? =)

I did both of those things... and i get an error :
gumbatarena.dm:33:error:/new/obj/knives/knife:bad path

new obj/knives/knife(src)
In response to Oblivian
On 7/18/01 5:20 pm Oblivian wrote:
Remember to put new() in there. It should be : new/obj/knives/knife(src), src is the location and /obj/knives/knife is the type of object to create.
To make it so the player sees all the items he owns inside a statpanel, first do some reading on Stat() proc. In the example for that proc, it shows you how to make it stat the user's inventory. Basically, this is all you would have to do:
mob/Stat()
stat(src.contents)

Simple eh? =)

I did both of those things... and i get an error :
gumbatarena.dm:33:error:/new/obj/knives/knife:bad path

Dont put a slash in front of new. just do this :
new/obj/knives/knife(src)
You might also want to make sure obj/knives/knife is a valid object type, if you have not made the object yet then you will get a similar error saying obj/knives/knife is a bad path.
In response to Ebonshadow
Dont put a slash in front of new. just do this :
new/obj/knives/knife(src)
You might also want to make sure obj/knives/knife is a valid object type, if you have not made the object yet then you will get a similar error saying obj/knives/knife is a bad path.

YAY it finally works!! :) the slash in front of new was the prob..
Thanx for the help all, you all might as well wait a couple of minutes so I can find another question :).
In response to Oblivian
On 7/18/01 5:25 pm Oblivian wrote:
Dont put a slash in front of new. just do this :
new/obj/knives/knife(src)
You might also want to make sure obj/knives/knife is a valid object type, if you have not made the object yet then you will get a similar error saying obj/knives/knife is a bad path.

YAY it finally works!! :) the slash in front of new was the prob..
Thanx for the help all, you all might as well wait a couple of minutes so I can find another question :).

Bring it on!
I can't wait till Dantom starts advertising. So much for being bored all day.
In response to Vortezz
On 7/18/01 5:17 pm Vortezz wrote:
Ack, sorry Deadron.. I always was confused on what to use. So src in all non-verbs, eh?

Yup.

src = the current object

usr = the last player to do something

The problem is, usr is only guaranteed to be the current mob in a verb, when the player must have been the one to activate the verb. All other times you can't be sure. It may work 90% of the time, then not the other 10%.

In particular, it is very likely to work when you debug with only one player, then break when multiple people are playing.

Even if there are specific non-verb functions where it always happens to work, it's just best to get in the habit of using src.
In response to Cinnom
Bring it on!
I can't wait till Dantom starts advertising. So much for being bored all day.
Found one..

When I buy an item it adds not just to the inventory, but also to the equiped.. I just want it in the inventory! :)
Also the items the player starts with is added to the equiped..
In response to Oblivian
On 7/19/01 11:22 am Oblivian wrote:
Bring it on!
I can't wait till Dantom starts advertising. So much for being bored all day.
Found one..

When I buy an item it adds not just to the inventory, but also to the equiped.. I just want it in the inventory! :)
Also the items the player starts with is added to the equiped..

Not my fault, I told you I was only giving you and example of how it would be done. Not a snippet. Im assuming you didn't try to copy and paste the code into your game, so then it would be a problem with your code.
In response to Ebonshadow
Not my fault, I told you I was only giving you and example of how it would be done. Not a snippet. Im assuming you didn't try to copy and paste the code into your game, so then it would be a problem with your code.

I know its problem with my code...
if(usr.cash >= cost)
usr.cash -= cost
if(selling=="adv388")
new/obj/helmets/adv388(usr)
if(selling=="provest")
new/obj/vests/provest(usr) //what you get if you choose this
if(selling=="hel34")
new/obj/helmets/hel34(usr)
if(selling=="j204helmet")
new/obj/helmets/j204helmet(usr)
if(selling=="tarmor")
new/obj/vests/tarmor(usr)

What am I missing?
In response to Oblivian
On 7/19/01 11:34 am Oblivian wrote:
Not my fault, I told you I was only giving you and example of how it would be done. Not a snippet. Im assuming you didn't try to copy and paste the code into your game, so then it would be a problem with your code.

I know its problem with my code...
if(usr.cash >= cost)
usr.cash -= cost
if(selling=="adv388")
new/obj/helmets/adv388(usr)
if(selling=="provest")
new/obj/vests/provest(usr) //what you get if you choose this
if(selling=="hel34")
new/obj/helmets/hel34(usr)
if(selling=="j204helmet")
new/obj/helmets/j204helmet(usr)
if(selling=="tarmor")
new/obj/vests/tarmor(usr)

What am I missing?

nothing, the problem is with your equipment tab. I got a feeling you tried to do a copy-paste job with the example.
On 7/18/01 3:39 pm Oblivian wrote:
To make items start out in your inventory when you log on, what command do I use to do this?

I hate to tell you so at this late date, but there's an even simpler way to make someone start with items! Actually, it's about the same, unless you want more than one item... that's where this really pays off.

src.contents = newlist(/obj/obj1,/obj/obj2,/obj/obj3) and so on, for as many objects as you want.
In response to Ebonshadow
nothing, the problem is with your equipment tab. I got a feeling you tried to do a copy-paste job with the example.

I didn't even use the example u gave me, I am using fireKINGS, and just edited it. So then it's something wrong with his code.
In response to LexyBitch
On 7/19/01 12:22 pm LexyBitch wrote:
On 7/18/01 3:39 pm Oblivian wrote:
To make items start out in your inventory when you log on, what command do I use to do this?

I hate to tell you so at this late date, but there's an even simpler way to make someone start with items! Actually, it's about the same, unless you want more than one item... that's where this really pays off.

src.contents = newlist(/obj/obj1,/obj/obj2,/obj/obj3) and so on, for as many objects as you want.

lol, now you tell me :)
In response to Oblivian
On 7/19/01 12:22 pm Oblivian wrote:
nothing, the problem is with your equipment tab. I got a feeling you tried to do a copy-paste job with the example.

I didn't even use the example u gave me, I am using fireKINGS, and just edited it. So then it's something wrong with his code.

Nonetheless, Oblivian, it is a copy-paste job.
In response to Vortezz
On 7/20/01 5:10 pm Vortezz wrote:
On 7/19/01 12:22 pm Oblivian wrote:
nothing, the problem is with your equipment tab. I got a feeling you tried to do a copy-paste job with the example.

I didn't even use the example u gave me, I am using fireKINGS, and just edited it. So then it's something wrong with his code.

Nonetheless, Oblivian, it is a copy-paste job.

So, I am trying to learn :) im sure u used some copy paste jobs to :P
Page: 1 2