Same room, different graphic redux

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:smile: :sad: :eek: :shock: :cool: :-x :razz: :oops: :evil: :twisted: :wink: :idea: :arrow: :neutral: :mrgreen:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Same room, different graphic redux

by Hugella » Mon Mar 29, 2004 3:55 pm

Robb, I'd be happy to see *any* source code you wanted to share. As much as possible! :)

Seriously though, I'd appreciate it.

by Ice Cream Jonsey » Mon Mar 29, 2004 11:44 am

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

graphic property routine

by Kent » Wed Mar 10, 2004 5:22 pm

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.

Same room, different graphic redux

by Hugella » Wed Mar 10, 2004 11:07 am

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?

Top