Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: mousemat on Wed 03/11/2004 13:40:05

Title: It cant attack me o.0
Post by: mousemat on Wed 03/11/2004 13:40:05
Hi....I am making an RPG and its not going well.
I can attack the oponent but the opponent can't attack me!!
Do you have to make another score Gui if yes ..how, If not then how do you make it so it canh attack you?

Thanks for any help,
Mousemat
Title: Re: It cant attack me o.0
Post by: Ishmael on Wed 03/11/2004 14:43:18
Um... what you actualy have done so far? What have you scripted for the player attacking, and what for the opponent attacking back?
Title: Re: It cant attack me o.0
Post by: Hellomoto on Wed 03/11/2004 16:19:20
Depending on what you are creating, this could take a lot of AI, especially if you want the computer to have a fighting chance.

You would have to be more detailed in your description of what you are doing.
Title: Re: It cant attack me o.0
Post by: mousemat on Thu 04/11/2004 13:28:07
Ok its going to be like a pokemon kinda battle..hope that explains it..i am trying also to find a way of making somthing like this with little scripting..and its working apart from the opponent attacking :-\
Also i would like to know if it is possibly to have a counting down timer clock thing for my sunrider game?
Title: Re: It cant attack me o.0
Post by: BorisZ on Thu 04/11/2004 13:34:54
Create attacking animation, set random variable and if that random variable is set to number you want, decrease your hit points.
Title: Re: It cant attack me o.0
Post by: mousemat on Fri 05/11/2004 11:57:38
Then i need 2 guis swith @score@ on ... how do you do that so they both don't show the same no. of hits?
Title: Re: It cant attack me o.0
Post by: Ashen on Fri 05/11/2004 12:14:11
what does the score have to do with it? And why would you need 2 GUIs?
Would one be the character HP, and the other the enemy?
If so, try using a GlobalInt to store one of the HP values, and use @GIx@ (where x is the number of the GlobalInt) instead of @score@ on one GUI.

And about the countdown timer, checkout strazer's second bit of code in THIS THREAD. (http://www.agsforums.com/yabb/index.php?topic=17017.0)
Title: Re: It cant attack me o.0
Post by: Ishmael on Fri 05/11/2004 13:06:30
I think the @GIx@ tag don't work on GUI labels, only on displayed messages... or atleast used to in an older version...
Title: Re: It cant attack me o.0
Post by: mousemat on Fri 05/11/2004 13:30:35
????????????
also i would like to know how to make some thing like a clock that counts down .... If that is possible :-\
Title: Re: It cant attack me o.0
Post by: Ashen on Fri 05/11/2004 13:35:23
Oh bum, Ishmael's right. You'd have to use:

// in 'Repeatedly Execute'
Ã,  string hp;
Ã,  StrFormat (hp, "%d", GetGlobalInt (1));
Ã,  SetLabelText (0, 1, hp); // or whatever GUI/Object you're using


Which means it's probably as easy to create a custom int.

Was the countdown link in my last post no use, then?
Title: Re: It cant attack me o.0
Post by: mousemat on Fri 05/11/2004 13:37:39
Sorry didn't notice your last post..just gonna check it out now ;)

Oooh i will try that after school thanks ;D

and i will try out that hp thing!! ;)
Title: Re: It cant attack me o.0
Post by: poc301 on Fri 05/11/2004 14:36:52
I haven't used the repeatedly execute yet, but doesn't that stop all other processes until it finishes?
Title: Re: It cant attack me o.0
Post by: on Sun 07/11/2004 11:00:34
er Countdown dosent do anything....what else do i have to program to get it working? :-\
Title: Re: It cant attack me o.0
Post by: Ashen on Sun 07/11/2004 12:58:35
What have you got so far? How is it not working - not counting down, starting from wrong time, not displaying, generating an error, just not doing anything?
Title: Re: It cant attack me o.0
Post by: mousemat on Mon 08/11/2004 13:31:37
It is not counting down. it just comes up with:
00
00
Title: Re: It cant attack me o.0
Post by: Ashen on Mon 08/11/2004 13:42:19
Will the game still time out when you want it to (i.e it's just the display that's not working), or is the clock not working at all?

Either way, can you post your repeatedly_execute code.
Title: Re: It cant attack me o.0
Post by: mousemat on Tue 16/11/2004 11:55:03
Why is it that every time i edit the script there is always an undifined token :P
Title: Re: It cant attack me o.0
Post by: Gilbert on Wed 17/11/2004 01:37:40
Probably you had mispelt a function/variable name, or forgotten to define a variable.
Can you post your script here for us to check?