Add-Inv seeks Lost-Inv

Started by Dennis, Mon 07/07/2003 00:54:24

Previous topic - Next topic

Dennis

Hello

Starting off with this glorious tool, I find Add-Inv very useful (I've yet to dive into global scrips much) Is there a similar way to remove inventory items directly from the dialogue script?

Regards



Meowster

Is this what you mean?

LoseInventory(10);
This will make the player lose whatever is number 10 in the inventory.

Dennis

Nope. (Well not for me anyway, however its only my third day, and my head is spinning from browsing manuals and forums. I apologize if I waste your time here.)

LoseInventory (10) ; like AddInventory (10) ; seems only to work when used in the global script and called from the dialogue with Call-script X.

Add-Inv X however works beautifully as part of an option in the dialogue script. I wonder if there is a way to remove player inventory items in the same straighforward way?

Respect
Dennis.

Dennis

Sorry, that should be run-script X not Call Script X of course.

Dennis.

Meowster

Sorry, I'm a newbie too :) I tried searching for that option but I can't find it. In any case, I have no idea what you're talking about.

Wolfgang Abenteuer

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

TerranRich

This is a good suggestion though. lose-inv should be there with add-inv in the dialog script as well. I mean, it makes sense. To make sure Chris reads this, I am moving it to the Tech Forum
Status: Trying to come up with some ideas...

Dennis

Thanks all.

AGS is really great. I could get started right away on making rooms and importing frames etc. Dialogues no problem (Anything that has examples you can nick from the Demogame really.) - If there was a Lose-Inv X then people like me could make make a fairly desently working "game" before having to dive into the (To me VERY scary) global script.

This would then make non-tech people (Or non Smart - Again; me) less prone to being overwhelmed and giving up.

Because If you've done a game that functions satisfyingly, you' d be keen to learn the global script stuff to improve your adventure furter. I think all AGS users really love point and click adventures, and having played them you've sort of used a dialogue system in playing them. So the concept feels familiar. However the global scripts can seem alien and larger than life to people who have perhaps  done no programming at all. (Like those who only had consoles, and never a programmable computer - misfortunate ones indeed. - Not Me) [The console bit - Not the coding:)]

Uh..I'm taking up bandwith here... Anyway my feeling is that if AGS could hanlde the 'gameplay basics' from the dialogue and the 'extras' in the global script the tool would have a natural built in difficluty level, thats all.

Double respect
Dennis

MillsJROSS

Let me explain the process then, so that you can continue with your game making AND learn something about the technical side of AGS, too. The technical side, isn't that technical. If you want to remove your inventory from the dialog do the run script X

Then go the script on your menu bar, go to Edit Global Script (or learn the hotkeys, Ctrl+G, and move along quicker), and enter this code in your script...

function dialog_request (int cup) {
   
   if (cup == X) {
               LoseInventory(X);
               
}
}

The word cup isn't what you need to use, you could use and word you want. So just replace all cup's with whatever word you want to use. Make sure you close the script with these "}", If you don't the engine will tell you you have a Nested function, which basically means, you didn't close off your script so the engine was unable to read anything afterwards, as it thought it was still part of the dialog request function.

Hope that helps...and I agree, it might be easier to have the lose inventory function from the dialog editor. BUT, The more you know about the engine, the more you can manipulate.

-MillsJROSS

TerranRich

This is a good suggestion, however, because it would get messy if you needed a bunch of "lose-inv" type scenarios. It's just about organization and neatness, that's all. There are workarounds, of course, but I think this is an easy suggestion to implement. :)
Status: Trying to come up with some ideas...

Dennis

I'm very grateful for the script though, thanks MillsJROSS! It will see me through my initial humble aspirations.

But I believe that if you have a game (Like mine) that has most of its transactions done in the dialogues it would be really nice and simple for ASG handle both the add and delete without one having to script a new bunch of lines in the global script. (Still scares me. But now I've faced the beast and lived.)

And not that I can wait for a new version to keep going.

Thanks Everyone
Dennis.

Pumaman

Yep, lose-inv is a good suggestion, I'll add it to my list.

RickJ

Quote... I could get started right away on making rooms and importing frames etc. Dialogues no problem (Anything that has examples you can nick from the Demogame really.) - If there was a Lose-Inv X then people like me could make make a fairly desently working "game" before having to dive into the (To me VERY scary) global script.

This would then make non-tech people (Or non Smart - Again; me) less prone to being overwhelmed and giving up. ...
Dennis, Yuster

A number of us are working on tutorials and a remake of the Demo game to make scripting easier for newbies and everyone.  Your insights and input would be useful in helping us identify the things that would be of greatest use to beginners.  Check out this thread To SSH, Scorporius, and all AGS scripting "experts"... in the beginners tech forum.  Send me a PM if you wish to participate in review and production of tutorials and DemoQuest remake project .

 

SMF spam blocked by CleanTalk