Page 1 of 1
Same room, different graphic redux
Posted: Wed Mar 10, 2004 11:07 am
by Hugella
Back in 2000, Jonsey posted <a href="
http://groups.google.com/groups?q=hugo+ ... num=340">a question</a> to raif asking basically, how can i get a single room object to display multiple pictures based on the current status of that room.
Did you ever get an answer? (Google doesn't record one.)
If so, what is it?
graphic property routine
Posted: Wed Mar 10, 2004 5:22 pm
by Kent
Hmm. Actually that should work (the example Robb posted). I don't remember if we eventually figured out what was going on or not.
Anyway, what I usually use is a property routine. (This example is a lot simpler if you assume all graphics are in the same resourcefile.)
So in the room object, I might have something like:
Code: Select all
graphic
{
if roomdoor is open
return "roomgraphic_dooropen"
else
return "roomgraphic_doorclosed"
etc.
}
That way, all the logic for the room's graphic gets kept in one place.
Posted: Mon Mar 29, 2004 11:44 am
by Ice Cream Jonsey
Whoa! Thought I responded to this.
I use this method:
Code: Select all
graphic
{
select(LocationState[11])
case 1
{
current_resource_file = "mall"
current_resource = "sporting01"
}
case 2
{
current_resource_file = "mall"
current_resource = "sporting02"
}
case 3
{
current_resource_file = "mall"
current_resource = "sporting03"
}
else
{
current_resource_file = "mall"
current_resource = "sporting01"
}
return -1
}
If I remember right, the thing I was missing was the "return -1" bit.
If you're stuck at all, Hugella, just let me know. I've got plenty of source code I can send you with multiple graphics going on in the same room. I did wrestle with it for a night a few years ago, but Kent pointed me in the right direction, and I definitely hope that getting it working yourself doesn't slow you down, because the solution's all there.
Robb
Posted: Mon Mar 29, 2004 3:55 pm
by Hugella
Robb, I'd be happy to see *any* source code you wanted to share. As much as possible! :)
Seriously though, I'd appreciate it.