A panel to go to different rooms!?

Started by Minimi, Sun 06/07/2003 12:58:36

Previous topic - Next topic

Minimi

Is there some plugin or script for having a pannel with arrows to choose your direction? I need this because i'm making an adventure without a walking character and only some background and animations... so I need to have something like this :



And then you can click your direction and jump to that room that is ahead or aside you! Howto? Or should I make in every room 4 objects of arrows and put them in place??

Scorpiorus

#1
You could make it a GUI instead. Place four buttons representing each direction. To avoid your global script become messy due to a lot of if (button==1) { if (room == 2) {NewRoom(...);} else if (room == 2 ...) you can involve CallRoomScript() function.

So after you have made a GUI with buttons...
Let's suppose:
directional GUI is number 4
button 0 - forward
button 1 - backward
button 2 - left
button 3 - right


global script:

function interface_click(int interface, int button) {

if (interface == 4) { // if there is a click on directional GUI

// if button has been clicked...
// then call current room-script passing that button as parameter.
if (button >= 0) CallRoomScript(button);

}

}

ok, that was a global part.

Now for each room you want the player to be able to to move from:

into the room's script add new function named on_call:

room script:

// room script

function on_call (int value) {

// forward:
if          (value == 0) NewRoom(....);
// backward:
else if (value == 1) NewRoom(....);
// left:
else if (value == 2) NewRoom(....);
// right:
else if (value == 3) NewRoom(....);

}

thereby every room has it's own on_call function so you can pass different values to NewRoom().

-Cheers


Femme Stab Mode >:D

I did that in Slime 2. I put objects into every single room and made them so when you clicked on them you went straight to a different room.
NANANANANANA ASSHOLE!

SMF spam blocked by CleanTalk