Scripts / Put a Prompt up after a certain time

Author
Message
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 5th Jan 2016 17:52
Hello everyone

I have a couple of scripts basicaly the same but one is for a switch on one side of a door and the other is for the other side of the same door, both of these scripts open and close the door and each affects the others animation.

Now don't get me wrong they both are working fine but when I press 'E' to open / close the door I instantly get the opposite prompt up.

Is there any way I can do a delay based on this setup. Of course any information that was started in one script would have to be passed to the other so as to keep them in sync

Thanks for any help given.
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.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 5th Jan 2016 23:10
name all 3 entities the same, works with 1 door only but you can set as many groups of 3 as you like per map and the switches can be anywhere (might need to set the door always active though if it's too far away)

door_with_switch.lua is for the actual door (blank script just to name the door)
door_switch.lua for the actual switches
life\'s one big game

windows vista ultimate

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

Attachments

Login to view attachments
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 7th Jan 2016 11:02
Thanks smallg, I tried these with my models, a switch on either side and a door in the middle all with the same name as you said. I made the door always active even though I didn't need too but I couldn't get it to work.

But I do appreciate all the work you put in.
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.
Corno_1
GameGuru Tool Maker
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 7th Jan 2016 15:03
Hmmmm, maybe you you are too near to both so if you activate one, both switches are active. Can you set the switches more far away to each other and test again?
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 7th Jan 2016 19:47
I was looking for "PlayerLooking" statemet but it does not exists in global.lua, so I guess this is a function than smallg forgot to state into the script. Or maybe I get wrong.

So meantime, comment out this line of code:

--if PlayerLooking(e,use_range,25) == 1 then
-- end

and it should work. Otherwise I get error, about passing nil value.

I've tried, and it work fine.

3com
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

PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Jan 2016 22:14
sorry, i'm normally good about adding my custom functions to other scripts but as 3com pointed out, i missed it in this case - edited my previous post attachments to include the function so they should work for you now.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 8th Jan 2016 11:10 Edited at: 8th Jan 2016 11:11
Oh Right I just assumed that this function came with GG as it didn't give me an error. I will check this later today as I am going out in a couple of minutes.

Thanks Corno_1, 3com and smallg.

Something good came from It not working though, it did make me practice my LUA scripting. I have written my own that is just about working.
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.
Corno_1
GameGuru Tool Maker
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 8th Jan 2016 11:35
Sometimes I feel stupid that I placed this function in, but not remeber this
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 8th Jan 2016 17:17 Edited at: 8th Jan 2016 17:20
@smallg thanks for that, it does work for both switches and I love the extra function that checks to see if you are looking at the switch but I have animation on the switch aswell.

I have been working on this myself for the last couple of days and came up with a solution that works great. Here is the script for the door and the switch.

Animated door and Switch script. The pause for the door opening and closing needs to be changed for different doors.
Door:


Switch:


Thanks again for the help
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.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Jan 2016 17:57
no worries, it's always useful to be able to script yourself as it opens up a lot of doors (literally in this case )
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 8th Jan 2016 18:30
Quote: "no worries, it's always useful to be able to script yourself as it opens up a lot of doors (literally in this case )"

LOL.

@ Taz
You'r welcome.

3com
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

PM
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 9th Jan 2016 10:10
Oh my god smallg, Dad joke lol.
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.
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 10th Jan 2016 11:14
@smallg

Thanks again for your script, as I said I realy love the PlayerLooking function that you added to it. If you let me use this would there be any restrictions on it's use. Obviously if there are no restrictions and I did use it I would say that it came from you.

Regards Tazman
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.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Jan 2016 17:40
No need, its fine to use, its already shared on my forum post from ages ago - along with a couple other quick functions I use lots
life\'s one big game

windows vista ultimate

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

Login to post a reply

Server time is: 2024-12-22 12:30:40
Your offset time is: 2024-12-22 12:30:40