bmap - invisible?

Posted By: DAVIDMORETON

bmap - invisible? - 11/08/09 11:21

Hello Folks,
Does anyone know how to make a bmap (key laying on floor) go invisible when clicked (the mouse pointer then takes on another bmap of the key - that works just fine, but the original bmap on the floor is still there.

It would seem that 'invisible' won't work in lite_c, is there something else? I've looked in the manual, but can't find it.

David
Posted By: seecah

Re: bmap - invisible? - 11/08/09 14:03

Wew.. have you tried

set(panel, SHOW);

then

reset(panel, SHOW); to hide?
Posted By: DAVIDMORETON

Re: bmap - invisible? - 11/08/09 15:23

Hi seecah,
Thanks for reply. Have tried using as you suggested but no luck. I must be doing something wrong.
I have the line:-

BMAP* key_map = "key1map2.bmp";

Which I place on the floor (the picture, that is!), What I need is some way of removing it or making it invisible.
any ideas?
David
Posted By: seecah

Re: bmap - invisible? - 11/09/09 03:05

Haven't you make any panel that contains your bitmap???
Posted By: Ayumi

Re: bmap - invisible? - 11/09/09 08:07

Don t try SHOW, use VISIBLE!

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=34473&Number=281931#Post281931

Ok, it s wrong but it have helped me.
(SHOW for bitmaps, VISIBLE/INVISIBLE for Entitys)

set(panel, VISIBLE);
reset(panel, VISIBLE);

same like INVISIBLE...
Posted By: DAVIDMORETON

Re: bmap - invisible? - 11/09/09 14:33

Thanks for your reply Ayumi,

I've only just started on lite_c (done c_script for ages),
Can't find how to put bit map into panel, and how to refere to it in the script.

David.(am taking the anti-thick pills, hope they work soon!)
Posted By: DAVIDMORETON

Re: bmap - invisible? - 11/09/09 15:32

Hello Seecah & Ayumi,
Many thanks for your help. (the anti-thick pills seemed to have worked, somewhat)
Below is my code (in lite_c) in case it helps anyone else.
(there have been 88 'hits' to date, so someone's interested!)

I did'nt want to get involved with panels, just wanted to use a simple bit-map which went invisible when 'clicked'.

BMAP* key_map = "key1map2.bmp";


function pickup()
{
if(event_type = EVENT_CLICK);
{
..... //switches key for 'key' mouse map
....
...
ptr_remove(key_map);
}}

action key //apply to key bit map(on floor in my case)
{
key_map = my;
key_map.flag = SHOW | OVERLAY;
my.emask | ENABLE_CLICK;
my.event = pickup;
}

This works just fine,
again, thanks for help, David
Posted By: Spirit

Re: bmap - invisible? - 11/10/09 10:12

Thats still all wrong. It may work by chance but will likely crash later. Here is the right code.

function pickup()
{
if(event_type = EVENT_CLICK);
{
ent_remove(me);
}}

action key() //apply to key bit map(on floor in my case)
{
set(my,OVERLAY);
my.emask |= ENABLE_CLICK;
my.event = pickup;
}

Dont assign an entity to a BMAP* pointer and dont set the SHOW flag for a level entity!

Posted By: DAVIDMORETON

Re: bmap - invisible? - 11/10/09 17:00

Hey, Thanks spirit,
saved the day again! I would have blown a fuse if I had completed the level, and it crashed for no apparent reason!

Just goes to show that 'fiddling about' to make it work ain't always a good idea - and I thought I was doing so well!!!

Thanks again, David

your code works just fine, but now I have another problem:-

if I omit the section "&&(mouse_map==keymap)" it works OK, except any mouse map (cursor) opens the door'.
If I add the above, the engine throws it out with 'syntax error' - what is the error please?

Here's the code:-


BMAP* goldkey = "goldkey1.bmp";
//the mouse map changes to this

function open_event() //door
{
if(event_type == EVENT_CLICK) &&( mouse_map==goldkey)
{
mouse_map=0;
while(my.pan<180)
{
my.pan+=2*time_step;
wait(1);
}}}

action door()
{
my.emask |=ENABLE_CLICK;
my.event=open_event;
}

This works fine in c_script, but seemingly not in lite_c. I don't understand this, and can find no ref. to this problem in the mamual. Hopefully , David
© 2024 lite-C Forums