Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (AndrewAMD, fairtrader, 3run), 599 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: bullet holes [Re: BigDaz] #75004
06/08/06 19:04
06/08/06 19:04
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
i did that in my shooter tutorial (the laser beam)
problem with particals is there is no collision detection so you need to substitute in something to handle collision for a partical. i.e. a small model ( i use a single poly) or traces( can be taxing on frame rate if running several particals with trace every frame)


as for the other problem
you need to back up your data in the event fucntion

i.e.

var dirdata[3];
function bullet_hit()
{
if(event_type == event_block)
{
vec_set(dirdata,my.skill5);
my.flag1 = 1;
}
}

action bullet_mover
{
//...
while(my.flag1 !=1)
{
// stuff here
wait(1);
}
// so myflag1 is 1 I hit a wall
ent_create*bullehole.pcx,my.x,bul_hole_action);
remove(me);
}

function bul_hole_action
{
vec_set(my.skill5,dirdata);
// more stuff here
}

Re: bullet holes [Re: Grimber] #75005
06/09/06 17:13
06/09/06 17:13
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
Doesn't work either, I don't know why, but I have solved my problem. After looking at your tutorials I realised that most people found this easy because they used trace rather than entities for bullets. I decided to do a trace as well, since I didn't want to sacrifice entities. It works, pretty easily too. The problems I have now are bullet holes appearing over edges and of course finding a decent bullet hole (I am using a test bullet hole). Before I forget I tried making my own bullet hole, but there's always a black line around it. I checked that area and it is 000000 colour.

Last edited by vartan_s; 06/09/06 17:21.
Re: bullet holes [Re: vartan_s] #75006
06/21/06 08:32
06/21/06 08:32
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline
Serious User
BlueBeast  Offline
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
I'd rather dig up a little older thread than start a new one...

I've read this post thoroughly, tho to me it's in greek...

however, were still having a little problem, and can't seem to find the problem.

