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 1 of 2 1 2
combat code problems #408147
09/26/12 14:10
09/26/12 14:10
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
hi there, i have a big issue with combat, i have a player with a sword, he is using the c_trace function to hit an enemy and deal damage, 5 points. that is all fine and working, the problem is, he hits multiple times while his sword is passing through the enemy and ends up dealing 15 or 20 damage points!! it is so frustrating, i cant find a single thing to thwart this, can anyone help? i would love for the enemy to be dealt one unit of damage each time the sword passes through him.




also is there a way to have the animation set up so you click the mouse and release, he swings his sword and stops when the animation is done? and while holding down the mouse button he swings continually? like in the game diablo.



i know this is a lot to ask but i would like a few hints here, ive done a LOT of research and tried hard to solve it through expiramentaion. ive been on these problems for 3 weeks. hopefully i can get some results from the pros laugh thanks guys. im hoping you can help me with these problems and thank you for your time.


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] #408149
09/26/12 14:28
09/26/12 14:28
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
you should post your code
we must see what you done there

Re: combat code problems [Re: GameScore] #408154
09/26/12 15:50
09/26/12 15:50
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
i cant unfortunatley, im away from home, but its your basic c_trace function on a sword model. i hope someone can help me with those problems anyway.


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] #408156
09/26/12 16:45
09/26/12 16:45
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Don't trace along the sword's blade, only perform one box-trace at the middle of the animation, or check if any of the enemies are in front of the player for weapons with splash damage.


"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] #408157
09/26/12 17:00
09/26/12 17:00
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
can you please show an example of that? ive never heard of this strategy. i would be very appreciative. also any idea on my animation problem?


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] #408160
09/26/12 17:09
09/26/12 17:09
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
action act_player()
{
while(1)
{
if(mouse_left)
{
my.skill20 = 0;
my.skill21 = 1;
while(my.skill20 < 100)
{
my.skill20 += 10*time_step;
ent_animate(me,"attack",my.skill20,0);
if(my.skill20 > 50 && my.skill21)
{
my.skill21 = 0;
VECTOR temp;
vec_set(temp,vector(100,0,0)); // 100 = weapon range
vec_rotate(temp,vector(my.pan,0,0));
vec_add(temp,my.x);
c_trace(my.x,temp,IGNORE_ME | IGNORE_PASSABLE);
if(you)
{
if(your._type == type_enemy) //identify your enemy somehow, where _type is defined as skill100 or something like that
{
your.health -= 25;
}
}
}
wait(1);
}
}
move & turn;
wait(1);
}
}


"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] #408162
09/26/12 17:19
09/26/12 17:19
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
oh WOW. ok. so this is how to do the trace in the middle of the animation huh? so ctrace is a bad idea then.. hm.. ok. im assuming this is a player code. i totally get it now.

edit: i just remembered i have the enemy identified with an entity pointer, will that work here?

Last edited by Doc_Savage; 09/26/12 17:26.

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] #408164
09/26/12 17:35
09/26/12 17:35
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Originally Posted By: Doc_Savage
oh WOW. ok. so this is how to do the trace in the middle of the animation huh? so ctrace is a bad idea then.. hm.. ok. im assuming this is a player code. i totally get it now.

edit: i just remembered i have the enemy identified with an entity pointer, will that work here?


When your enemies are all having the same entitypointer (what I dont think) then yes.

Last edited by Ch40zzC0d3r; 09/26/12 17:35.
Re: combat code problems [Re: Ch40zzC0d3r] #408165
09/26/12 17:40
09/26/12 17:40
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
well funny enough, im having trouble with more than one enemy in the game, some things sync like alert distance and stuff. any idea how to separate them?
i need to know how to individualize them. should i be using more than one entity pointer or what?

Last edited by Doc_Savage; 09/26/12 17:41.

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] #408166
09/26/12 17:43
09/26/12 17:43
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
i just remembered i have the enemy identified with an entity pointer, will that work here?

Quote:
well funny enough, im having trouble with more than one enemy in the game, some things sync like alert distance and stuff. any idea how to separate them?

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
Page 1 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