ID:139632
 
Code:
verb
equip(I as obj in usr.contents)
usr << output(I,"window1.GRID")


Problem description:Not working, no compile errors, Trying to get it, so when the verb is calle,d the src is sent to "window1.GRID" but the output() proc doesn't accept 'src' as an arguement. Please reply if i am missing any info, or code. although, i don't think i am missing any code in relation to this. i have a window named 'window1' and in it is a grid name 'GRID' the verb at this point, is called for 'obj/ring' which has a icon, and icon_state assigned, i have tried many other methods, such as using icon() to check if it would send the icon, to troubleshoot the problem, along with 'file() although i don't think it would work given the situation, to begin with.

mob
proc
Update_Grids()
var/A
for(var/B in src.contents) // for all of the items in your contents
src << output(B, "grid_name:1,[A++]") // output them to the grid


Check the Lummox JR's skin tutorial.
In response to Neimo
That is for all of inventory, i don't need it for all of intventory, but i could change what you have, to apply for only equipped items, with a simple var..

Although, the issue i am having, is not the fact i don't know how the uotput() proc works, it is simply output(file, param) with param being the control to output to, and the file to output, but i am using it in an equip var, so i can make a rag-doll type look to the equipment system, but, as of yet, it seem i have not found a way to do that.
In response to Wolfnova
You could either have a list that holds your equipped items, or have a variable for all equippable items that becomes true when they are equipped.
In response to Spunky_Girl
Spunky_Girl wrote:
You could either have a list that holds your equipped items, or have a variable for all equippable items that becomes true when they are equipped.

I have both, but the list if for equipping them to the slot, although my main problem is the fact it gives me and error, that i can't use src, as something i could use to send the object to that grid...
In response to Wolfnova
Use either/or, not both, because it's just a waste of resources using both methods. What programming are you using and what error(s) are you receiving? Please provide all relevant code to this issue.
In response to Spunky_Girl
I thought i provided it in OP, but eh, i use both, because they are for different things, and i am just starting to get the hang of using lists :/

Also, i don't get any errors, it just doesn't go to the grid, i tried setting a var to the src, which is very redundant, i know, i tried using file() proc, the main thing is, in output(file, control) i don't know what i am supposed to put, for 'file' to have the src be what is sent to the control.
In response to Wolfnova
Please refer to Neimo's post in that regard.
In response to Spunky_Girl
Spunky_Girl wrote:
Please refer to Neimo's post in that regard.

I did, and i replied with why that wouldn't work, i am not looking for... wait, i could augment that could, add another if() to check which slot, and output to the correct slot so long as it can be put in that slot, thank ya, XD

Although, i will reply if it actually works or not, it should though...
In response to Wolfnova
For future possible (yet unlikely) thread viewers, please post your "fix" to your issue at hand with as much detail/explanation as possible. What were you looking for and how did you implement it?
In response to Spunky_Girl
Alright, i did that, and this is the code i have, and explanation of errors.

mob/proc
updateequipment()
for(I in usr.contents)
if(I.isequipped == 1)
if(I.equip_slot == "Weapon") // Problem line
usr << output(I, "Weapon:1,1")


NOTE: There is more else if() statements after this, going through if() 's for each slot the equipment could be on (I tried to have the name of the grid be 'I.equip_slot' for it to be shorter, but i also got errors, something along 'bad value'

But anyways, i get the error 'if statement has no effect' for the line labeled 'problem line' and another error for every 'else if' after that, saying it is not preceded by an if() statement, but of course that is because the first if() has a supposed error, so i probably just need to fix the topmost, 'if()' and make sure it the same for the else if's..

Please note: 'isequipped' and 'equip_slot' are both var's for obj's under 'equipment' in my coding.
In response to Wolfnova
Looks to be like an indentation error to me. The line below the problem line isn't indented enough.
In response to Spunky_Girl
Spunky_Girl wrote:
Looks to be like an indentation error to me. The line below the problem line isn't indented enough.

And i was thinking a var was in the wrong spot or something... thanks for the most obvious thing i have ever asked for help on... indentation, that is screwed up :/ well, time to tackle the other 53 errors in a new forum thread, this time, a var is somehow a bad constant....
In response to Wolfnova
If you need to loop through the entirety of contents to find your weapon, then your equipment system is bad.

[link]
In response to Garthor
afaik, with that setup, i would either, still have to loop through all equipemnt, or make a new proc for each type of equipment, unless i am misunderstanding.
In response to Wolfnova
You are misunderstanding. You can find the weapon via the weapon variable, and you can use the vars list to find the proper variable to equip an item to.
In response to Garthor
But i have to loop through, and check if it has a weapon var :/
In response to Wolfnova
No, you don't.
In response to Garthor
How would i get the proc to check which var to modify, if it doesn't know to modify either the weapon, or shield var?
In response to Wolfnova
obj/item/equipment
var/equipment_slot
weapon
equipment_slot = "weapon"

proc
Equip(var/mob/M)
if(M.vars[equipment_slot] == null)
M.vars[equipment_slot] = src
Page: 1 2