Help with helping myself to use an inventory item on a hotspot

Started by danbuddle, Mon 10/03/2014 21:03:28

Previous topic - Next topic

danbuddle

Hello all,
I am desperately trying to teach myself how to make a game in AGS. However, every time I try something new it is taking me hours of googling and searching the manual to find out how to do simple things. Case in point: I want to use an inventory item (iKnife) on a hotspot (hKitchdraw)and have a few things happen when I do so (change an objects visibility to false, display some speech etc.) But I can't find the commands/functions I need to do this! I must be really missing something obvious here!  What is the best way to find stuff like this out? I seem to be getting lost in in-depth forum posts and manuals trying to do the simplest things.

Dan
I really have nothing to say...

Khris

Read the scripting section front to back and write down every command that seems useful. It took me months to get to not having to constantly look things up, and back then we didn't even have the nice OO-style commands. I also spent my first few months here reading every thread in the technical section that had an interesting title.

What you need is Character.ActiveInventory, Object.Visible and Character.Say / Display.

The basic idea is to think about how the command is most likely implemented. If you want to check / change property X of thingie Y, chances are you need to read / set Y.X to another value, or call Y.SetX(new value).
If you want to change something room specific, look at the Room part of the scripting section for applicable commands. If you want to do something global, like saving the game, look at "Game / global functions".

Sometimes, the solution is not straightforward of course. There's no shortcut, but chances are somebody else had the same problem in the past. To name one example, we have been getting a new thread asking about how to find out the used inventory item about once every two months for the better part of a decade. (And the tutorial still doesn't explain this, afaik.) Also use the forum's search function, although I know how frustrating it can be to find the right search terms.

You might also want to check out densming's ags tutorials on youtube. Some info is outdated or not the best way to do things but they are apparently very helpful to beginners.

danbuddle

That's great. I'll crack on tomorrow, starting with some of those video tutorials. Thank you kindly for your help, 'tis such a massively supportive community here at AGS, I can't wait until someone asks a question of such noob proportions that I can finally return the favour and help some one else.
Ta again.
I really have nothing to say...

johanvepa

Sometimes I wish there would be more noob questions left unanswered, so us almost-noobs could take pride in giving others a leg up  (laugh)

danbuddle

I really have nothing to say...

SMF spam blocked by CleanTalk