ID:2209413
 
Code:
    Skull_Bag
density=1
icon='Skull Bag.dmi'
icon_state="skullbag"
verb
Active_Train()
set src in oview(1)
if(usr.ActiveSide==0 || usr.ActiveSide==null)
usr.ActiveSide=rand(1,4)
if(usr.ActiveSide==1)
usr<<output("Punch The Bag Facing Up (^)","DisplayDir.output")
if(usr.ActiveSide==2)
usr<<output("Punch The Bag Facing Down (v)","DisplayDir.output")
if(usr.ActiveSide==3)
usr<<output("Punch The Bag Facing Left (<)","DisplayDir.output")
if(usr.ActiveSide==4)
usr<<output("Punch The Bag Facing Right (>)","DisplayDir.output")
winshow(usr,"ActiveWindow")
New()
src.AddName("Active Bag",color2Add="black")


Problem description: The text wont appear in the DisplayDir Skin thats provided. ANd, I dont know how to resolve the issue

Just to make sure, is this in a verb? Because if it's not inside a verb, usr may not be valid.

Also I'm not sure why ActiveSide is a mob verb, since it would seem like it should belong to something else. It would help if you could explain what this code is supposed to do. Is it possible that ActiveSide already has a value other than 0 or null, and thus the code inside this if() never runs at all?

Basically we're missing the broader context. I'd need to see the whole routine in question and understand what it's supposed to be doing.

To be honest this code has some design issues that suggest there are design issues in the rest of the code. For instance, if ActiveSide is always being set to a value from 1 to 4, why not use a list to grab the output text instead of relying on a bunch of if() statements and repeated code?
hey lummox thanks for replying, ive been helping with this issue a bit, Gara cant reply at the moment but he wanted me to explain what the plan is here.

I will check with him on the default value of ActiveSide if it is null, but the window does show as intended, not sure if that is the issue here.

This is being called from a verb, the issue he is having is that the output information simply is not being displayed on the window shown. The Window appears but the information does not. I suggested moving up the winshow(usr,"ActiveWindow") line to one below the if statement.

If there is any more information we can provide, we will post shortly.

Thank you for your input
Trying this one more time to see if i can send but excatly what classic said, the main issue is the output ()
Please show us the whole verb. This snippet is not enough.
I have edited the first post and have showed more detail lummox i maybe forgot to mention its within an obj aswell. My apologies =c
In response to Lummox JR
I've had the sneaky suspicion since I read this thread this morning that due to
"DisplayDir.output"
// and
winshow(usr,"ActiveWindow")

He was setting up the control parameter wrong, and he was. "ActiveWindow.DisplayDir" was the proper configuration.

The current issue is fixed for him, at least.