Click on Entity and do something

Get technical support about the C++ source code and about Lua scripts for maps, entities, GUIs, the console, materials, etc. Also covered are the Cafu libraries and APIs, as well as compiling, linking, and the build system.
Post Reply
User avatar
arfur9
Posts: 90
Joined: 2017-02-25, 18:57
Location: uk
Contact:

Click on Entity and do something

Post by arfur9 » 2020-02-11, 14:31

How would I make an entity clickable or have the HUD change the cursor/crosshair as it enters and leave the entity?

I realized you could do something like Pipmak or Dagon (panoramic games) with Cafu.. some quick tests and the cube map quality looks good, although the cubic image order is usually numeric in Pipmak or Dagon so everything I use to render frames uses numbers (0001,0002....) is it possible to change the suffix type?
I have loads of stuff already rendered lol
User avatar
arfur9
Posts: 90
Joined: 2017-02-25, 18:57
Location: uk
Contact:

Re: Click on Entity and do something

Post by arfur9 » 2020-02-13, 11:33

ok, I've done it with a gui hotspot but it is zfighting badly even after adding cmat options
I'm not really sure why the gui is running off the cube, the cube should be 2x2 metres the gui is 512x512
the text at the top should read "clicked", the cursor is a magnifying glass
I tried it without a face where the gui is but the back faces don't show so it looks weird, plus I have the gui running off
Attachments
cafu_0001.jpg
User avatar
Carsten
Site Admin
Posts: 2168
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Click on Entity and do something

Post by Carsten » 2020-02-13, 12:40

I'm not sure I understand your question?
What suffix types should be changed?
The easiest way to click something is indeed a GUI (or simple to fire on it). How did you make the GUI in the screenshot?
Best regards,
Carsten
User avatar
arfur9
Posts: 90
Joined: 2017-02-25, 18:57
Location: uk
Contact:

Re: Click on Entity and do something

Post by arfur9 » 2020-02-13, 13:38

Usually doing cube faces you would render 6 camera views or maybe run an animation, usually its animation so irradiance is cached, most of the plugins or scripts I use would suffix with a numeric value not nz, px and so on.. I already have a bunch of images rendered it would be a pain renaming them

I think I've figured my gui problem, however I can't get it to match the lighting

How do we "fire" on something?
The box with the gui.. how do I detect the mouse down event on it if the entity has no gui..
I just need to know how to get the hit detected in console, I'll figure out the rest
For some reason I suck at lua, I just need a snippet in context an hopefully it'll sink in
Attachments
cafu_0002.jpg
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests