Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - thehivetyrant

#1
Hi,

I'm trying to get rid of a character when i kill him. I'm having several issues.

I place this code within rep_ex section of the global script. So it repeatedly check whether it's true.

Code: ags

if(EnemyHealth[1] < 1)                    // if the enemy's health is 0 or less.
  {
    KillCount += 1;                           // Add 1 to killcount interger variable. This part causes problems since when enemy is dead it just 
                                            //adds one every game loop since the condition is true. I only want this to happen once. :(
    cStitches.LockView(3);                // Changes view to a blob of blood
    cStitches.StopMoving();               // Make the enemy stop following the character.
}


Generally it's the adding to the variable thats the problem. is there a way to disable a character all together or possibly a way to only run a part inside that if statement once?
#2
Hi Matt here,
                    i have a character whose walking/standing animation is this size.


When you press the 'A' button he goes into an attack animation. Which is approximately this size.


I have some basic issue and questions involving this.

when I press 'A' he goes into the attack animation but the character moves to the right while he swings:
This is because it centers the image. and therefore his body is to the right of the attack image.

However if i extend the transparent area so he is always in the middle of every picture, then the collision detection goes way off as the enemies react to the transparent area next to him.

is there a way to set the image to the right or left?
Or possibly make it so enemies dont react to transparent pixels?


there are my thoughts on how to fix, if any other ideas fly in, i'll be sure to get my butterfly net out in time.

Thanks again,
                    Matt.
#3
Hi,
    My games coming along nicely but as i'm heading deeper into it i realise i need more enemies.
At the end of the game i could have 20 or so enemies.
I am worried i will have to create 20 "characters" that are all the same.
And on top of that i have code like "if (Zombie.IsCollidingWith(Player)...)" etc
And am scared i will have to duplicate that 20 times for each character or us a lengthy amount of || (< that means OR right?)

Is there a way to place the same character in the same room, at the same time, multiple times?
For example: 3 of the same zombie characters.

If not, I've been reading about class's and array's.
I thought it would be useful to set up a parent class and have all characters be a child of that class (taking on it's code).
I'm unsure if this is doable.

I'm also confused about whether an array would work in this situation.

So basically, i need your opinions on what would be the most effective method in keeping repitition to a minimal.

Thanks in advance!
           From Me


#4
Hi people, sorry for another post.

I'm having a very difficult problem regarding animating with NoBlock.
Allow me to try to set the scene.

When character B collides with character A he changes his view and attacks.
 
  if (cStitches.IsCollidingWithChar(cGrim) == 1)
   {
     cStitches.LockView(VATTACK);
     cStitches.Animate(0, 2, eOnce, eBlock, eForwards);
     if(cStitches.IsCollidingWithChar(cGrim) && cStitches.View == 2 && cStitches.Frame == 5)
       {
          PlayerHP -= 10;
          HP.Width -= 10;
        }
     cStitches.UnlockView();
    }
 

At the moment i have the Animate configured to eBlock, this works okay but the player is unable to move during this which is bad for this game,
If i change it to eNoBlock, then when they collide character B (who should attack) just stands there.

as i understand it, it just skips the function because nothings stopping it.

I tried setting up SetTimer but couldn't get it to work.
And have also tried to set up a global variable but to no avail niether.

Help?

If more code is needed i'll write some up, since i've tried various alternatives to attempt to get it to work i've deleted ones i couldnt get to work, so dont have it on hand.

Thanks Matt!

#5
Hi,
   I'm trying to get the GUIAnimation plugin to work from
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=29113.0

The download only has a .txt and a .scm file.
I've tried to put them in folders but to no avail. I've searched around and apprently i am supposed to get a .dll file?

Is this true or am i misunderstanding.

Also while i'm on the subject, instead of starting a new thread, i've read it's not possible to do any form of Wait() command without Blocking, i was wondering if this has changed at all?
If not, is there any way to emulate it?

that is all, i appreciate any help, Matt.
#6
Hi there,
            I've made 2 charcaters thus far, the playable character Grim and an enemy Zombie.

I have made the Zombie charcater follow the Grim character as a vague AI, and when he collides with Grim his animation changes to attack (melee).

I want it so that when the charcaters touch nothing happens but if they touch while he is in this specific attack animation then something happens.
Is there a way to specify a collision with a certain animation?

---------------------------If above is possible there's no reason to read below-------------------

If this is not possible i thought that i could emulate it so that whenever Zombie enters the attack animation, that he fires a bullet (invisable) which travels a tiny distance (Melee Attack distance) And when the bullet collides with Grim the event happens.

I scouted around and am currently trying to do this by creating a character cBullet01 (invisable) then Making it follow Zombie (using FOLLOW_EXACTLY).

This results in triggering the health loss event when Grim is inside Zombie (since the bullet is just 1 pixel and is in the centre of the zombie)

I tried to use cBullet01.move command to move it x a few pixels when he is in attacking animation, but it doesnt seem to move. (I expect because its allready on FOLLOW_EXACTLY.

Sorry about how large this post is and no code, i'll post some if needed when i get home.

Any help would be appreciated. Thanks
Matt.
#7
HI,
   I have set up a global variable of 10 and created a GUI button and am trying to make the text show '10' from that global variable.

PlayerHP = 10

I have tried @PlayerHP@ and %PlayerHP but they just show the text but not the variable value.

Any help would be appreciated. thankyou.
SMF spam blocked by CleanTalk