Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,227 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problems with vec_for_vertex / Habe Probleme mit vec_for_vertex #242084
12/21/08 10:55
12/21/08 10:55
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Hi Guys, i have some problems with the vec_for_vertex.

I used the code from Aum77, and modified it for my uses.

Im using A6 Comm edition without lite c.

Problem Nr 1:

If i create the bullet/rocket entity, it is not createt on the vertex 208 correctly, its created some meters to the left of the entity. Especial when it moves. Im not able to solve this problem by myself.

Problem Nr 2:

When the entity is not moved, the rocket/bullet is created correctly, but it looks like ist created inside the collision hull, so it does remove itselves instantly. Looks like the rocket/bullet does not ignore the creator entity.


Hallo Leute. Ich hab ein paar probleme mit dem vec_for_vertex befehl.

Ich habe den code vom Aum77 genommen, und ihn für meine zwecke modifiziert.

Ich habe A6 Commercial ohne Lite-c.

Problem Nr1 :

Die rocket/bullet ent wird generiert, allerdings nicht am vertex 208 sondern ein ganzes stück neben meiner entity. Speziell wenn die entity bewegt wird.

Problem Nr 2:

Wenn die entitiy nicht bewegt wird, wird die Rocket/bullet zwar richtig generiert, allerdings sieht es so aus, als würde sie innerhalb der Kollisionsabfrage der erzeugenden Entity erstellt, und löst sich nahezu sofort wieder auf wenn sie von innen auf die Kollisionsabfrage trift. Sieht so aus als würde sie die erzeugende entity NICHT ignorieren.

Ich poste mal den entsprechenden code

function remove_bullets() // this function runs when the bullet collides with something

{

wait (1); // wait a frame to be sure (don't trigger engine warnings)

ent_remove (my); // and then remove the bullet

}


function move_bullets()

{

var bullet_speed[3];

my.enable_impact = on;
my.enable_entity = on;
my.enable_block = on;



my.event = remove_bullets;

my.pan = bullet_pan;

bullet_speed.x = 50 * time_step;

bullet_speed.y = 0; // the bullet doesn't move sideways

bullet_speed.z = 0; // or up / down on the z axis
your = bullet_creator;
while (my)

{

c_move (my, bullet_speed, nullvector, IGNORE_PASSABLE | IGNORE_YOU);

ent_sendnow(my);

wait (1);

}

}

///////////////////////////////////////////

if (connection == 3)

{

my = ent_create (str_jeepmdl2, vector (100, 80, 0), move_players);
my.skill5 = -4; // Skill5 == driver-Skill
my.skill3 = 10; // Maximum Speed
var bullet_pos[3];



while (1)
{
if (key_w == on) && (my.skill1 < my.skill3)
{
my.skill1 +=1 * time_step;
}
if (key_s == on) && ((my.skill1) > ((my.skill3 / 2) * -1))
{
my.skill1 -=1 * time_step;
}
if (key_a - key_d == 0)
{
my.skill2 = 0 * time_step;
}
if (key_a - key_d != 0) && (my.skill1 < 0)
{
my.skill2 = ((key_d - key_a)*(12 - my.skill5)) * time_step;
}
if (my.skill1 > 0) && (key_a - key_d != 0)
{
my.skill2 = ((key_a - key_d)*(12 - my.skill5)) * time_step;
}
if (my.skill1 == 0) && (key_a - key_d != 0)
{
my.skill2 = 0;
}
if (key_space == on)
{
my.skill1 = 0;
}

if (server_fired)

{

vec_for_vertex (bullet_pos,my,208);


vec_rotate (bullet_pos.x, my.pan);



bullet_pan = my.pan;
bullet_creator = my;
ent_create(str_SRMRocket,vector(bullet_pos.x,bullet_pos.y,bullet_pos.z), move_bullets);



}

Re: Problems with vec_for_vertex / Habe Probleme mit vec_for_ver [Re: MikeS] #242133
12/21/08 15:57
12/21/08 15:57
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Ok, solved some Problems,

i dont need

vec_rotate (bullet_pos.x, my.pan);

cause i have

bullet_pan = my.pan; already.


and if i place

your = bullet_creator;

into the

while (my)

{
your = bullet_creator;
c_move (my, bullet_speed, nullvector, IGNORE_PASSABLE | IGNORE_YOU);

ent_sendnow(my);

wait (1);

}


it ignores me .

But it ignores me only if the ent is standing.

while moving, its not ignoring the creator ent.

Working on it, maybe someone has suggestions.


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