Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 16,655 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
SOLVED - Collision problem - SOLVED #424790
06/21/13 19:58
06/21/13 19:58
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
I made an ogre model that approaches the player when he comes near it until the distance between 'em becomes less than 500 quants ,then the ogre stops approaching the player when it becomes at a distance of 75 quants from the player and after that the ogre plays its attack animation

THE PROBLEM is that the ogre never becomes at 75 quants from the player and the attack animation is so sharp that nearly every second 2 or 3 frames are played of 40 frames




***PROBLEM SOLVED***

Last edited by The_KING; 06/24/13 07:23.
Re: Collision problem [Re: The_KING] #424793
06/21/13 20:26
06/21/13 20:26

M
Malice
Unregistered
Malice
Unregistered
M



I don't understand what you are saying about the animation can you please explain more I am a little dumb. Also check if the vec_dist is being reached.


place at top of action
Code:
var test_var =0;




modify this if()
Code:
if (vec_dist(my.x,player1.x) <= 100)
  { ogre_active = -1; 
    test_var =vec_dist(my.x,player1.x);
    
  }DEBUG_VAR(test_var,10);



If test_var is never greater then 0 that could be the problem.
It's a little confusing reading the code so I have to help trouble shoot and yes I do not right now know what is wrong or how to fix it. I am thinking it might be the size of the two entities bboxes

EDIT* or maybe after the c_scan you doen't == player1 you can test this to

Code:
if(you == player1)
{ 
   test_var = 1;
}
else
{ 
   test_var = 0;
} 
 DEBUG_VAR(test_var,10);



EDIT moved DEBUG_VAR() out of the if() in second code block

EDIT one last note - and I could be wrong - but I don't think setting ANM_CYCLE actually modifies the value in the percent_var. I think it just ignores the 3rd digit place so 599 and 199 are viewed simply as 99. So resetting the value of the percent_var should be done or you could end up with a var out of range after long game play.

Code:
my.attack_percentage += 3*time_step;
my.attack_percentage %= 100;


Please correct me if I am wrong because I'd really like to know this information for sure.

Last edited by Malice; 06/21/13 20:55.
Re: Collision problem [Re: ] #424817
06/22/13 11:54
06/22/13 11:54
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
Originally Posted By: Malice
I don't understand what you are saying about the animation can you please explain more


Sorry, I know I wasn't clear enough ,I was on a hurry. I have an ogre model that keeps patroling in a limited way (ogre active = 0). If the distance between the ogre and the player is less than 500 quants ,and if the ogre detected the player using a simple "c_scan" instruction ,then the ogre moves towards that sneaky player. The distance between them keeps decreasing until it reaches less than 75 (or 100 here after changing) quants. At that moment, the player health (global variable) keeps decreasing and the ogre plays its attack animation



THE PROBLEM: The ogre keeps approaching the player until at a certain extent when the ogre keeps playing its run animation ,but is stopped from moving as if there is an invisible obstacle in its way. Also, the attack animation is so sharp and slow (when I change the pan angle of the player a little bit, the obstacle is gone and the ogre can approach the player and play that boring attack animation)

NOTE: It is correct that "vec_dist" doesn't become less than 100 quants ,but even when I make it "250" for example and it reaches less than 250 quants ,the ogre doesn't leave its place as if there is something in its way (It is not the problem I think)

NOTE 2: I think it is a collision problem (that is why I chose that title) ,but I tried to use "min_x,min_y...etc." and tried to use some functions ,but that doesn't work at all

Originally Posted By: Malice

Also check if the vec_dist is being reached.


place at top of action
Code:
var test_var =0;




modify this if()
Code:
if (vec_dist(my.x,player1.x) <= 100)
  { ogre_active = -1; 
    test_var =vec_dist(my.x,player1.x);
    
  }DEBUG_VAR(test_var,10);



If test_var is never greater then 0 that could be the problem.


I did that and "vec_dist" was successful


Originally Posted By: Malice

It's a little confusing reading the code so I have to help trouble shoot and yes I do not right now know what is wrong or how to fix it. I am thinking it might be the size of the two entities bboxes


