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

#61
That's a tough one, because whatever is typed into and processed by the parser is written into the string, so even if you have it set up to display that string then it will display the whole thing (including whatever was typed after "Word").

My best guess would be to separate all of the words out into different Said() lines and change a certain string accordingly.  Kind of like this:

string word;

if (Said("money rol")) {
StrCopy(word, "money");
}
else if (Said("cash rol")) {
StrCopy(word, "cash");
}
else if (Said("pounds rol")) {
StrCopy(word, "pounds");
}
else if (Said("bucks rol")) {
StrCopy(word, "bucks");
}
Display ("%s", word);
}

It might be kind of a pain that way but it should work.  Just be sure that the name of the second string is different than the name of the string you're using for your GetTextBoxText() function.

Edit: Also you may need to de-synonym them in the parser list because once it sees the first word it'll try to find a synonym for it and if it's a valid synonym it won't continue on with the next part of the code, but I'm not positive about that.

~Wolfgang
#62
Change the "if" in line 12 to an "else if".  By executing your script now, it will start the interaction, set "water" to 0, run the first "if" statement which, at the end, sets "water" to 1, and then that part makes the second "if" statement true (water == 1) so it runs that also.

~Wolfgang
#63
Be sure to properly capitalise.  It should be:

SetObjectBaseline (0,0);
SetObjectBaseline (1,0);
etc...

~Wolfgang
#64
Not that I know of.  Just drag the baseline for each object in the room editor to the top of the screen.  Someone else might know a better way, though.

~Wolfgang
#65
Try setting the object's baseline higher using the room editor or SetObjectBaseline.  Set it to somewhere on the top of the screen or setting it to 0 and it will always appear behind characters (like part of the background).

~Wolfgang
#66
Well, I've never done anything like this myself so this is just a guess, but you could try using character variables in place for the coordinates.  Maybe something like:

