Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Wolfgang Abenteuer

#81
You did remember the semicolon after the MoveCharacterBlocking (CIRCUM,287,165) line, right?

Edit:  Also, looking at it again, you're missing a parameter.  There needs to be either a ,0 or a ,1 after the 165 where 0 will move him normally and 1 will move him directly to those coordinates (ignoring walkable areas).

~Wolfgang
#82
The Wait(5); means that it will pause the code for 1/8 of a second after the character gets to the hotspot (giving the effect of stopping before actually picking an object up, etc.).  The whole block of code that Squinky posted should be placed in the interact with object/hotspot function.

~Wolfgang
#83
It may need the "x" then.  I can't remember off the top of my head if it needs to be if (xvalue == 1) {, so try it with the "x" and if that works then it's ok.

~Wolfgang
#84
change this:

function dialog_request (int x1) {
if (1 == 1)
SetGlobalInt (0, 1);
}

to this:

function dialog_request (int xvalue) {
if (value == 1)
SetGlobalInt (0, 1);
}

~Wolfgang
#85
Sort of.  The "else" means that if GlobalInt 0 is anything other than "1", then the dialogue option will be turned off.  As long as the value of GlobalInt 0 stays at 1, the option will be turned on.  The "else" part just ensures that the option will never come on unless GlobalInt 0 is 1.  That's to prevent the option from staying on if you decide to hide it again later.  Once a dialogue option has been turned on with code, it can only be turned off again with code.  That's what the "else" is for.

If you never plan on changing GlobalInt 0 back to 0 or any other number afterwards, then the "else" line isn't necessary.  I always put one in my scripts just for good measure, though. ;)

~Wolfgang
#86
The SetDialogOption numbers are (int topic, int option, int new_state).

int topic is the topic number of the topic you wish to modify with the script.  You can find this number in the Dialogs tree tab in AGS.

int option is the option number of the topic you selected that you wish to change.  This is also found in the Dialogs tree tab.

int new_state tells AGS whether to turn the option on, off, or off forever.  0 would turn the option off, 1 would turn the option on, and 2 would turn the option off forever.

So, SetDialogOption(0,3,1); would turn on option number 3 in topic 0.

The SetGlobalInt numbers represent the number of the GlobalInt and the value to which it is set.

So SetGlobalInt(0, 1); would set GlobalInt #0 to the value of 1.

The GetGlobalInt numbers check a GlobalInt and see if it is set to a certain value.

GetGlobalInt(0) == 1; checks to see if GlobalInt #0 is equal to 1.

By the way, the AGS help file has a contents index sorted by function.  If you see someone mention GetGlobalInt, for example, then go to the AGS Help menu, click the "Index" tab, then type in GetGlobalInt in the box and press Enter and it will display the function, its parameters, and its usage.  Nearly all of the information you need to successfully use every feature of AGS is in that file.

~Wolfgang
#87
At the end of that dialogue option, add:

add-inv X

where "X" is the inventory item number.

~Wolfgang
#88
My best advice would be to check the Help file in the AGS program.  It lists all of the available functions as well as what all the "int"s represent.  Also, you might want to take a look at the short scripting tutorial (also in the AGS help file) which shows you the basics of assigning variables, if/else statements, GlobalInts, and such.  It can help you get started with AGS scripting.

~Wolfgang
#89
Try,
if ((character[EGO].walking == 0) && (GetCharacterAt (x,y)) {
//code for interaction here
}

where x,y is the coordinates for the hotspot's walk-to point (that you specified in MoveCharacter).  That should (theoretically) not cause the interaction to take place until the character has both stopped moving and is standing on the hotspot.

~Wolfgang
#90
In order for it to accept the X==1 you need to first declare "X" as an variable by adding int x;.

If you're just using the function as a dialog on/off type function, it might be easier to use GlobalInts rather than normal variables, otherwise you'd have to do variable importing and exporting to be able to access those variables in your global script from local room scripts, whereas GlobalInts take care of that for you.

That might go like this:

(Topic 0)
@S
return
@1 //greet
salesman1: "Hello!"
ego: "I'd like to buy something."
return
@2 //buy steak
salesman: "I don't sell steak, talk to the other salesman."
run-script 1
return
@3
stop

Then at the end of the global script:
function dialog_request (int xvalue) {
if (value == 1)
 SetGlobalInt (0, 1);
}

Finally, in the "talk to character" script for the second salesperson, select "run script", then add the code:

if (GetGlobalInt(0) == 1) {
 SetDialogOption (1, 3, 1);
}
else {
 SetDialogOption (1, 3, 0);
}

Then, the second character's dialog (Topic 1) will look like this:

<Greet> // option 1
<Buy Coffee> // option 2
<Buy Steak> // option 3--will be hidden if the player hasn't asked the first salesperson about "Steak".

~Wolfgang
#91
Have you tried MoveCharacter (CHAR,x,y) and manually enter the x,y location of the hotspot?

~Wolfgang
#92
You mean the "X==1" or the "x1"?  The "X==1" line that SSH posted means that the variable "X" has to be exactly "1" or else the code will not run.

The "int x1" in the "function dialog_request" line refers to the "run-script 1" line you put in the dialog script.  Had you put "run-script 2", then you would have needed "int x2" instead of "int x1".

~Wolfgang
#93
You need to replace "topic" with the topic number you are referring to, "option" with the dialog option you want to change, and "new_state" with "0" of you want to make the option disappear, "1" if you want to make the option appear, or "2" if you want to make it disappear forever.

So, if you wanted topic #1's dialog option #3 to appear with that code, for example, you'd write:

SetDialogOption (1, 3, 1);

~Wolfgang
#94
The run-script x line goes under the dialog option you want to have run the script, e.g.:

@S
@1
ego: "Hello"
run-script 1
@2
stop

and the function dialog_request (int x1) { plus the code that SSH gave you goes at the end of your global script.

~Wolfgang
#95
Beginners' Technical Questions / Re:Dialogs
Wed 02/07/2003 08:26:42
If you mean go from one set of dialog options to another, you need to create a second dialog topic in the dialog menu with the second set of options.  In that case, your Topic 0 would be:

(Option 1) Can I buy this -
(Option 2) Bye-

and you would need to create Topic 1 with all of the things the character could buy, e.g.:

(Option 1) Bread
(Option 2) Steak
(Option 3) Cups
(Option 4) etc.

Then you'd need to script (sorry! :p ) the first dialog tree as such:

@S
@1
ego: "Can I buy this-"
salesman: "Can you afford it."
goto-dialog 1
@2
stop

where "ego" is the name of your character and "salesman" is whatever you've named the person you're talking to.  Then, selecting the "Can I buy this" option will make the characters say their lines and then run Topic 1, where you can select what you want to buy.

Is that what you mean?

~Wolfgang
SMF spam blocked by CleanTalk