I think that ,too. So, I want to know how to make the BBOX as small as possible with respect to the model size (I read the manual ,but it couldn't help me)


Originally Posted By: Malice

EDIT* or maybe after the c_scan you doen't == player1 you can test this to

Code:
if(you == player1)
{ 
   test_var = 1;
}
else
{ 
   test_var = 0;
} 
 DEBUG_VAR(test_var,10);



EDIT moved DEBUG_VAR() out of the if() in second code block


You are close to right. The "c_scan" worked fine ,but after I removed it ,there were no any obstacles grin ,BUT I still have the boring animation problem that the animation is played too slowly ,and after the player dies ,it is played with the normal speed (tell me if you want the player's code)

Originally Posted By: Malice

EDIT one last note - and I could be wrong - but I don't think setting ANM_CYCLE actually modifies the value in the percent_var. I think it just ignores the 3rd digit place so 599 and 199 are viewed simply as 99. So resetting the value of the percent_var should be done or you could end up with a var out of range after long game play.

Code:
my.attack_percentage += 3*time_step;
my.attack_percentage %= 100;


Please correct me if I am wrong because I'd really like to know this information for sure.



don't know but I think that "ANM_CYCLE" ,as you said, reads 199, 299 ...etc. as 99. I will reset the percentage value as you said.


CONCLUSION: There is only one problem bothering me which is the VERY SLOW ANIMATION PROBLEM. When the ogre is close to the player ,it plays its animation like it is a very sharp slow motion animation ,and also tell me how to make the BBOX as small as possible. btw, is there a difference between collision hull and BBOX?


Regards

Last edited by The_KING; 06/22/13 12:05.
Re: Collision problem [Re: The_KING] #424821
06/22/13 12:45
06/22/13 12:45
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
I found it!...

The only obstacle in the ogre's way was the "c_trace" that I am sending from the camera for shooting (actually, I don't know why the "c_trace" would stop the ogre model from moving although I am using it with another enemy and the enemy doesn't stop!!)

BUT the evil animation problem still exists!....

1 problem solved
1 problem left

Re: Collision problem [Re: The_KING] #424833
06/22/13 16:11
06/22/13 16:11

M
Malice
Unregistered
Malice
Unregistered
M



It could be that ogre_active is not always -1 when in range of the player. do a DEBUG_VAR() test on it an place right above the while()'s wait(1);

Code:
test_var = ogre_active; 
DEBUG_VAR(test_var,10);
wait(1);
}



If this value is not -1 every frame then the animation will not play every frame.

Here is what I'm thinking

Code:
if (vec_dist(my.x,player1.x) < 500 && (my.health > 0)) 
   {
   	c_scan(my.x,my.pan,vector(360,60,1700),IGNORE_ME | SCAN_ENTS | SCAN_LIMIT);
   	
   	   	if (vec_dist(my.x,player1.x) <= 100+25)
 
                {
                        if(vec_dist(my.x,player.x)<= 100)
                        ogre_active = -1;
                }
   		else
   		{ 
   		 ogre_active = 1;
   		}
   	else
   	{
   		ogre_active = 0;
   	}
   }
   
   else 
   {
   	ogre_active = 0;
   }


Re: Collision problem [Re: ] #424838
06/22/13 16:43
06/22/13 16:43
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
Don't know but I am sure that it is because of the shooting "c_trace" instruction that I am using in my player's action. Every time I am at the ogre, the ogre stops ,but when I move the crosshair away from it ,it starts moving towards me

Does c_trace have an effect on an entity moving with c_move instruction?

Re: Collision problem [Re: The_KING] #424848
06/22/13 17:20
06/22/13 17:20
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
All the problems were SOLVED except the animation problem....

Re: Collision problem [Re: The_KING] #424849
06/22/13 17:28
06/22/13 17:28

M
Malice
Unregistered
Malice
Unregistered
M



Did any of my last post help with the with the animation problem? I can look again at the c_trace and the orge event for problems if you post those pieces (please don't post all the player code if it is not need). As I remember you were using a continuous c_trace with no front logic.

EDIT * c_trace modifies some of the things used in c_move, like me,you, and more. and in opposite too. You might need to reset these values after one of these instructions.

Last edited by Malice; 06/22/13 17:31.
Re: Collision problem [Re: ] #424850
06/22/13 18:06
06/22/13 18:06
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Or if you don't need those things, you could use 'IGNORE_ME' or 'IGNORE_YOU'.

Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Collision problem [Re: 3run] #424870
06/23/13 11:12
06/23/13 11:12
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
There is nothing with the c_trace instruction

I think it is the model itself. Actually, that's a weird model. I had to set the c_move RELATIVE vector to negative values all the time to make it move FORWARD

You can download that model here and check it: http://www.hellupload.com/az5moo4glpdo/ogre.MDL.html

@Malice That is only a 7 MB .mdl model. You can download it.

Thank you all for introducing help

Page 1 of 2 1 2

Gamestudio download | 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