I need to know how to...

Started by Mugs, Fri 27/08/2004 04:46:43

Previous topic - Next topic

Mugs

I need to know how to do 2 things.

First of all, I want to know how to do these things where you  do something in one room, it changes something in another room.

Here's a few examples:

-I press a switch in one room and it unlocks a door in another room. (NOT THE CURRENT ROOM)
-I get some info somewhere in the game and then it adds a conversation option to a person.

I want to know this because all I saw was how to change things in the CURRENT ROOMS or to add CONVERSATION OPTIONS in the current conversation.

Second of all, how do I change an the actions of a hotspot or character?

Here's some examples:

-The first time a talk to the person he tells me something, the second time or after I did something to him, he tells me something else.

I tried to look for the information in the help contents, but I just couldn't find anything.

Please help! :'(                                         Thank You.
Cool stuff I found out: Men are four times more likely to be struck by lightning than women.  Wow, really? [dirty joke] Maybe this has to do with the fact that us men have "lightning rods"? [/dirty joke]

Albert Cuandero

I mostly use global variables (script or interaction editor, both have them) and conditionals.

You can look up in the manual and the tutorials on this page how to do it exactly.
int do_you_like_me;
if (do_you_like_me == 1) Display ("You can call me Al");
else {}

Kinoko

The answer to most of your questions can be solved with Global Ints. You can find heaps of info on them in the manual (so definitely read up) but in short, you can use them to have different actions happen after certain events.

For example, with your conversation problem, you would use a GlobalInt to say that when the character talks to another character once, it says "blah". After that, if you talk to him again, it says "BLAH!". After you talk to him the first time, put in your script something like SetGlobalInt (0, 1);

An example might be:

Code: ags

if (GetGlobalInt(0)==0) {
 Ã, DisplaySpeech (MAN, "Hello.");
 Ã, SetGlobalInt (0, 1);
 Ã, }

else if (GetGlobalInt(0)==1) {
 Ã, DisplaySpeech (MAN, "How are you?");
 Ã, }


By default, a Global Int is set to 0, and when you want something to change, set it to 1 or something. Like I said, there's more in the manual.

As for changing things in other rooms, it depends on exactly what you want to change. Some things can be done independant of rooms. Other things you can use Global Ints to change, or some other conditional like 'if character has object x...' or 'if character's previous room was x...'. You can add a conversation option from anywhere.

Kweepa

#3
[plug]
DON'T use the OtherRoom plugin! (see the plugins page in downloads)
To open a door in another room, add to the interaction script of the switch:

OtherRoomObjectOff(ROOM_REMOTE, OBJECT_CLOSEDDOOR);
OtherRoomObjectOn(ROOM_REMOTE, OBJECT_OPENDOOR);
OtherRoomEnableRegion(ROOM_REMOTE, REGION_DOORTRIGGER);
ObjectOff(OBJECT_ONSWITCH);
ObjectOn(OBJECT_OFFSWITCH);

Where the capitalised things are #defined in the global header.

[/plug]
Still waiting for Purity of the Surf II

Mugs

I'll try to make it work.
Cool stuff I found out: Men are four times more likely to be struck by lightning than women.  Wow, really? [dirty joke] Maybe this has to do with the fact that us men have "lightning rods"? [/dirty joke]

Scummbuddy

No offense Steve, but we don't typically push the plugins in the Beginners Forum. It's better left till those are fairly comfortable with the program and have a good memory of the functions offhand.

(I hope that came off nicely. I'm saying it back in my head and it sounds like I'm yelling.)
- 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

Kweepa

Yell if you want!
I can take it.
Still waiting for Purity of the Surf II

AGSFanatic

where is this Plugin page??? didn't find in downloads....

Scummbuddy

on the main page of the site, click on 'download ags' and below all the download links for ags, there are 'user written plug ins'
- 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

SMF spam blocked by CleanTalk