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 (TedMar, AndrewAMD, fairtrader), 578 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 1 of 2 1 2
question about event_impact #137011
06/18/07 11:01
06/18/07 11:01
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
would someone be good enough to explain to me why this will not work?
Code:

var phaser_speed;

function my_phaser()
{

my.scale_x = 200;
my.scale_y = 0.5;
my.scale_z = 0.5;
my.passable = on;
my.oriented = on;
my.flare = on;
my.bright = on;
my.ambient = 100;
my.pan = player.pan;//--->player.pan and tilt set to camera
my.tilt = player.tilt;
my.enable_entity = on;
my.enable_block = on;
my.enable_impact = on;
phaser_speed.x = 50 * time;
phaser_speed.y = 0;
phaser_speed.z = 0;
while (my != null)
{
if (my.roll > 150)
{
my.passable = off;
}
my.roll += 25 * time;
if(event_type == event_impact)
{
ent_remove (me);
}
else
{
wait (20);
ent_remove (me);
}

}
}


what should happen is when the phaser model hits a target it should be removed, but instead it goes straigt through the dummy model, code for that below.
Code:

function f_ship
{
my.scale_x = 4.0;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
my.enable_impact = on;
my.enable_scan = on;
if(event_type == event_impact)
{
ent_remove (me);
}
wait(1);
}


so what i have here is neither entity being removed when the impact occurs, any thoughts on why?



Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: question about event_impact [Re: jigalypuff] #137012
06/18/07 11:04
06/18/07 11:04
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
I think it's why because you scaled your model by script and it's change his origin without changing bounding box, but maybe I'm wrong
so try to use my.polygon =on; or set c_setminmax(me); maybe it will help

and in function f_ship you have wait but where is while?
or try to do it with my.event function, then without loop

and in my_phaser function you have wait(20)...
I think is not the best idea to colision detection
EDIT: I see that this wait(20) is in else function... so You don't have wait(1) for while loop
cheers
Code:
 
}
else
{
wait (20);
ent_remove (me);
}
wait(1);
}
}



Last edited by tompo; 06/18/07 11:11.

Never say never.
Re: question about event_impact [Re: tompo] #137013
06/18/07 11:15
06/18/07 11:15
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
were should there be a while if f_ship?
i tried my.polygon = od; but no joy there.
the wait 20 is the only way i get the beam to stay on screen for a few seconds, i have been unable to get the phaser effect to work any other way at all. if it hits an entity the nthe event_impact should remove it should`nt it? and if not then wait 20 and remove, can you think of a better way to get this to work?


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: question about event_impact [Re: jigalypuff] #137014
06/18/07 11:17
06/18/07 11:17
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
I've edited my first reply so read it agian

Code:
 
function f_ship
{
...
my.enable_scan = on;
while(me)
{

if(event_type == event_impact){ent_remove(me);}
wait(1);
}
}



But still best option is to use my.event = some_event and then without loop
if(event_type == event_impact){ent_remove(me);}

Last edited by tompo; 06/18/07 11:26.
Re: question about event_impact [Re: tompo] #137015
06/18/07 11:29
06/18/07 11:29
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
ok that made no differance, no crashs but the beam still passes through the target and neither is removed. thanks for your help by the way.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: question about event_impact [Re: jigalypuff] #137016
06/18/07 11:39
06/18/07 11:39
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
another thing is that impact needs ent_move or c_move function I think
so...
1. try to add while and wait where missing
2. try to add my.polygon = on; or c_setminmax(me);
3. try to write it with my.event = some_event; and then without loop
4. try to use c_move not my.x += something;

It has to work I have this working in my space_game showcase
(ships turning away if impact with another ships)
Cheers

Last edited by tompo; 06/18/07 11:42.

Never say never.
Re: question about event_impact [Re: tompo] #137017
06/18/07 11:49
06/18/07 11:49
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline
Serious User
JetpackMonkey  Offline
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
"My.passable = on" should be the problem

Event impact won't work if it's the entitiy is passable, so switch it to off

Re: question about event_impact [Re: tompo] #137018
06/18/07 11:51
06/18/07 11:51
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
ok i added a c_move instruction, still no joy.
Code:

var phaser_speed;

function my_phaser()
{

my.scale_x = 200;
my.scale_y = 0.5;
my.scale_z = 0.5;
my.passable = on;
my.oriented = on;
my.flare = on;
my.bright = on;
my.ambient = 100;
my.pan = player.pan;//--->player.pan and tilt set to camera
my.tilt = player.tilt;
my.enable_entity = on;
my.enable_block = on;
my.enable_impact = on;
my.polygon = on;
phaser_speed.x = 50 * time;
phaser_speed.y = 0;
phaser_speed.z = 0;
while (my != null)
{
if (my.roll > 150)
{
my.passable = off;
}
my.roll += 25 * time;
c_move(my,vector(phaser_speed*time,0,0),nullvector,ignore_passable + ignore_you);///
if(event_type == event_impact)
{
ent_remove (me);
}
else
{
wait (20);
ent_remove (me);
}
wait(1);
}
}


thing is if i remove the my.x then what i get is a bullet effect, not a laser effect. were should the c_setminmax be put? i suppose in both mine and the enemy functions as they will also have beam weapons?


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: question about event_impact [Re: jigalypuff] #137019
06/18/07 11:54
06/18/07 11:54
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
jetpack tried the my.passable = off, still not working. is it me or is this just weird lol


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: question about event_impact [Re: jigalypuff] #137020
06/18/07 13:08
06/18/07 13:08
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline
Serious User
JetpackMonkey  Offline
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
And the other entity (bullet? whatever it is) is also set to passable = off?

Page 1 of 2 1 2

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