Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Quad, AndrewAMD, Imhotep, TipmyPip, Edgar_Herrera), 809 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
ignoring creator entity in multiplayer #450296
04/11/15 20:33
04/11/15 20:33
Joined: Dec 2009
Posts: 82
D
Denn15 Offline OP
Junior Member
Denn15  Offline OP
Junior Member
D

Joined: Dec 2009
Posts: 82
I am working on a small multiplayer game where currently every palyer joining is a block model and can shoot projectiles after the other players, however when you shoot the projectile often hits the player that shoots it instead of continuing.

The player that creates the projectile sets the "you" pointer to be the created projectile and both the projectile and player has the IGNORE_YOU flag in their movement commands, however for some reason they dont ignore each other.

I assume there is another way to do this but i just cant figure out how to do it.

Last edited by Denn15; 04/12/15 11:38.
Re: ignoring creator entity in multipålayer [Re: Denn15] #450299
04/11/15 21:02
04/11/15 21:02

M
Malice
Unregistered
Malice
Unregistered
M



Try group and c_ignore, looking at.

Bullet()
my.group = 2;

c_ignore(1);
c_move(...)

PLAYER()
my.group= 1;

Re: ignoring creator entity in multipålayer [Re: ] #450300
04/11/15 21:10
04/11/15 21:10
Joined: Dec 2009
Posts: 82
D
Denn15 Offline OP
Junior Member
Denn15  Offline OP
Junior Member
D

Joined: Dec 2009
Posts: 82
the problem is that all the players are given the same action so that they will also have the same group.
therefore the projectiles will ignore all the players and you are soppused to ba able to hit each other.

Re: ignoring creator entity in multipålayer [Re: Denn15] #450302
04/11/15 22:40
04/11/15 22:40
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
I have used in the past the IGNORE_PUSH c_move modifier adding a higher push to arrows and checking the arrow parent inside the player event.

Re: ignoring creator entity in multipålayer [Re: txesmi] #450303
04/11/15 22:44
04/11/15 22:44
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
wow wtf
Im glad Im using ANet and not the native 3DGS multiplayer system.
Try to check for a group value. If its your own client-ID set it to a different group but dont change it globally for all players.
Easy as that, idk if its easy to code with the actual 3DGS multiplayer system.

Last edited by Ch40zzC0d3r; 04/11/15 22:45.
Re: ignoring creator entity in multipålayer [Re: Ch40zzC0d3r] #450304
04/11/15 22:59
04/11/15 22:59
Joined: Dec 2009
Posts: 82
D
Denn15 Offline OP
Junior Member
Denn15  Offline OP
Junior Member
D

Joined: Dec 2009
Posts: 82
well about the push stuff, they would still affect each other. i supposed you could make them ignore everything and then check collision with vec_dist in a for loop and check for client id in some way.

@chaos that sounds like it could be an option too. ill try it out tomorrow

Last edited by Denn15; 04/11/15 23:09.
Re: ignoring creator entity in multipålayer [Re: Denn15] #450305
04/11/15 23:13
04/11/15 23:13
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Originally Posted By: Denn15
they would still affect each other.


They affect just on the event call. The arrow does not collide playes but calls the event and makes hurt when (you->parent != me). It works.

Re: ignoring creator entity in multipålayer [Re: txesmi] #450306
04/11/15 23:22
04/11/15 23:22
Joined: Dec 2009
Posts: 82
D
Denn15 Offline OP
Junior Member
Denn15  Offline OP
Junior Member
D

Joined: Dec 2009
Posts: 82
i havent really read into how parent works so i dont know much about that method but my guess is that it makes the projectile ignore the player but not make the player ignore the projectile? and the players movement should not be hindered by its own projectiles

Last edited by Denn15; 04/11/15 23:25.
Re: ignoring creator entity in multipålayer [Re: Denn15] #450308
04/11/15 23:34
04/11/15 23:34
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Any player should not collide with any arrow. Ignore the arrows group on player move or so.

Re: ignoring creator entity in multipålayer [Re: txesmi] #450316
04/12/15 11:36
04/12/15 11:36
Joined: Dec 2009
Posts: 82
D
Denn15 Offline OP
Junior Member
Denn15  Offline OP
Junior Member
D

Joined: Dec 2009
Posts: 82
@txesmi i have tried to do the following:

Code:
function gethit()
{
	if(your->parent != me)
	{
		your.health = 0;
	}
}

action playeraction()
{
	my.emask = ENABLE_ENTITY;
	my.event = gethit;
        ...
        while(1)
        {
                c_move(me, NULL, vector(my.velx * time_step, my.vely * time_step, my.velz * time_step), GLIDE | IGNORE_YOU);
	        c_rotate(me, vector(my.campan - my.pan, 0, 0), GLIDE | IGNORE_YOU);
        }
}

action shotaction()
{
	my.push = 3;
        ...
        while(1)
        {
	        c_move(me, vector((90 - my.shotpower * 30) * time_step, 0, 0), NULL, IGNORE_PUSH);
        }
}



however now the projectiles dont react at all when hitting any players and when you fire you often get pushed around by your own projectile. is the above code like you meant it or should i do something different?

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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