Scripts / Having trouble understanding displaying image scripts

Author
Message
zaxgee
9
Years of Service
User Offline
Joined: 18th Apr 2015
Location:
Posted: 3rd May 2015 23:45
I'm basically learning things through error and successes the hard way and in most bits I am getting there slowly. The thing here that I don't fully understand that I hope someone could explain in an easier way for me, is that I want to approach an entity(in this case a paper) and it allows you to pickup the entity therefore destroying it once you picked it up and when picking it up with E, it displays the image.

Now this is the bit I've gone wrong. I don't even know where to begin to make the entity pick able and read it again in a journal and whatnot but the question here is how you properly have the image displaying. I've tried doing loaded images and got a folder named notes with the image 001 in it and so if anyone can correct me where I'm going dreadfully wrong?

This is what I've done so far (The image is the test image I was going to try it on)

function readnotes_init(e)
end

LoadImages("notes",0)
SetImagePosition(0,0)
SetImageAlignment(1)
ShowImage(12)
function readnotes_main(e)
end


Again, brand brand noob.

Attachments

Login to view attachments
PM
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 4th May 2015 10:38 Edited at: 4th May 2015 11:00
1) ShowImage(n) should be in main and would be triggered on pickup.

2) How many images are you using? You show "12" in your script, if it's only 1 image and it's called "000.png" that would be ShowImage(0)

3) Your script has nothing in init or main.

It might look like this


Note this is not a proper working script without adding more (it's off the top of my head). I could do a full tested script if you need but these are the 3 most glaring issues I see that may get you on your way.
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 4th May 2015 11:26
Maybe this is what you looking for.

https://forum.game-guru.com/thread/210893

Harry
Harry
PM
zaxgee
9
Years of Service
User Offline
Joined: 18th Apr 2015
Location:
Posted: 6th May 2015 18:42
Thank you both very much, I didn't see my thread appear yet but I've just noticed it now. I knew about the init and main but I must've been tired and just quickly pasted in, I really appreciate it. The link helps out a lot and so does the explanation from !nullptr. Many thanks!
PM

Login to post a reply

Server time is: 2024-12-22 01:40:19
Your offset time is: 2024-12-22 01:40:19