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 3 of 4 1 2 3 4
Re: c_trace and shooting projectile help [Re: Joozey] #168166
11/22/07 08:48
11/22/07 08:48
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
impact or a small damages range might help.

Re: c_trace and shooting projectile help [Re: Nems] #168167
11/22/07 16:15
11/22/07 16:15
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
hmmm, would itbe possible to have it do a c_trace to the same location as the balls? its not really vital that they glide across surfaces.... does that make sense?

Re: c_trace and shooting projectile help [Re: immolat3] #168168
11/22/07 17:05
11/22/07 17:05
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Yes it's possible, but not very good for your framerate. But I guess you're happy when it works . It's up to you how you make it.

For c_trace, trace from bullet to a position just in front of the bullet. When an entity is detected, the entity will be put into the 'you' pointer. You can then use the you for identifying the player.


Click and join the 3dgs irc community!
Room: #3dgs
Re: c_trace and shooting projectile help [Re: Joozey] #168169
11/22/07 18:32
11/22/07 18:32
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
hmm, first let me say thanks for all your help. people like you make this worth doing and incase you wanted to now, the reason i know little about this is because i am not a programmer, only web programming actually, and im doing this for a class at my college, Drexel U., and the person we had doing the coding basically decided he wanted to fail and not show up // help at all, soooo here i am trying to slide through this heh. someone had to do it i guess.

anyhow, would it be possible in the action BulletFly, to create some sort of explosion radius type thing like someone mentioned earlier and i have functions that get the players X,Y,Z, etc. so if the playerX,Y,Z is inside the "explosion radius" they would get damaged?

Re: c_trace and shooting projectile help [Re: immolat3] #168170
11/22/07 19:19
11/22/07 19:19
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
so im trying to do what i just mentioned, is there a way to set a range, so like something like

if (bullet's X,Y,Z is in the range of Player X,Y,Z) (within 100 units, for instance)
{
remove player health by 10
}

sorry for the wierd psuedo code.

Re: c_trace and shooting projectile help [Re: immolat3] #168171
11/22/07 19:25
11/22/07 19:25
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
if (my.x == getDocX() || my.y == getDocY() || my.z == getDocZ())
{
remDocHealth(5); // not working correctly!
}

thats currently in my while loop inside BulletFly action, however I dont think that the x,y,z's can ever be the same since once a bullet collides with the player, whose name is Doc (might explain some reason the functions have wierd names, it bounces off and goes around the player.

Re: c_trace and shooting projectile help [Re: immolat3] #168172
11/22/07 19:29
11/22/07 19:29
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
No problem for the help and it's good to know our help is appreciated . I know what you mean, regulary had to pick up the programming stuff (and often alot more) within school projects myself as well because others failed to do their work. Just kick them from the project and move along hehe.

Yes it's possible to do such a thing. There are several ways for accomplishing this as well. The simpliest way would be to use vec_dist, but that does not have accurate collision detection. You can try with this first though at least to get it to work.

If you want to make accurate collision for the bullets (e.g. for headshots) maybe try out ENABLE_TRIGGER from c_move. I haven't tried something the like, but I would just think out some different methods and try what works best.


Click and join the 3dgs irc community!
Room: #3dgs
Re: c_trace and shooting projectile help [Re: Joozey] #168173
11/22/07 19:34
11/22/07 19:34
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
indeed the position will never be the same. vec_dist (bullet.x, player.x) returns the distance between the two positions. So just make an expression like vec_dist(bullet.x, player.x) < 100, to see if the bullet comes within a range of 100 quants from the player.


Click and join the 3dgs irc community!
Room: #3dgs
Re: c_trace and shooting projectile help [Re: Joozey] #168174
11/22/07 19:49
11/22/07 19:49
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
if (vec_dist(my.x, player.x) < 100)
{
remDocHealth(10);
}


tried that, says empty pointer, i put it in the bullet action so my.x should be the bullets X, but im thinking player isnt working. i use player in other parts of the code though which is strange.

Re: c_trace and shooting projectile help [Re: immolat3] #168175
11/22/07 19:51
11/22/07 19:51
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
well, when do you get empty pointer? on collision? Because if you remove the bullet on collision and this expression is called afterwards, the 'my' is already gone.


Click and join the 3dgs irc community!
Room: #3dgs
Page 3 of 4 1 2 3 4

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