Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: deltoran on Wed 14/01/2009 02:51:34

Title: How would i create a fighting scene
Post by: deltoran on Wed 14/01/2009 02:51:34
I need to make a scene where my guy has to attack a ghost and have a fight.
and if possable i would like to make there be more than one ghost.  :)
Title: Re: How would i create a fighting scene
Post by: Akatosh on Wed 14/01/2009 11:55:28
Yep, it's definitly possible, and you can have as many ghosts as you like (although it tends to get unreasonable in the four-digit area  :P). The actual scripting depends on what you want the fight to be like (round-based, actiony, tactical, just a clickfest, ...) so some more information would be nice.
Title: Re: How would i create a fighting scene
Post by: Khris on Wed 14/01/2009 12:02:05
Also, creating even a basic combat system requires relatively advanced scripting and programming abilities in general.
You'll be better off getting a firm grip of the editor's and scripting language's basics first.

Otherwise this thread will soon turn into a "do X" - "ok, but Y doesn't work" - "then do Z" - "ok, but XY doesn't work" - fest.

I understand that you have this game idea and now want fast results to concentrate on design, but unless you enlist an able coder, you'll really have to bite your way through the scripting stuff first.
Title: Re: How would i create a fighting scene
Post by: Dualnames on Wed 14/01/2009 12:05:39
It's actually virtually impossible to go building a Skyscraper without knowing how to build a house.
Title: Re: How would i create a fighting scene
Post by: Akatosh on Wed 14/01/2009 14:42:35
Quote from: KhrisMUC on Wed 14/01/2009 12:02:05
Also, creating even a basic combat system requires relatively advanced scripting and programming abilities in general.

Actually, you could set up a crude, shitty little clickfest combat easily enough...


Top of the global script:

int playerHP=100, enemyHP=100;
bool combat;


repeatedly_execute():

if ((IsTimerExpired(1))&&(combat==true)) {
playerHP-=Random(5);
if (playerHP<=0) {Display("lozer!!1!"); QuitGame(0);}
else SetTimer(1, 10);}


That enemy character's interaction:

// script for Character 3 (Ghost): Any click on character
if (mouse.Mode==eModeAttack) {
enemyHP-=Random(5);
if (combat==false) {combat=true; SetTimer(1,10);}
if (enemyHP<=0) {Display("you winz!!!1"); cGhost.ChangeRoom(-1); combat=false; playerHP=100; enemyHP=100;}
}


... but if you want to to actually be FUN, then yeah, get some more experience first.