some map / werbcoin problems (solved)

Started by viktor, Mon 28/06/2004 17:05:36

Previous topic - Next topic

viktor

I have a map of the city and it's soroundings. And I wan't to make it so that the player can simply clck on the location he/she wants to go to and BOOM he is there. But I can't use the any click interaction becouse I have a werbcoin in my game. If I use that funcion I have to open the werbcoin and click on the hand/mout/eyes/whatewer ti go to the destination. I would like for the player to go to the destination without hawing t open the werbcoin. Is that possible?
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Scummbuddy

can you just simply disable that gui in that room and use regions or hotspots?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

viktor

Quote from: Scummbuddy on Mon 28/06/2004 17:28:20
can you just simply disable that gui in that room and use regions or hotspots?
And how do I do that? I know how to hide a gui but not how to disable it.
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Scummbuddy

check out GUIOff(); in the manual, the text along with it should be a good help. if not, feel free to come on back and we'll chat.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

viktor

Quote from: Scummbuddy on Mon 28/06/2004 17:49:13
check out GUIOff(); in the manual, the text along with it should be a good help. if not, feel free to come on back and we'll chat.

It didn't work. The gui didn't even turn off. I used the interactions editor.
player enters screen (after faidin)/ run script (GUIoff (2))
player leaves screen / run script (GUIon (2))

where 2 is the GUI number of the verbcoin.
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Scummbuddy

youll want to put it in before fade in
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

viktor

#6
what if I use the change cursor funcion and make a cursor especialy for the main menu and the map? Would that work? And if it would what do I have to be carfull with?

EDIT: Oh and by the way. The GUIoff  didn't work. I don't know what But I'm doing somethig wrong.
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Scummbuddy

oh, i didnt originally notice. you need to capatalize the "O" in "on" and "off"
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

viktor

Quote from: Scummbuddy on Mon 28/06/2004 19:52:35
oh, i didnt originally notice. you need to capatalize the "O" in "on" and "off"
I did that. Actualy. What I did: I copied the sample from the manual and just changed the GUI number. Or do I have to do something else to?
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

H Man unplugged

My suggestion is to use the room's on_mouse_click() function to usurp the  global script's click handling.  To illustrate:

insert this in the room code

Code: ags

on_mouse_click(int button) { //this function is called whenever a mouse click is detected.

if(button==LEFT) {
//Put whatever you want to happen here
ProcessClick(mouse.x, mouse.y, MODE_LOOK);
}
else if(button==RIGHT) {
//Put whatever you want to happen here
ProcessClick(mouse.x, mouse.y, MODE_LOOK);
}
ClaimEvent(); //claims the event so that the global script can't process the click.
}


Now, that should activate the look event, and in turn the ANY CLICK event, and ignore the verb coin altogether.

viktor

there where it sayis "inser what is supose to hepene". What am I supose to insert in there if I wan't my character to go to a certain room.
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Hollister Man

Once you put that bit in, your "any click" should work as if you weren't using a verb coin, as long as you are in the map 'room'.  You would put in the room changes in the hotspot's "any click" interaction in the interaction editor.  The alternative is much harder to script.
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

viktor

Quote from: Hollister Man on Mon 28/06/2004 21:47:48
Once you put that bit in, your "any click" should work as if you weren't using a verb coin, as long as you are in the map 'room'.  You would put in the room changes in the hotspot's "any click" interaction in the interaction editor.  The alternative is much harder to script.

I understand that but what is the script for moving a character from one room to another? I need to know that so I can insert it in to the script that you gawe me before.
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Gilbert

Use NewRoom(Ex) for the player character, for non-players just change their room directly, like:

character[PAUL].room=10;

viktor

now I have a new problem.

First of there's something wrong with the script. A warning keeps poping up.
Secondly. I don't think that this script will make the character go to a diferent room at specific coordinate (becouse I didn't input any). How do make the player character go to a room at specific coordinates.
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Gilbert

What's the warning that you got?

To go to specific coordinates, if it's player character use NewRoomEx(), if it's not player, just modify the
variables directly, like:

character[PAUL].room=10;
character[PAUL].x=120;
character[PAUL].y=50;

viktor

signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Gilbert

On mouse click? can you post the portion of your global script around line 9 here?

It definitely has nothing to do with the room changing codes.

viktor

signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Hollister Man

You put the on mouse click inside a hotspot function.Ã,  DoH!Ã,  I forgot to really explain that it has to be in the "main" function, not inside anything else.Ã,  Also, I typed it wrong, you need:

Code: ags
function on_mouse_click(int button) {


instead of just on_mouse_click.Ã,  Sorry Viktor, I was typing at work, so I couldn't test my code.

The reason you're getting the error is because the compiler does not know what to do with the function without the 'function' operator.Ã,  Try some thing like this (I assume Joe is the player character)

Code: ags

//This is the room script, basic with the one hotspot you showed us in the screenshot.
function on_mouse_click(int button) { //I forgot to type 'function' at the beginning, sorry so much.

if(button==LEFT) {
//Put whatever you want to happen here
ProcessClick(mouse.x, mouse.y, MODE_LOOK);
}
else if(button==RIGHT) {
//Put whatever you want to happen here
ProcessClick(mouse.x, mouse.y, MODE_LOOK);
}
ClaimEvent(); //claims the event so that the global script can't process the click.
}
function hotspot1_a() {
NewRoomEx(10, 120, 50);Ã,  //this part can be put in the interaction editor, instead of script if you want.
}


Sorry about the screw up, I should have checked that first.  The way it works is that the game automatically calls the function on_mouse_click every time a click is detected, but if the room doesn't have one, it goes on to the global script version, in case you wanted to know.  Without the 'function' instruction, it's like using an 'int' before declaring it, the compiler doesn't know what an on_mouse_click is.
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

SMF spam blocked by CleanTalk