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
2 registered members (TipmyPip, 1 invisible), 18,789 guests, and 8 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_tracing around entities? #250981
02/11/09 02:31
02/11/09 02:31
Joined: Aug 2006
Posts: 70
NJ
S
SirCamaris Offline OP
Junior Member
SirCamaris  Offline OP
Junior Member
S

Joined: Aug 2006
Posts: 70
NJ
Hi, I've built a level in WED using prefab units, each unit combining walls, floor, and ceiling. When I connect these units, corridors that run perpendicular to one another are made. There is one sprite that is not initially visible to a player because it is hidden around a corner in another corridor. I'm trying to use c_trace so that a text message will appear once the sprite is visible and comes within range, however, the event is triggered without the aforementioned being true. Here is my code:
Code:
STRING* imp_str = "Got imp";

TEXT* imp_txt = 
{pos_x = 100;
 pos_y = 50;
 string = imp_str;
}

ENTITY* Imp_ent;

action Imp_act()
{Imp_ent = my;}

action player_move()
{player = my;
  while (1)
    {camera_view.pan = player.pan;
     camera_view.x = player.x;
     camera_view.y = player.y; 
     
     c_trace(player.x, Imp_ent, USE_BOX + IGNORE_ME);
	if (you = Imp_ent)
	{ imp_txt.flags = VISIBLE;
	}
     wait(1);
    }
}

The message, "Got Imp" displays at the beginning once the level loads, but the Imp model is not visible because the prefab level units are in the way.
Pseudocode: If you = Imp_ent in the c_trace command, make the message visible even if the Imp_ent is not visible.

Either I'm missing the c_trace command logic or c_traces around other entities.

Please help.

Re: c_tracing around entities? [Re: SirCamaris] #251019
02/11/09 08:57
02/11/09 08:57
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
if (you = Imp_ent) should be if (you == Imp_ent)

Re: c_tracing around entities? [Re: George] #251215
02/12/09 00:25
02/12/09 00:25
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

imp_txt.flags = VISIBLE;

should be

imp_txt.flags |= VISIBLE;
or
imp_txt.flags |= SHOW; // FOR VER 7.66.4

give us feedback smile

Ottawa

Re: c_tracing around entities? [Re: Ottawa] #251216
02/12/09 01:22
02/12/09 01:22
Joined: Aug 2006
Posts: 70
NJ
S
SirCamaris Offline OP
Junior Member
SirCamaris  Offline OP
Junior Member
S

Joined: Aug 2006
Posts: 70
NJ
Thank you George and Ottawa; both of your changes had to be made for it to work properly. Ottawa, I used imp_txt.flags |= VISIBLE;

I am wondering what the "|=" operator is called and what it is used for. Is it exclusive to Lite-c?

Re: c_tracing around entities? [Re: SirCamaris] #251267
02/12/09 10:33
02/12/09 10:33
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
That's how you set the flags in lite-C; the good news is that you can set several flags at once:

imp_txt.flags |= (VISIBLE | TRANSLUCENT); // just an example

Re: c_tracing around entities? [Re: George] #251427
02/12/09 23:56
02/12/09 23:56
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!


Look for "Flags at a glance" in Free Ressources under WDL.

The version for 7.66.4 has been sent but not posted yet. smile

Ottawa


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