Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, 7th_zorro, VoroneTZ, HoopyDerFrood), 1,264 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Scanning problem #161316
10/16/07 10:41
10/16/07 10:41
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline OP
User
bstudio  Offline OP
User

Joined: Aug 2006
Posts: 652
Netherlands
Hey,

I'm having some problem using c_scan with my pathfinding project. I need to scan in a node (it's A* based), and I'm creating bitmaps to see where the nodes are. But unfortunatly these get scanned as entity's too, so it can't find a free path (without entity's). How do I solve this, because it doesn't detect the other entity's too

Here's the code:
Code:

void CalcUsableNodes()
{
var i;
var j;
for(i=0; i<gridWidth; i++) //loop through width nodes
{
for(j=0; j<gridHeight; j++) //loop through height nodes
{
tmpModel = ent_create("under.bmp",vector((j*64)+32,(i*64)+32,5),NULL);//create a bitmap to see where the node is
Snap(tmpModel); //make sure it's in the right position
var scanResult = c_scan(vector((j*64)+32,(i*64)+32,1),tmpModel.pan,vector(360,0,32),SCAN_ENTS|IGNORE_ME); //scan for ents
if(scanResult == 0) //if no entity is found
{
nodes[(i*gridWidth)+j] = 1; //this node is clear for walking
}
}
}
}


Unfortunately all of the nodes stay on 0 (their initial value). Maybe there is a problem with the c_scan?

Thanx,

b-studio


BASIC programmers never die, they GOSUB and don't RETURN.
Re: Scanning problem [Re: bstudio] #161317
10/17/07 07:22
10/17/07 07:22
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline OP
User
bstudio  Offline OP
User

Joined: Aug 2006
Posts: 652
Netherlands
anyone??


BASIC programmers never die, they GOSUB and don't RETURN.
Re: Scanning problem [Re: bstudio] #161318
10/17/07 10:25
10/17/07 10:25
Joined: Dec 2005
Posts: 478
India
M
msl_manni Offline
Senior Member
msl_manni  Offline
Senior Member
M

Joined: Dec 2005
Posts: 478
India
SCAN_LIMIT : Finds only entities with ENABLE_SCAN set, or only static lights whose range can reach the scan origin. Can be combined with SCAN_ENTS and SCAN_LIGHTS.

Why dont you use SCAN_LIMIT. Check the help file for c_scan and and you will find it there.


My Specialities Limited.
Re: Scanning problem [Re: msl_manni] #161319
10/17/07 10:45
10/17/07 10:45
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline OP
User
bstudio  Offline OP
User

Joined: Aug 2006
Posts: 652
Netherlands
with scan limit it doesn't work either, the nodes on which the models stand are still regarded as open for walking this is the action I use for the models:
Code:

action ScanModel()
{
my.emask |= ENABLE_SCAN;
}




BASIC programmers never die, they GOSUB and don't RETURN.
Re: Scanning problem [Re: bstudio] #161320
10/17/07 20:39
10/17/07 20:39

A
Anonymous
Unregistered
Anonymous
Unregistered
A



can you use a id

action node
my.id =6000;

function
if(event_type == EVENT__SCAN)
if(you.id == 6000)


would that work? I'm new to this and my pointfinding system uses is to tell entities apart.

Re: Scanning problem [Re: ] #161321
10/17/07 20:43
10/17/07 20:43
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline OP
User
bstudio  Offline OP
User

Joined: Aug 2006
Posts: 652
Netherlands
The problem is that the objects which are placed onto some nodes don't get scanned. They need to get scanned so I can tell which nodes are free and which aren't


BASIC programmers never die, they GOSUB and don't RETURN.

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