Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 1,390 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: combat code problems [Re: Superku] #408168
09/26/12 17:48
09/26/12 17:48
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
oh ok... what should i use instead?


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: combat code problems [Re: Doc_Savage] #408174
09/26/12 20:05
09/26/12 20:05
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Originally Posted By: Superku
Don't use global pointers for that, just handle individual things, attributes and the like with skills.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: combat code problems [Re: Superku] #408203
09/27/12 09:05
09/27/12 09:05
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline
User
exile  Offline
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
Superku is right, the way I handled my combat in my "Tales of Symphonia" styled combat game/project is like this...

-Player swings sword. Theres a trace going from the base of the sword to the tip.

-When it comes in contact with an entity, I check to see what kind of entity it is with skills, like;
Code:
if(hit.entity)//Did I come in contact with an entity?
{
   enemy_hit = hit.entity;//Set a pointer to the enemy I hit
   if(enemy_hit.skill10 == 2) //Is the thing I hit an enemy?
   {
      enemy_hit.skill11 = 1; //Let the enemy know I am hitting it
   }
}


-What this does is simply setting a pointer to whatever I am coming in contact with, then checking to see if what I am hitting is an "enemy" type. If it is, I set its "I am being hit" skill (skill11 in this case) to 1.

-In your enemy code, you then just have to set it like...
Code:
function enemy()
{
   my.skill10 = 2;
   while(my.health>0)
   {
      if(my.skill11==1)//Checking to see if the enemy has received a "hit" confirm
      {
         //Do hit animations, reduce damage, etc
         my.skill11 == 0; //Reset the skill
      }
      wait(1);
   }
}



-I added a "stun" skill to my enemies which determined how long the hit frame should last between hits. So say if I have a stun of 40, then there will be a wait time of 40 frames unil the enemies "hit" skill gets reset to 0.


This is the way I did it, and it may not even be the "best" way to do it. But it works, and if anyone out there can give this guy some better advice please do so. I dont like giving misinformation laugh

Last edited by exile; 09/27/12 09:08.
Re: combat code problems [Re: exile] #408631
10/04/12 21:06
10/04/12 21:06
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
thank you all! ive solved it thanks to you all. than you.


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Page 2 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1