I am quite new to AGS and have scoured the forums and the manual and don't know where to start on this topic to be honest. I would appreciate some help to give an item to a character so that its starts a dialog driving the story along.
-Give item to character
-Character tells player what to do through Dialog
Thank you in advance
1. character.AddInventory(item);
2. Either use the character.say command or start a dialog using Dialog.Start()
Thank you but now Im stuck with this
"GlobalScript.asc(545): Error (line 545): '[' expected"
Over this
function cMysteryMan1_UseInv()
{
character.AddInventory(iWaterCup);
character.Say("There is a passage through the mountains")
}
Well, you have to tell which character is supposed to do these things. If it is your main character, use cEgo.AddInventory and cEgo.Say.... if it's another one or you changd the scipt name of the main character then change the lines accordingly.
Regarding the error message:
A "[" is expected because you can also use character[ x].blabla, x being the number of the character..
This is all explained throughly in the manual.
I think what you want is this:
function cMysteryMan1_UseInv()
{
if (player.ActiveInventory == iWaterCup)
{
cMysteryMan1.Say("There is a passage through the mountains");
}
}
ie. if the player uses the Water Cup on the other character, then he says the text.
Quote from: Mr Matti on Fri 20/02/2009 12:58:47
Regarding the error message:
A "[" is expected because you can also use character[ x].blabla, x being the number of the character..
However, this is outdated. You should just use the script name for the character.
~Trent
Yes Thank you very much I will scour again through the manual :)