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

Messages - thehivetyrant

#1
Yeah adding an if statement over the attack collision checking whether he's in View 3 or not, worked.

I wouldn't have been able to get to this conclusion without you.

It's really good to talk things through, free's up the brain.

Thanks chummy!
#2
This could probably have something to do with it, it's also in rep_ex and probably activates when colliding;

Even though he's stuck in blood blob view, he changes behind the scenes to the attack animation (doesn't actually show) and then my Original code loops again adding moreto Killcount.

Sound plausible?


If so, it seems i should add an if statement that checks whether he's not in view 3 before doing attack collision detecton.

ps: your up late :)
#3
That fixed the following problem good and proper, and i understand why which is good.

However i notied another problem now.

They turn to a blood blob, it adds 1 to kill count, it seems to keep adding to the kill count if the player is colliding with the blob. if he's not colliding then it doesnt add any.

Strange!

Do you think i need to be more specific with he View? since it's only when i collide, in past code i have:

Code: ags


if (cStitches.PPCollidesWithC(cGrim) && !cStitches.Animating) //Enemy is colliding & not animating
   {
     cStitches.LockView(VATTACK); // Enter attack animation view
     cStitches.Animate(0, 2, eOnce, eNoBlock, eForwards); //animate once through 
   }
   if(cStitches.View == VATTACK && cStitches.Frame == 5)  //animation done
   {
     if(cStitches.PPCollidesWithC(cGrim))
     {
       PlayerHP -= StitchesAttackPower; // reduce health variable by 10
       HP.Width -= StitchesAttackPower; // reduce healthbar by 10 pixels
     }
     cStitches.UnlockView();
   }


PPcollide works the same as usual collision, but is for a Pixel perfect script is all.

#4
Haha please explain another way then  :P

Since i have multiple enemies which the player can kill, each adds 1 to the variable.
I cant be sure which the player will kill first so i can't use that way.

I did try checking whether the enemy 'cStitches' is in View 3.

Code: ags

if(EnemyHealth[1] < 1 && cStitches.View != 3)
  {
    KillCount += 1;
    cStitches.StopMoving();
    cStitches.LockView(3);
  }


This should go through once because both are not true and then stop.

But the enemy turns into the blood blob and then continues to move. I cannot fathom why.
It may have something to do with code elsewhere.

I just had a check, my
Code: ags
  cStitches.FollowCharacter(cGrim,  10, 0); 
was in the rep_ex also.
But i placed it into 'When room first loads' so it would only tell them to follow at the start, i was hoping if i tell it to stop i'd stop forever.

Is there any errors on the above mumbo jumbo?

Thanks in advance
ps: forgive my spelling, keyboards acting up.
#5
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?
#6
D'Oh so simple!
#7
Okay guys i think i've managed to solve it. (although i havent tested it using the animations in my original post yet)
For others that it might help.

I used the module found on this site called Pixel Perfect Collision.

- I had some issues when using it, my characters wouldn't collide at all
- I solved this by making the characters clickable (because of reasons it doesnt check unclickable characters)

and then

- the enemy would attack if my foot touched his head or vice versa.
-I solved this by going into the pixel perfect collison script and changing line 42:
int aheight = (Game.SpriteHeight[graphic]/4);

This changes the height at which it'll collide to 1/4 of the sprites height. You can change this of course.

Thanks for you help both of you.
#8
Hmm the latter option wouldnt work i dont think.
haha Its not a fireball it's a rough sketch of his sword swing. when i've finished the drawing that'll be his sword and it wont be at his side. Sorry for that confusion.

The i could probably do the first option you stated, moving his x co-ord while he's attack and then move him back?
I'd have to consider whether this could cause the enemies to have collision issues or not.

I'll give it a look at.
#9
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.
#10
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


#11
oh wow that works great!
I mean, really, wow! :o

really nice one!
#12
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!

#13
Thanks for that, i did try looking all over the place for help with that.
SetTimer, i'm looking at it now, thanks again.

what would i do without you :)
#14
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.
#15
thanks i will check up on that, thanks for the advice
#16
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.
#17
Anyway you or someone could inform me of how you solved this.
I would like to know ^^
#18
Thanks, that worked great, i apologiose for the new thread for this since it did seem very elementary.

...dear watson?  :P
#19
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