Scripts / [SOLVED] Problem with image script

Author
Message
Shiraz
3
Years of Service
User Offline
Joined: 23rd May 2020
Location:
Posted: 16th Nov 2022 13:01 Edited at: 16th Nov 2022 13:05
Hi all
Hope you're fine and doing well

I just wanted to ask... what is my mistake in this script?:



After attaching this to a barrel model which its static mode was set to no, nothing happens.

And sorry for asking a simple question. This is my first time of coding.
Thanks in advance

The author of this post has marked a post as an answer.

Go to answer
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 16th Nov 2022 15:20 Edited at: 16th Nov 2022 15:23
Try this one

Quote: "--image shows by pressing E
local epressed = 0

function documents_init(e)
LoadImage("scriptbank\\images\\Morning Mountain Stroll",0)
end

function documents_main(e)

if g_KeyPressE == 1 and epressed == 0 then
epressed = 1
SetImagePosition(50,50)
SetImageAlignment(0)
ShowImage(1)
end

if g_KeyPressE == 0 then epressed = 0 end
end
"


Check out that your image folder is on the right path.

Edit: I use to press the "E" key rather than the "J" key since GG used the "J" key to run the jetpack.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Shiraz
3
Years of Service
User Offline
Joined: 23rd May 2020
Location:
Posted: 17th Nov 2022 03:10
Thanks for your answer. But unfortunately it didn't work either.
The path of the image is:
Steam\steamapps\common\Game Guru\Files\scriptbank\images\Morning Mountain Stroll
There are two files with the names of "000.png" and "001.png".

By the way, I think pressing E will sometimes interfere with the action of opening doors, won't it?

Thanks again
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 17th Nov 2022 10:51
@ Shiraz
You are right there might be a bug in GG showing images.
Although "LoadImage" has a typo, since it should look like "LoadImages", even so, the script does not work.
The script is correct, so, as pointed out above, you should raise a bug report on GitHub.
I'm running the public preview version, with the latest updates. I've verified the files, but to no avail.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 18th Nov 2022 22:57
This post has been marked by the post author as the answer.
You can do it like this.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Shiraz
3
Years of Service
User Offline
Joined: 23rd May 2020
Location:
Posted: 20th Nov 2022 06:35
@AmenMoses
Great! Thank you so much!
PM

Login to post a reply

Server time is: 2024-04-25 09:13:12
Your offset time is: 2024-04-25 09:13:12