ID:178978
 
How do I make it so when you begin your game you start out with an Item?
mob
mobname
Login()
new /obj/objectname(usr)


i think thats how you do it...
In response to Canar
Canar wrote:
mob
mobname
Login()
new /obj/objectname(usr)

i think thats how you do it...

Although usr should work in mob.Login(), they say, I think it's a very very very bad idea to use it there. Always use src unless you're in a verb.

Lummox JR
In response to Lummox JR
i forgot about that. I usually do i don't know why I put it there.
In response to Lummox JR
Ok................... Heres code.
mob
BeeM
icon = 'Male Bee.dmi'
MagicStrength = 4
Now how the heck do I add it so you get an Item,
like, when you enter the game you get honey!?
In response to Watabou
mob/Login()
..()
new /obj/honey(src)
In response to Watabou
are you sure it doesnt work because it works when I do it.
let me see what you put and what errors you got.
In response to Foomer
BeeM
icon = 'Male Bee.dmi'
MagicStrength = 4
BeeF
icon = 'Female Bee.dmi'
MagicStrength = 4
AdventurerM
icon = 'Male Adventurer 1.dmi'
Strength = 7
AdventurerF
icon = 'Female Adventurer.dmi'
Strength = 7

How do you make BOTH BEES get honey and BOTH ADVENTURERS get a gun?
In response to Watabou
Watabou wrote:

How do you make BOTH BEES get honey and BOTH ADVENTURERS get a gun?

Why don't you try the code that was given to you in BOTH places?
In response to Skysaw
Eh?
In response to Watabou
Watabou wrote:
Eh?

I repeat, for the reading impaired: [link]
In response to Skysaw
In response to Watabou
I think what he was trying to say that you obviously dont get is that two ways have been given to you. both work you just did something wrong.
In response to Watabou
Watabou wrote:
BeeM
icon = 'Male Bee.dmi'
MagicStrength = 4
BeeF
icon = 'Female Bee.dmi'
MagicStrength = 4
AdventurerM
icon = 'Male Adventurer 1.dmi'
Strength = 7
AdventurerF
icon = 'Female Adventurer.dmi'
Strength = 7

How do you make BOTH BEES get honey and BOTH ADVENTURERS get a gun?

Try this:
mob
var/list/startitems

New()
..()
if(startitems)
for(var/itemtype in startitems)
if(ispath(itemtype)) new itemtype(src)
else if(isnum(itemtype)) money=itemtype

Bee
startitems=list(/obj/honey)
MagicStrength=4
Adventurer
startitems=list(50,/obj/gun,/obj/flashlight)
MagicStrength=7

I strongly recommend against using barely-different classes like BeeM and BeeF to do the same thing; you end up wasting a lot of space by coding everything twice. Usually gender can be stated with a few simple var changes; if that won't do, then create subtypes like /mob/Bee/male and /mob/Adventurer/female.

Lummox JR