I've tried to input a script which has:
if ((character blah inv(10) = 1) && etc etc {
addinventory(2);
loseinventory(1); }
into a "interact with hotspot" interaction, the program says something like "script isn't finished, missing }" but I did have the beginning if script { and the end }.
Is it esential to have an Else command after the if one?
Where do I put the If functions in a room?
if (character blah inv(10) = 1) && etc etc {
AddInventory(2);
LoseInventory(1); }
Try this...
Or:
if ((character[blah].inv(10) = 1) && etc etc {
 AddInventory(2);
 LoseInventory(1);
}
Or:
if ((character[blah].inv(10) = 1) && etc etc) {
 AddInventory(2);
 LoseInventory(1);
}
it was missing a ) right?
I know the script, but where do I put it? In a hotspot? in a room script? Character Enter Screen Before/After Fade in?
You must use double "=" for comparison too:
if ((character[blah].inv(10) == 1) && etc etc) {
AddInventory(2);
LoseInventory(1);
}
About where to put the script, it just depends on what you want it to do. We can't help you unless you give more info.
The placement isn't a problem anymore.
When I enter:
-----------------------------------------------------
if (player.inv[3] == 1 ) {
Display("You suck!" //or whatever
}
-----------------------------------------------------
the game works fine, but when I use multiple conditions such as:
---------------------------------
if ((player.inv[3] == 1) && (player.inv[5] == 1) && (player.inv[69] == 1)) {
Display("Sixty nine. Hehe, dirty mud.");
}
--------------------------------------------------------
AGS says something about not being able to comprehend "Nested functions" or I'm missing a } in the script, which I have checked for {s and }s several times over. Is AGS mongilated or am I doing something wrong?
I've had that before.. it was actually because there was a } missing even if it didn't look like it. Make sure you are looking at the entire room script rather than just the script for an interaction when you check, it's easier to see.
I think the nested funtion error is because you have missed the last } from a function so it thinks you're trying to create a new function inside the last one, which it can't do.