ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator How to create small scraps of paper and larger image
person icon
luposian
Registered User
Quote
2023-08-06 08:30:20

We already have pawprints, which are decals. They lay flat to the terrain. So we'd do something similar for a small piece of paper, but I only want it to appear after you've covered a multiple of 5% of the terrain (after 5%, 10%, 15%, 20%, and 25%). When you touch it, it disappears, and then the scene switches to a large image of the scrap and the words on it, like this:

https://files.catbox.moe/ydbeb8....

person icon
Guest
Guest
Quote
2023-08-06 08:42:38

How about you fruck off and answer my post in the Announcements first?

person icon
Guest
Guest
Quote
2023-08-06 10:24:00

Don't know what's wrong with me. I would like to apologize for my disrespectful posting. This is no way to behave in a public forum. Please remove my spiteful comment dear Admins. Sorry, will try to do better next time and think before acting.

person icon
luposian
Registered User
Quote
2023-08-09 08:11:56

Ok, decided to go a different route. I learned how to make a node disappear. The example (on YouTube) was a book, so I did likewise. I can make it disappear when I walk over it and have been able to apply a .png to several nodes and made a node (a cube) disappear a few seconds after walking over the book. The problem is, I don't want to do any of those things. I want the .png image of the text on the scrap of paper to appear in front of everything (basically it obstructs your view of the game) for several seconds before disappearing and you can continue playing. But not sure how to load/view a .png and present it onscreen, in that way. Tried finding a way in javascript, that would do that, but not having any luck so far.

I tried creating a plane and positioning it like the title text that shows up at the beginning of the Stage, but it ends up being small and above my character and just zooms around when I try to position my character to read it. I can't figure out why.

I sense I'm close to what I'm trying to achieve, but it's still eluding me. Hmmph! emoji icon_cry

person icon
sven
Registered User
Quote
2023-08-09 17:36:22

Maybe i didnt understand the question, but how about 2D overlay with image to be displayed?

You can hide /show 2D overlay..
Also you can change its texture and text.

person icon
Guest
Guest
Quote
2023-08-09 20:18:16

Perfect time to learn about Arrays.

person icon
luposian
Registered User
Quote
2023-08-09 20:43:18

wrote:
Maybe i didnt understand the question, but how about 2D overlay with image to be displayed?

You can hide /show 2D overlay..
Also you can change its texture and text.

Ah, just the guy I was looking for! emoji icon_grin

My original thought was, since paper is thin, the image should be thin. But I forgot that this is a type of dream realm, so things needn't be quite so literal as to the real world. Once I took that into consideration, I realized almost anything could be representative to the information Luposian picks up every so often, in the game. Why not a small book? Once he picks it up, it disappears but, then you see a large image, like the link I showed, displaying the information that book represented.

I've kinda figured out the "connection" part of getting something to happen after the book disappears, but not the thing I want to happen, which is the display of the .png image of the scrap of paper with the information on it.

I'm assuming doing something similar as to the beginning of the Stage, which is the title, except it would block out most of the game screen for several seconds (not transparent) before disappearing and you can resume playing. However, I'm not having any luck creating a similar thing. And I'm not sure why.

The transparent title screen is tied to the camera, as it follows Luposian for several seconds before disappearing. But not sure how to tie a similar (but non-transparent) thing to the camera again, after picking up the book.

Once I've got that down, then figuring out how to trigger the appearance of a book every 5% is the next thing. Unless one thing is harder than the other, to do.

Thankfully, there is no time constraint on this project, so each step takes as long as it takes to get done. emoji icon_grin

person icon
sven
Registered User
Quote
2023-08-09 22:12:24

2D overlay with trancparency color png image.

result_

https://ibb.co/fxTntLs

Disable DrawBackground and image has no background.

Here i made simple example with overlay and also with animated book.. (its fast made so it can be better)
Download link in video description.
https://youtu.be/VS8z_qNO-SI

person icon
luposian
Registered User
Quote
2023-08-10 00:33:45

wrote:
2D overlay with trancparency color png image.

result_

https://ibb.co/fxTntLs

Disable DrawBackground and image has no background.

Here i made simple example with overlay and also with animated book.. (its fast made so it can be better)
Download link in video description.
https://youtu.be/VS8z_qNO-SI

That is really cool what you did with the animated book opening like that! But, I think I'll stick with the slip of paper for now.

Thought I'd comment on my progress:

1) I used a website called remove.bg. This produced a file that has a black background. Once I used that version of the file, there was no more checkerboard background, it was perfectly invisible. So, desired transparency accomplished. Now just need to put text on the paper and then scale it appropriately.

Here's the image of my progress:

https://files.catbox.moe/a6vfcn....

I call it, "No Buttcheeks Allowed!"; this is a G-rated game, afterall! emoji icon_grin

person icon
luposian
Registered User
Quote
2023-08-10 19:39:22

Ok, I can have the book disappear when I touch it AND have the scrap of paper appear (it's a 2D Overlay), but then it never goes away. I've tried setting things so that it fades away after a few seconds... nothing happens. I've tried setting it so that it disappears when I click on it... nothing happens.

How do you make a 2D Overlay fade away or disappear several seconds after it appears? I realized that the title of the Stage is actually a texture (image) on a transparent plane, and there is a function that will make THOSE (3D objects) fade away. But I'm thinking 2D overlays are treated differently.

UPDATE! Ok, I can DELETE a scene node after a number of seconds. And then it (the scrap of paper) vanishes shortly after it appears. So, there's my solution to THAT problem.

Now I need to figure out how to make the book appear somewhere in front of Luposian after walking over 5% (and multiples thereafter, up to 25%) of the terrain.

person icon
count2rfeit
Registered User
Quote
2023-08-10 20:42:42

you can try using a Billboard and using JS to apply the .png to it...

var node1 = ccbGetSceneNodeFromName("Billboard1")
var tex1 = ccbLoadTexture("pic1.png")
ccbSetSceneNodeMaterialProperty(node1, 0, "Texture1", tex1)

that way you can fade or hide the Billboard as a scene node.

... or maybe I don't really understand what you are trying to do.. I am easily confused...

person icon
luposian
Registered User
Quote
2023-08-10 21:22:04

wrote:
you can try using a Billboard and using JS to apply the .png to it...

var node1 = ccbGetSceneNodeFromName("Billboard1")
var tex1 = ccbLoadTexture("pic1.png")
ccbSetSceneNodeMaterialProperty(node1, 0, "Texture1", tex1)

that way you can fade or hide the Billboard as a scene node.

... or maybe I don't really understand what you are trying to do.. I am easily confused...

I'll be uploading the next "version" (latest progress) of my game to my Itch page today sometime. It will show what I've done and the DevLog entries comment on the progress.

Update! New version uploaded and ready to play.


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |