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 2 of 3 1 2 3
Re: bullet holes [Re: Grimber] #74994
05/31/06 12:01
05/31/06 12:01
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
I have a problem here... how do you give entities you created actions?

Re: bullet holes [Re: vartan_s] #74995
05/31/06 13:49
05/31/06 13:49
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
last parameter of the ent_creat the name of the action

Re: bullet holes [Re: Grimber] #74996
05/31/06 14:05
05/31/06 14:05
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
great... although my bullet holes are still going wrong...

Here's my code:

action shoot_bullet()
{
bullet = me;
my.invisible = on;
my.push = push_factor_change;
if (push_factor_change == -weapon_in_play_pellets)
{
push_factor_change = 0;
}
my.enable_block = on;
my.skill4 = weapon_in_play_damage;
my.skill5 = weapon_in_play_bullet_speed;
randomize();
my.pan = camera.pan + random(weapon_in_play_acc_change) - random(weapon_in_play_acc_change);
my.tilt = camera.tilt + random(weapon_in_play_acc_change) - random(weapon_in_play_acc_change);
my.event = remove_bullet;
while (my.flag1 != 1)
{
move_mode = ignore_you + ignore_passable + ignore_me;
c_move(my,my.skill5,nullvector,move_mode);
if (my.flag8 == 1)
{
my.passable = on;
ent_create(bullethole_pcx,my.x,bullet_hole);
my.flag1 = 1;
}
wait(1);
}
ent_remove(me);
}

function bullet_hole()
{
my.passable = on;
// because at the time this entity is created YOU pointer will point back to the bullet entity so we can sue that to grab our movment vector IF we do it right away
vec_set(my.skill5,YOU.skill5); // the movment direction vector backed up

vec_normalize(my.skill5,10); // here i just increased the length of teh vector *10
//now I just do the trace
my.skill10 = c_trace(my.x,my.skill5,IGNORE_ME+IGNORE_YOU);
// the ignore you is important too. else your still existing bullet entity will stop the trace soon as it starts.
if(my.skill10 >0) // trace hit something
{
my.oriented = on; // look up these to line sin manual if you don't know them
my.facing = off;
vec_set(my.x,TARGET);
vec_to_angle(my.pan,normal);
wait(2000);
ent_remove(me);
}
else // no surface to attach to so remove me from the world
{
remove(me);
}

A short explanation...
The acc_change is basically the accuracy of the weapon, which I can change based on movement or length being fired or even depepnding on the weapon.

The weapon in play push factor thing changes the push of the bullet accordingly, to allow me to create more than one pellet without having them collide with each other.

In the remove_bullet function, I've made it exactly like you told me to... it makes flag 8 = 1.

It would be really good if you could fix this. Thanks.

Last edited by vartan_s; 05/31/06 14:06.
Re: bullet holes [Re: vartan_s] #74997
06/01/06 19:37
06/01/06 19:37
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
Anybody got any idea? I just can't figure it out. It's really confusing me, I'm tearing my hair out now lol

Re: bullet holes [Re: vartan_s] #74998
06/03/06 09:55
06/03/06 09:55
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
I really hope someone has a solution for this... it's the only thing keeping me back from going on to the fun parts... multiple weapons, AI, objectives etc etc. Thanks in advance.

Re: bullet holes [Re: vartan_s] #74999
06/05/06 00:13
06/05/06 00:13
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
ok what are you doing in the 'remove_bullet' function
also i would alter the end of your action to this:

while (my.flag1 != 1)
{
move_mode = ignore_you + ignore_passable + ignore_me;
c_move(my,my.skill5,nullvector,move_mode);
wait(1);
}
ent_create(bullethole_pcx,my.x,bullet_hole);
wait(1);
ent_remove(me);
}

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

Joined: Apr 2006
Posts: 265
remove_bullet code:
Code:
 
function remove_bullet()
{
my.enable_entity = off;
my.enable_block = off;
my.flag8 = 1;
}



I think the problem is in the angle of the vector my.skill5, but I'm not sure.
The code you gave me doesn't seem to work... are you sure it's right?
On some walls the bullet holes work well, on others they appear on an adjacent wall, and on some, its a mixture of correct and adjacent.

Any ideas?

Re: bullet holes [Re: vartan_s] #75001
06/06/06 14:44
06/06/06 14:44
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
no your problem is in the bullet_hole function.

you're getting a delay of time between when the script in that function is executed, so this line:

vec_set(my.skill5,YOU.skill5);

isn't always valid. and is why its not always working

because in 1 frame ( or even less) YOU might point to something totaly different
you nee to use the event function to handle such data to be sure what is stored based on what triggers it.

Re: bullet holes [Re: Grimber] #75002
06/07/06 15:34
06/07/06 15:34
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
Sounds easy to fix, but how would I go about that?

Really hope this works, I've been working on this issue for ages now.

Re: bullet holes [Re: vartan_s] #75003
06/08/06 18:41
06/08/06 18:41
Joined: Feb 2003
Posts: 204
England
BigDaz Offline
Member
BigDaz  Offline
Member

Joined: Feb 2003
Posts: 204
England
Sorry to hijack the thread but a question to Grimber; would shooting particles be any better than using models?

Page 2 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