The shooting/ collision, and surface impacts are all fine..
except the impact 'bullet hole' is offset,
though the 'bullet hole' sprite is ok relative to the impacted surface, ( it's reading the surface angles correctly) the point of the 'bullets impact an the point on the surface is offset a lot.

Were using an impact sprite quite a bit larger than a bullet hole, if it was a bulet hole size, it's be even more noticable how far off the impact is by the bulet', It's just acting like it's 'reading' the bullet model's bounding box.
And as was described by Grimber, changing the bullet model size helps nothing Its the part after that we can't seem to get figured out how to correct this.

Below is the gun/bullet/impact code. Impacts by 'bullet' models will mostly be on blocks... any models it will hit don't need accuracy in this case.

We are also curious about a crosshair. we would still like to have one very much, how well would one work with this code?

We really need the help to get over this hump here...

Thanks!



-----------------------------------------------------------------------------

Code:
 // guns and stuff
entity* temp_ptr;

function impact
{
my.scale_x = 0.4;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;

my.z += 5;
my.facing = off; my.oriented = on; my.decal = on;
my.passable = on; my.bright = on; my.flare = on;
my.alpha = 99.9; my.transparent = on;

sleep(0.5);
while(my.alpha > 0){my.alpha -= 3*time; wait(1);}
ent_remove(me);
}

function hit_event
{
if(event_type == event_impact || event_type == event_entity)
{
you.health -= 25;
temp_ptr = ent_create ("impactglow3.tga", target, impact);
vec_to_angle(temp_ptr.pan, normal);
wait(1);
ent_remove(me);
}
if(event_type == event_block)
{
beep;
temp_ptr = ent_create ("impactglow3.tga", target, impact);
vec_to_angle(temp_ptr.pan, normal);
wait(1);
ent_remove(me);
}
}

function fly_bullet()
{
my.enable_impact = on;
my.enable_block = on;
my.enable_entity = on;
my.event = hit_event;

my.bright = on;
my.flare = on;

my.pan = camera.pan;
my.tilt = camera.tilt;

my.push = -1;

var last;

while(last < 50)
{
last += 1 * time;
my.roll += 55*time;
c_move(me, vector(150*time, 0, 0), nullvector, activate_trigger);
wait(1);
}
ent_remove(me);
}

function shoot_weapon
{
// var offset[3] = 100, -25, -25;
vec_for_vertex(temp, my, 77);

ent_create("lazerbeam.mdl", temp, fly_bullet);
}



----------------------------------------------------------------------------

Crosshair and impact accuracy to simplify our problems.. please help the needy

Jason


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: bullet holes [Re: BlueBeast] #75007
06/21/06 12:40
06/21/06 12:40
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
Ok here's how it works. I did it another way. Rather than creating a bullet at the point where it impacted, I trace from the player position when the bullet was fired (making the player position a vector when fired is useful). I do the if the bullet hits the wall, when it hits the wall. I then create a bullet at the player position, and move it to target.

Another note. I set the trace to ignore everything except level blocks, in case by the time the bullet hits an entity gets in the way.

Do crosshairs with panels:

Code:
 

bmap crosshair_large_pcx = <crosshair3.pcx>;
anel crosshair_pan
{
alpha = 100;
bmap = crosshair_large_pcx;
layer = 1;
pos_x = 0;
pos_y = 0;
flags = transparent, overlay, refresh, d3d, visible;
}
//Place the following piece of code in function main:
crosshair_pan.pos_x = (screen_size.x - bmap_width(crosshair_pcx)) / 2;
crosshair_pan.pos_y = (screen_size.y - bmap_height(crosshair_pcx)) / 2;



There, hope you enjoy

Last edited by vartan_s; 06/21/06 12:40.
Re: bullet holes [Re: vartan_s] #75008
06/22/06 11:48
06/22/06 11:48
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline
Serious User
BlueBeast  Offline
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
Thanks for the tips Vartan,

I guess what were looking for is some direction with our present code... more specifically, what are we missing in our code? Im pretty sure were using trace for our lazer beam model... where are we going wrong to work with your strategy?

Jason


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: bullet holes [Re: BlueBeast] #75009
06/22/06 18:52
06/22/06 18:52
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
I don't see a trace instruction in your code, so basically you've got to try and go with this:

First:
Tracing is done with c_trace, it checks whether there are any obstacles between two points which you specify. It gives the distance from the first point to the obstacle, or 0 if there are no obstacles. For more info look it up in the manual.

Ok, here's how to do it:
When your bullet is fired:
save the bullet's position as a vector(Ill use a vector called bullet_vec for this), this is your trace's start position

When your bullet collides:
create a bullet entity at the bullet_vec vector

give it the same pan and tilt as the bullet(don't delete bullet until you do this)

move is relatively with an x of 10000

ignoring all models, trace from bullet_vec to the new bullet position. Do this within the bullet hole function

in the same function, move the bullet hole to it's position on the wall with
Code:
 vec_set(my.x,TARGET); 



This uses the trace to move it to its destination

Give it the angle of the wall with

Code:
 vec_TO_ANGLE(my.pan,normal); 



It should now work. Don't forget to make your bullet hole passable as soon as you create it!

Hope this works! If you don't understand anything, you're much better off asking Grimber, he'll be a lot more helpful in this case.

I would have liked to give you the code, but my code is extremely messy, I have other things now in my code and my functions are all over the script!

Re: bullet holes [Re: vartan_s] #75010
06/22/06 19:52
06/22/06 19:52
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline
Serious User
BlueBeast  Offline
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
Thanks vartan... since there's no trace as you say, i'm guessing this is why the bullet holes are offset from the center of the bullet models impact point?

Otherwise like I say, the impacts themselves are working relatively fine as they are alwyays facing properly in accordance to the surface it hits.

I'll have Dennis take a look here and see if it makes things more clear

Thanks bunches!

Jason


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: bullet holes [Re: BlueBeast] #75011
06/23/06 08:27
06/23/06 08:27
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Quote:

Thanks vartan... since there's no trace as you say, i'm guessing this is why the bullet holes are offset from the center of the bullet models impact point?

Otherwise like I say, the impacts themselves are working relatively fine as they are alwyays facing properly in accordance to the surface it hits.

I'll have Dennis take a look here and see if it makes things more clear

Thanks bunches!

Jason




Looking

yeah, that is basically what i wanna do as well, but there was more on the list that needed to be done, whihch had higher priority (since this allready works... so we had a good test set up ).

anyway, i'll get to this asap.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Page 3 of 3 1 2 3

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