Scripts / Need help with Jumpscare type scripts

Author
Message
Timba
9
Years of Service
User Offline
Joined: 22nd Apr 2015
Location: Florida
Posted: 24th Apr 2015 20:06
Hi everyone. I'm working on a horror game but i just can't figure out how to create jump scares with Game-Guru. I am not good at all ins scripting. I am really not good at scripting so i was hoping there is a script for this type of tasks? I would like to have a character appear in front of you and disappears. Or like a walking creature that passes in front of you from one room to another when you reach a certain trigger and disappears.
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 24th Apr 2015 20:42 Edited at: 24th Apr 2015 20:50
Most of what you want is not script so much as setting up.

Set down a trigger zone and a character just in front of it. Turn spawn at start off on the character properties. Get the characters entity number.

Create a small script something like this, call it jump.lua (or whatever) and assign it to the trigger zone properties.



(this is neither tested nor good enough for continued use but will give you an idea of how it's done)

To get the "passing" effect would be similar and could be done using the move entity functions (or even waypoints?). You could "Destroy" the character after the move but that makes it one shot, one time. Check out the scripting guides and more importantly, look inside global.lua for a list of entity commands you could use.

Any kind of ghostly appear/disappear would have to be an animated model. One of the guys wrote a "stealth" script somewhere recently which may also show some good techniques worth looking at it.
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
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 25th Apr 2015 01:48
Hello. Deleted your post in product chat as you opened one up here. Thank you.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

Timba
9
Years of Service
User Offline
Joined: 22nd Apr 2015
Location: Florida
Posted: 25th Apr 2015 04:08
how do I get the entity number? is that the name of the entity?
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 25th Apr 2015 04:55
Bottom left of the IDE when you hover over the entity. You'll see 2 numbers, take the first one.
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
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 25th Apr 2015 08:16
You don't need entity numbers nor (separate) script for that kind of jumpscare. Place a trigger zone and in "if used" field (of the zone) put name of your character. Set the character's "spawn at start" to "no". When player enters the zone all characters that have same name as the "if used" field of the zone will spawn.
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 25th Apr 2015 09:07 Edited at: 25th Apr 2015 09:10
Interesting Avram. Wasn't aware that ifused would spawn as well. Logic says activate should run the entity and spawn would spawn the entity... ie: if not spawned it would not activate.

Wonders will never cease with this thing.
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
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Apr 2015 10:32 Edited at: 25th Apr 2015 10:36
as avram said the ifused field is your best option but you will need a custom script like this to make it disappear again
https://forum.game-guru.com/thread/207801?page=7#msg2516046

for the second one - walking from 1 room to another - is it a custom entity or a stock character?
you can use a trigger to spawn the entity, waypoints for it to move and then some other trigger to destroy it once it reaches the end.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 25th Apr 2015 20:22
Quote: "as avram said the ifused field is your best option but you will need a custom script like this to make it disappear again"

Which is why I used the script idea from the outset because as soon as Timba wants to do something *other* than just ignore or shoot the character he has to revert to script.
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
Timba
9
Years of Service
User Offline
Joined: 22nd Apr 2015
Location: Florida
Posted: 29th Apr 2015 19:56
than you very much. I think that link with the jump scar scripts will help me.
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 29th Apr 2015 20:04 Edited at: 29th Apr 2015 20:05
Check out this video



Slightly editied script here, from small's great script.

Just made some small changes to jumpscare.lua, hope youe don't mind smallg

* added a light which emits when you enter the trigger zone, find the entity number of the dynamic light and enter that as the local variable ln
so if entity 6 is your light, just put local ln = 6

Place the light just in front and above the entity that will appear when you trigger the zone.

Looks great in a dark scene.

jumpscare2.lua

Timba
9
Years of Service
User Offline
Joined: 22nd Apr 2015
Location: Florida
Posted: 1st May 2015 13:23
yes. works like a charm. thx
ASUS MAXIMUS VII HERO | Intel Core i7 4790k | 16 GB RAM | EVGA GTX 980 SC | 120GB SSD(OS) | 512GB SSD(Programs) | 1TB WD Black(Backups) | EVGA SuperNova 1000W G1

Login to post a reply

Server time is: 2024-05-07 10:48:12
Your offset time is: 2024-05-07 10:48:12