Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Mouth for war on Mon 22/06/2009 15:31:23

Title: Suggestions for future releases of AGS
Post by: Mouth for war on Mon 22/06/2009 15:31:23
Maybe I post this in the wrong forum. I didn't really know where to post it. But i have a suggestion for future versions of AGS. I've looked through the manual quite alot and if i have missed this I'm sorry. For example when an animation is playing and you want something specific to be done during that animation...maybe you need to put something in a guy's drink to make him pass out...and can only do so when the character looks away..for example"cMan.animationframe = 2" /add code. Maybe just me who would find this useful but...only a suggestion. If a simple way of doing this already exists I'm sorry and maybe you can enlighten me :)
Title: Re: Suggestions for future releases of AGS
Post by: GuyAwesome on Mon 22/06/2009 15:37:49
Do you mean like Character.Frame (http://www.adventuregamestudio.co.uk/manual/Character.Frame.htm)?

You might also want to check the View and/or Loop currently being used (not so much in your example, but there might be a call to), but there's properties for them, too :)
Title: Re: Suggestions for future releases of AGS
Post by: Mouth for war on Mon 22/06/2009 15:44:41
hmm maybe it's just that hehe. But is is possible to change a variable then for example...if the Characterframe is = 4 or whatever the guy looks away and the variable changes to 1 and when the characterframe reached = 11 he looks back again and the variable changes back to 0...and only when it's set to 1 you can put the  poison in the drink. I'm just a lousy coder :D I'd be glad for a example of such code :)
Title: Re: Suggestions for future releases of AGS
Post by: GuyAwesome on Mon 22/06/2009 16:00:51
Off the top of my head

bool canPoison;

// room_RepExec or global repeatedly_execute
if (cMan.Frame >= 4 && cMan.Frame <=11) canPoison = true;
else canPoison = false;


// wherever the 'add poison' code goes (use inv on char?)
if (canPoison) {
  // Do stuff
}
else player.Say("Not right now..."); // or whatever


Depending on how exactly you've set things up, you might need to make canPoison a global variable (i.e. so you can set/check it in room and global scripts), and/or add a few checks the cMan and the player are in the right room (so you can't poison the poor fella when he's in the office and not the canteen, for example). In this specific case, it might actually be easier to use if (cMan.Frame >= 4 && cMan.Frame <=11) directly in the interaction and skip the variable, unless you're likely to need it for something else (e.g. other interactions with cMan).
Title: Re: Suggestions for future releases of AGS
Post by: Mouth for war on Mon 22/06/2009 16:40:04
Thanks I'll try that :)