Jump to content

(Solved) A Poltergeist with Drawimage only in ONE map. (Rest of maps ok)


Russell
 Share

Go to solution Solved by Russell,

Recommended Posts

Hello again team!!

See if you can help me with a Poltergeist that has suddenly appeared on one of the maps in my game.

I use a Script to display images on the screen using "context: DrawImage".

Until yesterday the images were showing me correctly on the screen. As I show in the following image:

gameplayentero.thumb.jpg.12389fbb8cf326e9abe68ecb81f58934.jpg

 

But today, as I continue working with the map, the textures appear like this. Translucent and in a gray color:

20201015224732_1.thumb.jpg.cb3217458fc0a5938a5f3f7dd7cfbada.jpg

The only change i have made to the map since yesterday has been to add 3 ship models and animate them with 3 platforms.

I use the same Script to display the same images on other maps in the game and it still works fine on them. I don't know why the images have started to look like this only on this map or where the problem comes from to fix it.

Has someone a similar Poltergeist happened to him??? Or any idea how to fix it?

Any help or clue with this will be welcome!!

Thank you!!

PS: "I've tried creating another NEW scripts to show the image or another images, an NO ONE of the images or the Scripts show the images full coloured. I don't know what more inspect..."

Link to comment
Share on other sites

6 hours ago, Marcousik said:

Hi,

Maybe you ran out of memory or something similar...

Did you try to load a backup map (a few days old) to see if the images are drawn correctly?

Yeah, i tried. And the backup shows the images ok. But there are to much changes to use it.

I'm afraid that I don't have more choices in this moment. In next days I will make all the new changes to the backup. ?

But that's better than losing all the work.

Thanks Marcousik.

Link to comment
Share on other sites

I have solve my Poltergeist team!!!

After many, many, many tests, I have discovered that the problem of my translucent textures in the only map where I get the error is derived from the INTENSIVE use of a VARIABLE "FrameTexture" that I use to display ALL the HUD images in relation to to CARRY OBJECTS WITH OUR HANDS ...

I control the entire HUD with "FrameTexture" variable, and it's possible that its use in that map is possibly saturated with the evolved idea of Marcousik. I think this is why I see all the DrawImage textures badly on the screen in that map:

	if frametexture ~= Texture:Load("Materials/Effects/black.tex") then
		context:DrawImage(frametexture, 0,0,context:GetWidth(),context:GetHeight())
	else
		context:DrawImage(frametexture, 0,0,context:GetWidth(),context:GetHeight()) 
	end


I have tried to create a new script with another FrameTexture2 variable, and the problem in that map is fixed. The hud images are working ok in the map again.


I don't like the idea of having a duplicate script that does the same as the old. And this, more than a solution is a patch that solves my problem. But I don't know the real origin of the Poltergeist. But hey!! To get out of the way is more than enough for me.

??

  • Like 1
Link to comment
Share on other sites

  • Russell changed the title to (Solved with a patch) A Poltergeist with Drawimage only in ONE map. (Rest of maps ok)

Ok!! Now i have reached one satisfiying solution!!!

With one more test i have solved my problems without use a duplicated script with another "FrameTexture2" variable. This 3 lines of CONTEXT in PostRender really solve my problem in this Poltergeist map maintaining the good functionality of the rest of the maps:

function Script:PostRender(context)
	context:SetBlendMode(Blend.Alpha)
	context:SetColor(Vec4(1, 1, 1, 1))

	--[[Block code of FRAMETEXTURE different uses]]--

	context:SetBlendMode(Blend.Solid)
end

I don't fully understand why the translucent images originated only in this map, but this second solution is better for me than the previous patch I have written above.

Link to comment
Share on other sites

  • Russell changed the title to (Solved) A Poltergeist with Drawimage only in ONE map. (Rest of maps ok)
  • 2 years later...
  • Solution

I know this thread is old. Sorry to get it back. But I'm happy to have it here...
Today it has happened to me again in another of the maps of my game, after develop the security camera system, the hud images have become translucent:

Translucidad1.thumb.jpg.b7122d09555e8861a085cfd40905c399.jpg

I didn't remember how to fix it.

But after review the thread and review the original code for the Diving Goggles and adding 2 lines:

	context:SetColor(Vec4(1, 1, 1, 1))
	context:SetBlendMode(Blend.Solid)

Context.thumb.jpg.a890ec26e76adb24b1fced5166f5724e.jpg

 

This solves the problem...

Translucidad2.thumb.jpg.a90d95fc4226b614a0c677f2bf864819.jpg

I know the problem is how i'm using the PostRender function in my lua scripts, but anyway i'm happy to have the solution here on the forum.

After 2 years, I had completely forgotten the solution that I managed to find to solve my particular case. 🥰 🥰 🥰 🥰 🥰 🥰 🥰 🥰

  • Like 1
  • Haha 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...