While objects are visible

Started by , Sat 24/03/2007 17:43:37

Previous topic - Next topic

bowtolaura

Hello!

   I want to have the following happen in my game:

While three objects (all of which are set to: Visible = false before room fade-in) become visible AT THE SAME TIME in a room, another object becomes visible in the same room and a message is displayed.

How can I have this happen? Do I need to do some scripting or can I use the Interaction Editor?

Please reply as soon as you all can!

Bowtolaura


Akatosh

So do you just want all four to become visible instantly? Or a fade-in?

Da_Elf

so its 4 objects to become visable plus a display message? do they fade in or pop in?

EDIT
DOH. sorry, shouldnt have ignored that red message saying someone else had posted

Ashen

OK, looks like you might need to clear up what you're asking here, but have my attempt anyway (assuming you want 'If all three are visible, turn on the fourth'):

No, it's not possible to do that with Interaction Editor, you're going to have to script it. Fortunately, it's very simple using the Object.Visible property. I'd recommend you also check if the fourth object if visible, to stop the message from being displayed repeatedly. Depending on what exactly the objects are, you might need to use another variable for this - e.g. if you can take the fourth object when it appears (meaning the message would run again - and the object turn back on - if you were using it's Visible property.

Code: ags

// in the room's repeatedly_execute function
if (object[0].Visible == true && object[1].Visible == true && object[2].Visible == true && object[3].Visible == false) {
  object[3].Visible = true;
  Display ("Ooh, something appeared.");
}



Again, it really doesn't seem like you've tried for youself, before posting. (Like you were told in your last thread.)

I know what you're thinking ... Don't think that.

Da_Elf

#4
wow. you learn something new every day. i didnt know the && thing. time to go clean up alot of my asterix code.

Lt. Smash

#5
@ Da_Elf
look at the manual under Script language keywords 'Operators'.
[edit]
since you deleted your edit, I think you found it out yourself while I was typing.

Da_Elf

yeah. i deleted me edit, sorry.
i was able to take one instance from 130 lines of code down to 20 lines of code using the operstors && and ||. i was blown away by such a simple thing which i missed out on.

Ashen

I imagine a few of those 20 are very LONG lines, however...

The 'Operators' entry in the manual isn't really that clear, IMO. I'm surprised you haven't seen them in use in other forums posts (or modules, etc) before now, though - that's where I picked up on them.

Now, can we try and stick to bowtolaura's topic?
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk