Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,619 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_scan problem #279936
07/20/09 03:54
07/20/09 03:54
Joined: Jun 2009
Posts: 17
Cebu Philippines
U
uone Offline OP
Newbie
uone  Offline OP
Newbie
U

Joined: Jun 2009
Posts: 17
Cebu Philippines
Hello guys,

I am creating a 3d game and create an object that has a special
action it would serve as a bomb if hit by another object shall we say a ball, will explode an the surrounding objects which is within reach of the scan range will also explode but my problem is, though there is no object around the bomb object seems that it also hit those object that i set ENABLE_SCAN, and as debug my code it really passed to the function that has ENABLE_SCAN and perform its action also.
How can i fix this? i only want to explode objects that are in scan range from the bomb object. Somebody advice me please...

Here is my code:


// function : this function will trigger explosion of the sorounding bricks when hit
//-------------------------------------------------------------------------------------------

function time_bomb()
{

while(!player){wait(1);}
c_setminmax(my);
my.z = player.z;
set(my, POLYGON);
my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_DETECT );//ENABLE_SCAN |
my.event = bomb_explosion;
swinging_bricks();
}




// functionality :triggers the explosion of bricks and will scan all objects within range
//-------------------------------------------------------------------------------------------
function bomb_explosion()
{


if(event_type == EVENT_IMPACT)
{
c_scan(my.x, my.pan, vector(360,180,89), SCAN_ENTS | SCAN_LIMIT); //vector(360,180,59)

effect(p_fountain,maxv(1,40*time_step),my.x,vector(0,0,5));
set (me, INVISIBLE);
numberOfBricks-=1; // minus the number of numberOfBricks in the level
scorePoints+=50; // score gained
numberOfBricks+=11; // minus the number of numberOfBricks in the level

ent_remove(my);
}

}




//function: will explode ih hit or when triggered by scan
//-------------------------------------------------------------------------------------------
action act_simple(){
while(!player){wait(1);}
c_setminmax(my);
my.z = player.z;
set(my, POLYGON);
my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_SCAN | ENABLE_DETECT);

my.event = brick_explosion;

swinging_bricks();

}




//function: the actual explossion of the brick object when hit or when triggered by scan
//-------------------------------------------------------------------------------------------
function brick_explosion()
{


if(event_type == EVENT_SCAN)
{
// my.z = player.z;
snd_play(explosion,100, 0);
effect(p_fountain,maxv(1,40*time_step),my.x,vector(0,0,5));
set (me, INVISIBLE);
//wait(2);
numberOfBricks-=1; // minus the number of bricks in the level
scorePoints+=20; // score gained
ent_remove(my);

}else


if(event_type == EVENT_IMPACT)
{
my.z = player.z;
snd_play(explosion,100, 0);
effect(p_fountain,maxv(1,40*time_step),my.x,vector(0,0,5));
set (me, INVISIBLE);
//wait(2);
numberOfBricks-=1; // minus the number of bricks in the level
scorePoints+=20; // score gained
ent_remove(my);

}

}

Re: c_scan problem [Re: uone] #281717
07/28/09 09:21
07/28/09 09:21
Joined: Jun 2009
Posts: 17
Cebu Philippines
U
uone Offline OP
Newbie
uone  Offline OP
Newbie
U

Joined: Jun 2009
Posts: 17
Cebu Philippines
problem solved

thanks


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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