SetMouseBounds ((character[EGO].x -50), (character[EGO].y -50), (character[EGO].x +50, (character[EGO].y +50));

which would, theoretically, create a 100x100 "box" around the player character and would follow him around wherever he goes (if put in the repeatedly execute section of the room script).

Edit:  And you should be able to change the bounds for each view as well.  I don't know if, by view, you mean character animation view, but if so then you could try:

if (character[EGO].view == 1) {
 SetMouseBounds(x, y, x, y);
}
else if (character[EGO].view == 2) {
 SetMouseBounds(x, y, x, y);
}

Again, I've never tried to do something like that myself so that's really just a guess.

~Wolfgang
#67
Try SetMouseBounds.  Specify the left, top, right, and bottom boundaries for the mouse area, like such:

SetMouseBounds (80, 50, 240, 150);

for example will only allow the mouse cursor to move in a square in the middle of the screen.  This only makes squares, though, so you might have to do some more manipulating to make a triangle.

~Wolfgang
#68
The game is trying to run function object0_a, and you have it set up as function object0_b so it can't find it.  Go into your room script and change the "b" to an "a" and see if that fixes it.  Otherwise, just copy all the code you have listed under the interaction (what Barcik posted as well as whatever else you had) into a .txt file, then go into the AGS editor and delete the interaction for that object entirely.  Once it's deleted, re-create the interaction, select Run Script, and then paste that code under the new function it created.  At least that way the code created by AGS will match what the game is looking for.

That's my guess, anyway.  Hopefully it helps!

~Wolfgang
#69
You could try something like:

string name;
InputBox("What is your name", name);
Display("Welcome, %s", name);

That way, string "name" would be changed to whatever the player typed into the InputBox, and you can just use the string variable %s to display it.

At least I think that's what you mean...

~Wolfgang
#70
The dialogue scripts use a slightly different format than the normal scripting language, so LoseInventory() won't work there.  There is no "Lose-inv X" feature or something like it, so in order to have a dialogue option cause the player to lose an item, a "run-script x" in the dialogue along with its appropriate function dialog_request() script must be called.

~Wolfgang
#71
Oh, okay.  Make sure that you have the "Clickable" box selected for that GUI.  Also, be sure that each of the buttons have a script assigned to them.  Aside from that, it should work.  Maybe someone else can give you more information.

~Wolfgang
#72
You'll need to use MoveCharacterDirect, since if you're walking off of the actual screen edge you're going into "non-walkable" areas of the screen.  On the "walk off screen edge" for whichever side you're trying to make (I'll use the right side as an example), put a command like MoveCharacterBlocking (EGO, 335, 190, 1), so that as soon as he hits the screen edge, he'll walk to x335 (15 pixels off the right side of the screen), y190 (assuming you're walking off of the bottom right corner of the screen), ignoring walkable areas.  Also make sure that you have the screen edge set on a walkable area or the character won't be able to reach it.

~Wolfgang
#73
I don't really know how you'd make a popup at the bottom of the screen.  Maybe you could try something using mouse.y, like

if (mouse.y >=300) {
GUIOn(1); //if that's the number of your GUI
}

and then have GUI #1 set to "Popup modal".  As far as the buttons working, are you trying to get them to work like the standard Sierra format, where the GUI pops up, you click on one of the buttons, and one of them will bring up an inventory window?  If that's the case, select your popup GUI, note the object number of the button that you want to use for your inventory screen, then go to the global script and where it says function interface_click (int interface, int button) {, enter a statement like this:

if (interface == 1) { //assuming we're still going with GUI #1 here
if (button == 1) { //the object number of the button you're assigning to bring up
//your inventory screen
InventoryScreen();
}
}

That's pretty much just a guess, though, since I've never tried anything like this. *shrugs*

~Wolfgang
#74
}
function character2_a() {
// script for character2: Talk to character
if (GetGlobalInt(0) == 1) {
SetDialogOption (1, 3, 1);
}
}


function character3_a() {
// script for character3: Talk to character
if (GetGlobalInt(0) == 1) {
SetDialogOption (4, 2, 1);
}
if (GetGlobalInt(0) == 1) {
SetDialogOption (4, 3, 1);
}
}


function character0_a() {
// script for character0: Talk to character
if (GetGlobalInt(0) == 1) {
SetDialogOption (0, 3, 1);
}
}

Each if statement needs to be enclosed in brackets, and so does each function.  Look at this:

function character0_a() { first bracket for function
if (GetGlobalInt(0) == 1) { first bracket for if statement
SetDialogOption (0, 3, 1);
} last bracket for if statement
} last bracket for function

As well, if you ever have one function to perform two different things using the exact same criteria, you can combine them into one if statement.  In your function character3_a() { script, you have two different things being done using the same criteria, that being if (GetGlobalInt(0) == 1).  Therefore, the script will do both of those things if GlobalInt 0 is set to 1.  So, you can combine them into one if statement instead of using two.  It would look like this:

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

It makes the script more organised and easier to follow.  Both ways will work, though, so I guess just go with whatever you're most comfortable.

~Wolfgang
#75
It might be easier to combine those two, since you're using the same GlobalInt and value to do two different things, as such:

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

Also, be sure to add the RunDialog(); line I put at the end of the interact with character code or it'll just enable/disable the topics but won't actually bring up the topic.

Was your code giving you an error message or was it just not working (i.e. clicking TALK on the character wasn't producing anything)?

~Wolfgang
#76
If it's giving you the "Nested Functions not supported" error, that means that you've inserted your function dialog_request () { inside the middle of another function.  Look to see if there is a } at the very end of your code (the whole global script, since usually the dialog_request functions are placed at the end of the global script).  If there is, delete that } and move it to the line directly above your function dialog_request () { line and see if that fixes it.

~Wolfgang
#77
It only allows you to use on function dialog_request(), which is why you typed in a parameter.  If you used Proskrito's script for your first one, your second one should look something like this:

function dialog_request(int parameter){
if (parameter==1) {
SetDialogOption(1,4,1);
}
if (parameter==2) {
//code here
}
}

And then you would use run-script 2 in the dialogue option for the second code.  If you need a third, then just add another if (parameter==#) statement, and so on.  Each parameter # represents the run-script #.

~Wolfgang
#78
How many hotspots do you have in that area?  There are only seven books and a table, possibly the top of the tent...that's 9 objects...how do you have your hotspots set up?

~Wolfgang
#79
You need to have at least one character I believe.  Make sure you call your first room ROOM1.CRM and have character #0 (starts out as "ROGER" but you can change that) start out in room 1.  Then, on the main room editor page for room 1 (and any subsequent rooms you're going to use), click the "Hide Player Character" box and your character won't appear.  That will give you just get a screen and a cursor with no characters present.

~Wolfgang
#80
Your script looks like this:

MoveCharacterBlocking(CIRCUM,287,165, 0);
Wait(5);

right?  What error message does it give you, exactly?

~Wolfgang
SMF spam blocked by CleanTalk