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?
can you just simply disable that gui in that room and use regions or hotspots?
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.
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.
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.
youll want to put it in before fade in
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.
oh, i didnt originally notice. you need to capatalize the "O" in "on" and "off"
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?
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
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.
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.
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.
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.
Use NewRoom(Ex) for the player character, for non-players just change their room directly, like:
character[PAUL].room=10;
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.
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;
this is what pops up:
(http://www.2dadventure.com/ags/popuperror.png)
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.
here you go:
(http://www.2dadventure.com/ags/error2.png)
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:
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)
//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.
Ok I'm gonna pretend I understood that. But this is realy complicated for me.
Now this keeps poping up:
(http://www.2dadventure.com/ags/window.png)
and this s the script:
(http://www.2dadventure.com/ags/window2.png)
Is there any easier way to do this. I mean simply turn of the GUI like I tried befor (but didn't sucsed)?
Your room script should look *exactly* like what I posted, *nothing but what I typed should be there* until you're sure it works. Then you can tell your hotspot(s) what to do later. Just copy the everything in the gray box and paste it into your room script.
I have built a verb coin before, and it is much harder to turn off the GUI, then tell it what to do instead. The reason you failed trying to turn off the GUI is the way the verb coin works. Please be patient, and remember *nothing but what I coded.*
cool. Now it works. Thanks. I gotta remember this when I'm going to be making the startup menu.
I'm glad its working. ;) Its a lot easier than making an if(room==X) for every room that needs its own (or not use the default). Could you mark the first post (solved)?