Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Thu 05/05/2005 21:02:42

Title: Arithmetic on globalints in dialog script
Post by: on Thu 05/05/2005 21:02:42
I am trying to add or subract to a global int within a dialog script, and using the values to determine what message is called to be displayed on a gui.

I cannot seem to get the globalint to change though.
Here is how I am trying to increase the value:


set-globalint(1, GetGlobalInt(1) +1);

This doesn't seem to work. If anyone can point out where' I'm going wrong I would appreciate it.
Title: Re: Arithmetic on globalints in dialog script
Post by: Ashen on Thu 05/05/2005 21:29:28
I think the problem is that you can't call GetGlobalInt() directly from dilog scripting. Try using dialog_request and run-script x (which are explained in a couple of posts still on the first page of Beginners Tech, if you don't know how to use them).

EDIT: Actually, it look like they've fallen off the first page, apart from this one (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=20651.0), which should still help.
Title: Re: Arithmetic on globalints in dialog script
Post by: on Fri 06/05/2005 01:21:57
Thanks dude, shame search function isn't working, woulda found that earlier.
Title: Re: Arithmetic on globalints in dialog script
Post by: TerranRich on Fri 06/05/2005 03:07:31
Who needs Search when you've got

THE BFAQ (http://bfaq.xylot.com) ;)