Scripts / Request a script here please.

Author
Message
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 20th Feb 2016 21:58
i want a script that i can attach to any object in the game .. Where player approaches the object it asks to press E
When player presses E a paragraph appears.. i will simply edit the paragraph in the script but i don't know how to write the script it self.
And if possible to be attached to NPCs too.
PM
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 21st Feb 2016 12:11 Edited at: 21st Feb 2016 12:47
This might help just take the file and put it in your scriptbank, then for each item put approach.lua in the properties main tag.

In the properties of the item you need to make sure that IsImmobile is set to 0

Once this is done you type the text you want to appear in the name tag of the properties of each item and it will give you what you want, I am not sure how much you can type in the name property but it will do for now. until I think of something else.

This was the only way I could think that you could have a different text for each item.

This script can be used non commercialy or commercialy

Hope this helps

PS: I would not know how to set this up for NPCs sorry, I think it would need the NPC script re - writing.
HP Pavilion Laptop, AMD A8-4555M APU with Radeon(tm) Graphics HD Graphics 1.6GHz, 8GB Memory, 64 Bit Operating System (Windows 10), 1 TB Hard Drive.

I've got something to say - It's better to burn out than fade away.

Attachments

Login to view attachments
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 21st Feb 2016 12:26
Hello again I have just tested it and you can fit 63 characters in the name property, which is quite a few words.

There is another way of doing this but the script would be a lot more complicated and for you to set the text up.
HP Pavilion Laptop, AMD A8-4555M APU with Radeon(tm) Graphics HD Graphics 1.6GHz, 8GB Memory, 64 Bit Operating System (Windows 10), 1 TB Hard Drive.

I've got something to say - It's better to burn out than fade away.
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 21st Feb 2016 14:31
I will try this now and 63 characters is fine.Thank you so much.
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 21st Feb 2016 15:01
There are several examples of this kind of script included with GG by default. Probably a good idea to look at examples you have, before posting on the forums. Also, as it is said in the main scripts page "This is not a request thread".

Still, as I say for basics like this take a look at scripts you get as standard. There are quite a few you know.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 21st Feb 2016 17:01
Yes sorry, thank you.. i will be careful next time
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 21st Feb 2016 17:16
For those 2 files posted on SmallG forum
I just used them but the door doesn't open .. i don't get it ..
am using the gunned rabbit with 227 number .. and i kill him but the door still doesn't open nor give me you need to kill enemies message.

Attachments

Login to view attachments
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 21st Feb 2016 17:21
I replaced both the door script and the ai soldier script with those 2 scripts.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Feb 2016 17:34
you could also use my note_sprite.lua script to create a series of images just for showing text, much easier to set up and use as many lines as you wish and see the layout etc already in your paint program before you get them in game and you can then add backgrounds, colours and everything without needing to adjust any code.
just make all the images match your current resolution and place the text in the desired location and adjust the script to match - i.e. set the x and y to 0 and size to 100.

the only issue will be that it can't display values effected by the game - such as current money, health etc (as you wont know what these are at the time of creating the image) but for standard messages and hints etc it's a good alternative.

https://forum.game-guru.com/outbound?url=https%3A%2F%2Fforum.game-guru.com%2Fthread%2F207801%3Fpage%3D12%23msg2541219

i'll attach a quick example of what you can do very easily (genuine in game test shot i just created in 1 minute)

life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Feb 2016 17:40
can you clarify you have followed the instructions?
Quote: "- you need to name the door and the AI (required to be killed, so doesnt need to be everyone in the map if you wish) the same in the editor"
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 21st Feb 2016 17:57
Mr SmallGG i don't know what you mean By those instructions like
The name of the file ? Or the Main ? what do i change .. where is that name that iam suppose to change .. am quit slow with understanding so please explain. and thank you for the sprite i will test it and tell you if i got stuck in any thing while doing it.
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 21st Feb 2016 18:40 Edited at: 21st Feb 2016 18:41
The sprite works wonderfully thank's, but can you still tell me in details where do i apply these instructions [quote=] - you need to name the door and the AI (required to be killed, so doesnt need to be everyone in the map if you wish) the same in the editor"[quote=]
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Feb 2016 18:58 Edited at: 21st Feb 2016 18:59
click on the door and open the properties, you will see you it's name and you can name it something else - do so (make it unique) and then copy the same name into all rabbits that will need to be killed to open the door

i.e. click -> properties - > name the door "door1"
repeat for the rabbits (name them also "door1")
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 21st Feb 2016 19:06
What about your scripts ?? What do i do with them ?
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 21st Feb 2016 19:11
I did thank you .. i just changed the name as u said thank you so much
PM

Login to post a reply

Server time is: 2024-05-03 11:39:54
Your offset time is: 2024-05-03 11:39:54