ID:163759
 
I tried coding in equiping weaps but it doesnet work?? can someone plz help me by showing me a example.
my weapons icon files are

obj
boukuto
icon = 'obj.dmi'
icon_state = "boukuto"
no one is going to code your game for you. so dont expect you to be able to copy | paste and it be 100% successful. just letting you know.
In response to Jman9901
Lol i am not asking anyone 2 it just i am having problems with this i dint mean to make it look lie i wanted somen to do it for me. but can u still help me and u can use any example?
In response to Shirukai
Try the Forum Search, it is there for a reason
In response to Shirukai
mob
var
Equip
WName
obj
Item
Boukuto
icon = 'obj.dmi'
icon_state = "boukuto"
name="Boukuto"
verb
Equip()
if(usr.Equip==1)
usr<<"Already have a weapon on."
if(usr.Equip==0)
usr.Equip=1
usr.WName="Boukuto"
Unequip()
if(usr.Equip==1)
usr.Equip=0
usr.WName=""
if(usr.Equip==0)
usr<<"You dont have anything on."

Its a rather basic example but if you work with it an edit it an play with it a bit you can make it work. It wont be much help because it doesnt add to your attack or anything like that because I didnt define anything like that. o.O

Keep in mind that its not really ment to be used in a game its mostly just an example. I myself would have coded it alot dif if I was going to use it in a game. o.O Anyway yah... XD
In response to Ac19189
That's a horrible system, learn how to use Boolean:
http://bwicki.byond.com/ByondBwicki.dmb?TrueFalse

That way, instead of making two variables, one for checking if it is equipped and another of the name of the item, you can have one variable with the item in question assigned to it.
In response to Ac19189
When he wants to add more weapons, the code file will be in a pretty bad shape using that code. Concept is right, but it could be so much less. And what Ghost said.

mob
var
Equip
WName
obj
Item
Boukuto
icon = 'obj.dmi'
icon_state = "boukuto"
name="Boukuto"
verb
Equip()
if(usr.Equip==1)
usr<<"Already have a weapon on."
if(usr.Equip==0)
usr.Equip=1
usr.WName="[name]"
Unequip()
if(usr.Equip==1)
usr.Equip=0
usr.WName=""
if(usr.Equip==0)
usr<<"You dont have anything on."


That'll save him from having to copy and paste Equip and Unequip over and over again, though its still the same basic, and if the equip system was given a extra dimension, flawed, code.
In response to GhostAnime
GhostAnime wrote:
That's a horrible system, learn how to use Boolean:
http://bwicki.byond.com/ByondBwicki.dmb?TrueFalse

That way, instead of making two variables, one for checking if it is equipped and another of the name of the item, you can have one variable with the item in question assigned to it.

Im very aware its a HORRIBLE SYSTEM thank you <.<i made it crappy so that it would work but they would go looking for something else. An learned something. <.< Give me a break I even said it was bad in my reply... v.v If you want to make a system then waste your time an code one. I wasnt planning on him really using it to much it was just a starting example of one way he could go. v.v As I said I would have done it dif if I was going to make a system for my game. Pssh <.<
<br/> RedlineM203 wrote:
When he wants to add more weapons, the code file will be in a pretty bad shape using that code. Concept is right, but it could be so much less. And what Ghost said.

> mob
> var
> Equip
> WName
> obj
> Item
> Boukuto
> icon = 'obj.dmi'
> icon_state = "boukuto"
> name="Boukuto"
> verb
> Equip()
> if(usr.Equip==1)
> usr<<"Already have a weapon on."
> if(usr.Equip==0)
> usr.Equip=1
> usr.WName="[name]"
> Unequip()
> if(usr.Equip==1)
> usr.Equip=0
> usr.WName=""
> if(usr.Equip==0)
> usr<<"You dont have anything on."
>

That'll save him from having to copy and paste Equip and Unequip over and over again, though its still the same basic, and if the equip system was given a extra dimension, flawed, code.

I was trying to make it a pain in the butt to use damit! XD! *starts hitting people with objs*
In response to Ac19189
I already have one system coded as a demo.

If you're going to show someone a snippet, make it a good example instead of a bad one.
In response to GhostAnime
Then you post one pssh I was killing time an making it simple an bad for a reason. v.v Simple so they could understand it an bad so they go an learn how to code one that didnt suck if everyone just handed out a good nice script to anyone that asked a bunch of noobs be running around with games an wouldnt even know what usr<< does... v.v
In response to GhostAnime
Thanks Guys. Ghost Ac did what i asked even if it was crappy it is still useful. notice i asked for a example and she said to play with it a little. and the other guy who helped thank you to ur is helpful and ghost if u made a demo can u post the link up here ina reply?
In response to Shirukai
http://members.byond.com/GhostAnime/files/ Equip%20Slot2_src.zip

You're the developer, do whatever you want to *shrugs*

In response to GhostAnime
Lol thanks and thw other guy who name i didnt know, Thank Redline
In response to Shirukai
obj
Weapon
var
Equip

Boukuto
icon = 'obj.dmi'
icon_state = "boukuto"

verb
UnEquip()
set name="(Un)Equip"
if(Equip)
usr<<"Already have a weapon on."
switch(alert(usr,"Unequip?","Item","Yes","No"))
if("Yes")
Equip=null
if("No")
return
else
usr<<"Weapon Equipped."
Equip=1
Get()
set src in oview(1)
set name="Get"
loc = usr


There v.v An YES I know this makes it so the var can only be used once TY an a... You know what let me just change it... Bloody maker...
In response to Ac19189
lol umm thank you