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 (AndrewAMD), 1,089 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
Ignore Entities with special skill values when performing c_move #293002
10/08/09 14:56
10/08/09 14:56
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline OP
User
garv3  Offline OP
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
Hi all,

is it somehow possible to ignore special Entities when moving an entity by c_move? I know IGNORE_FLAG2, IGNORE_PASSABLE, IGNORE_YOU and so on...

What I want to do is: Prevent the players' entities (it's multi player) from colliding with each other and prevent the enemies from colliding with each other and prevent items from colliding with each other and enemies.
For the players (two ships) I already tried:
Code:
// SHIP 1 FUNCTION
[...]
you = Player2Schiff;
c_move(me, nullvector, vec_scale (tempVec, -0.5*Player1Bewegungsgeschwindigkeit*time_step), (IGNORE_PASSABLE | IGNORE_PUSH | IGNORE_YOU));
[...]
// SHIP 2 FUNCTION
[...]
you = Player1Schiff;
c_move(me, nullvector, vec_scale (tempVec, -0.5*Player1Bewegungsgeschwindigkeit*time_step), (IGNORE_PASSABLE | IGNORE_PUSH | IGNORE_YOU));
[...]

But they still collide and get stuck when moved 'through' each other -> why?.
It would be great if it is possible to set an IGNORE_SKILL5 for example and the c_move operation ignores all entities with the same skill5 value. Code would be somewhat like:
Code:
ship1.skill5 = 123;
ship2.skill5 = 123;
[...]
// SHIP 1 and 2 FUNCTION
c_move(me, nullvector, vec_scale (tempVec, -0.5*Player1Bewegungsgeschwindigkeit*time_step), (IGNORE_PASSABLE | IGNORE_PUSH | IGNORE_SKILL5)); // Ship ignores the other ship!


Anyway I would like to find a way to make an entity move ignoring all other entities that belong to the same 'group' or 'type'.
Any ideas?

Kind regards
derGarv


GameStudio Version: A7 Pro v7.86
Re: Ignore Entities with special skill values when performing c_move [Re: garv3] #293003
10/08/09 15:17
10/08/09 15:17
Joined: Jul 2009
Posts: 36
S
SomebodyNew Offline
Newbie
SomebodyNew  Offline
Newbie
S

Joined: Jul 2009
Posts: 36
What you are looking for is called "ACTIVATE_PUSH". You'll find it in the manual under c_move.

c_move(me, vector(25*time_step, 0, 0), nullvector, IGNORE_PASSABLE | ACTIVATE_PUSH);
You do not have to set a push value!

Now put sth. like this in your collision event:
Code:
function damage_enemies_only()
{
	if(event_type == EVENT_PUSH)
	{
		if (your.side == 3)
		return(0);
	}
	if(event_type == EVENT_ENTITY && your.side != 3)
	{
		your.health -= 10;
		my.alive = 0;
	}
}



I never understood why you would want to use IGNORE_FLAG2 since entities become either passable or obstacles. Which is not a sohpisticated differentiation.
Ok, I hope this helps.

Good luck!

Last edited by SomebodyNew; 10/08/09 15:29.
Re: Ignore Entities with special skill values when performing c_move [Re: SomebodyNew] #293005
10/08/09 15:40
10/08/09 15:40
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline OP
User
garv3  Offline OP
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
Well, I just didn't know about the possibility to return a 0 or 1 in the event function. This helps a lot and solves all my problems regarding to the collision system!

Thank you a lot!


GameStudio Version: A7 Pro v7.86
Re: Ignore Entities with special skill values when performing c_move [Re: SomebodyNew] #293006
10/08/09 15:41
10/08/09 15:41
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
note that sombodynew's example only works the way he did it, not if you use "void" instead of "function"...

just to save you some time... tongue cause it took me ages to figure that out


~"I never let school interfere with my education"~
-Mark Twain
Re: Ignore Entities with special skill values when performing c_move [Re: Germanunkol] #293016
10/08/09 16:59
10/08/09 16:59
Joined: Jul 2009
Posts: 36
S
SomebodyNew Offline
Newbie
SomebodyNew  Offline
Newbie
S

Joined: Jul 2009
Posts: 36
Do you have any advantages with a void over a function?
I've looked in the manual but it does not even mention voids.
I've seen them a couple of times though.
My understanding is that voids can't return anything while functions do but are a slightly slower than voids.

Re: Ignore Entities with special skill values when performing c_move [Re: SomebodyNew] #293028
10/08/09 18:07
10/08/09 18:07
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline OP
User
garv3  Offline OP
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
Originally Posted By: SomebodyNew
My understanding is that voids can't return anything while functions do but are a slightly slower than voids.

That's my understanding too. But I think the performance advantage is minimal, so I use functions all the time. That avoids problems like this.

But another question: Is there any event triggered when an entity with ACTIVATE_PUSH overruns another entity? I know that EVENT_PUSH is triggered for the overrun entity but is anything triggered for the overrunnig entity? (Sorry for these confusing sentences!)


GameStudio Version: A7 Pro v7.86
Re: Ignore Entities with special skill values when performing c_move [Re: garv3] #293036
10/08/09 19:19
10/08/09 19:19
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
functions is the word used in c_script. It can still be used, and can return (I think it returns var only). void simply means that it doesn't return anything, just like you said, and I use it cause it's an awesome word (I just like "void"), because it's shorter, and because it gives reminds me of the fact that the function doesn't return anything. If a function should return something, I use int or long or var or ENTITY* or whatever it should return. Gives it more structure and makes it a little easier to read... and I dislike the c_script syntax.

as for the overrrunning entity event triggering, I don't think anything's triggered, since it ignores it until the other entity returns "1".


~"I never let school interfere with my education"~
-Mark Twain
Re: Ignore Entities with special skill values when performing c_move [Re: Germanunkol] #293039
10/08/09 19:24
10/08/09 19:24
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline OP
User
garv3  Offline OP
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
Originally Posted By: Germanunkol
as for the overrrunning entity event triggering, I don't think anything's triggered, since it ignores it until the other entity returns "1".
That's exactly what I noticed. So what can I do if I want the entity to overrun the second one but perform an event?

EDIT: Found a workaround - not too smart but it works for me.

Last edited by garv3; 10/08/09 21:23.

GameStudio Version: A7 Pro v7.86

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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