Scripts / i would like to save hostages and disarm bombs :)

Author
Message
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 19th Aug 2015 07:54 Edited at: 19th Aug 2015 08:01
hi there! i would like to know if this can be made with scripting (and how):
the game starts and i can not leave the house before i haven't asnwered a cell phone. the cell phone is on a table and ringing until i pick it up and a sound (bla bla bla) comes and then i can leave the building.
i want the player to solve a puzzle before he can go thru the next door. i would like "rescue 5 hostages" before i can proceed. is it possible to save 5 (or less) people until i am allowed to walk thru the door?

i saw "the big escape" where you must blow up 5 objects until you're allowed to wlak thru a door. i could use that but i don't want to blow up things. i would like to disarm a bomb (not blowing it up) or save a hostage (open a door and release the person) f.e.

edit:
if i would like to blow things up could it be possible to collect an explosive before the blowing up starts? i mean in this level i'm coming out of nowhere with no explosives and then i have to blow stuff up. how did i get the explosives? so if i collect a dynamite stick i could start with it but if i don't have the dynamite i shouldn't be able to blow stuff up.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
Avram
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 19th Aug 2015 09:55
It is possible, but you will have to dive deep into LUA and learn about variables, then have one for each task you need to do and set/check them accordingly.
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 19th Aug 2015 13:22 Edited at: 19th Aug 2015 13:24
yes, i thought so this scripting is not my world. in "visionaire" i have created adventurous improvisations only to avoid LUA scripting i will have to rely on someone who helps me with LUA. otherwise i will have to think for an easier plot for my game.

or could you tell me how to change the scripts from "big escape", i want to disarm a bomb instead of blowing it up. that's all i need to change, that would be okay for me.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Aug 2015 18:47 Edited at: 20th Aug 2015 00:06
there's a guide on steam for basic scripting, i suggest you check that first http://steamcommunity.com/sharedfiles/filedetails/?id=398177770

after that you will want to get a clear idea of what you want to achieve and then start putting it into script (lua is nice for this because you can literally write it out in a series of 'if' statements and it should be all you need)

so let's go through it
Quote: "the game starts and i can not leave the house before i haven't asnwered a cell phone. the cell phone is on a table and ringing until i pick it up and a sound (bla bla bla) comes and then i can leave the building.
i want the player to solve a puzzle before he can go thru the next door. i would like "rescue 5 hostages" before i can proceed. is it possible to save 5 (or less) people until i am allowed to walk thru the door?"


firstly to block the player leaving the house you need a door or some obstacle right?
so make a script for the door and set in it


now this script doesnt do anything yet so we need to decide what happens when the phone has been answered -> 'unlock'
so we will need the main part of the door script for this


combine this like so
(i've called mine phone_door.lua


now we require the phone script so...
1. first we need to make the phone ring
2. then we need to check the player is near the phone
3. then we need to check the player has pressed to answer it
4. then we need to check the call has been played (the sound)
5. then we unlock the door

i'll call mine phone.lua


for the next puzzle it's basically the same thing but you will be using different variables
-mainly 1 global for number of hostages saved rather than the phone_answered

give it a go and i'll help if you get stuck
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 19th Aug 2015 19:19 Edited at: 19th Aug 2015 19:23
First you have to make a sketch of what you want to achieve.

Defuse the bomb
You may want to work with a timer, set a limit to defuse the bomb before it explodes.

You may want to enter a password to disable the bomb.
Also you should hide this password in a convenient location.
The player has a limit to find the password and enter it in the control panel.

There are many scripts in the forum, you can consult and take with you related information, that I mentioned above.

a- Working with a timer and delay
b- Working with password to get something
c - Open the door. (notice door work with key, so set "haskey=true") when the player get the pass.

Of course if you've some related question, I'm sure some1 can help'u, even me.

Enjoy

edit: Smallg fast and effective as ever.

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
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 19th Aug 2015 22:25 Edited at: 19th Aug 2015 23:00
thank you guys, that is a really huge help!!!! i'm trying it. i saved "phone.lua! and "phone_door.lua" and attached it to the door and the phone in a room and when i start i get this error message:

scriptbank\phone_door.lua13: 'then' expected near 'answered'

i have just tried your "note.lua" script and it was the first script i got from here and it works! i'm happy to learn more about it and that you both can help me with that! great place here, again

EDIT:
now i read some about it and i think when i get this phone thing working i will take on the next task. what do you think would make more sense: the player is all alone in a giant hotel resort and i want some puzzles to force the player to explore the entire area. so maybe disarming bombs (without explosions) would be great. when i got 5 bombs disarmed i am allowed to enter the hotel or something like this. but first i would like to have this phone thing working, there seems to be something wrong, i'm checking if i got typo there
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Aug 2015 00:04 Edited at: 20th Aug 2015 00:07
oh sorry that's what i get for not testing them
this line (13)
Quote: "if phone answered == 2 then"

should be
Quote: "if phone_answered == 2 then"


and at the end i put
Quote: "main"

instead of
Quote: "end"


i have fixed the original snippet now (i hope)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 20th Aug 2015 08:39
oh great, thank you very much! i will try it when i'm home. this will bring real life and interaction to my island resort! you will hear from me
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 20th Aug 2015 19:57 Edited at: 20th Aug 2015 19:58
i fixed the lines but now when i start i get a new error:

error running function: scriptbank\global.lua:286: attempt to index field '?' (a nil value)

and the phone does ring! but i can't pick it up. i changed the lines in the phone_door.lua. do i also have to change something in the phone.lua?
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Aug 2015 22:00 Edited at: 20th Aug 2015 22:03
for some reason i decided it would be a good idea to write the scripts in the reply box here rather than actually test them in GG... never goes well, apparently you can't set something's activation setting in the init function (and i forgot to include a distance check on the door... so i have fixed that too... scripting is easy enough if you actually test it )

phone_door.lua


sorry about that

as for the phone... it works for me.
edit, you just need to walk near it and press 'e'
- did you want a prompt?
if so change
Quote: "--check player is near the phone (change 100 here to distance you require)
if GetPlayerDistance(e) < 100 then
--and has pressed to answer it"

to
Quote: "--check player is near the phone (change 100 here to distance you require)
if GetPlayerDistance(e) < 100 then
PromptLocal(e,"Answer phone? *e*")
--and has pressed to answer it"
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 20th Aug 2015 22:45 Edited at: 20th Aug 2015 22:50
@smallg:
i changed it. and it works! thank you very much!!!

i have some more questions about it:

- when i open the door before i answer the phone, there could be a text appearing like "Pick up the phone before you leave"
- when i pick up the phone i would like to have a wave file played (the telephone chat with my buddy)
- after that i would need to pick up the phone, the phone needs to disappear

that would be perfect and all i need for this scene. i will read the page about scripting but until now it is like a jungle for me thank you again for helping me with this!!

EDIT:
oh wait! problem: the door has no sound although i put the sound in it AND i can not walk thru the door!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Aug 2015 01:06 Edited at: 21st Aug 2015 01:08
oops, well this is going well
it's a magic door that opens but can't be entered

there is an activation switch i used so i will check this trigger to swap the collision on and off but i will do it outside the actual animation sequence because i want to add a slight delay to stop you walking through the door while it's still animating.



for the phone all we need to do is call the Hide(e) command to make it invisible (this is in the last part of the call)

phone.lua


as i said, the actual call part is done from sound slot 1, as long as it fits GG's file format it should work.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 22nd Aug 2015 23:04
hello smallg, i have changed the script and now i want to tell you what happens:

- when i go to the door i can read "i should pick up the phone before i leave" this is right what i wanted, great!

- the phone rings (sound in slot 0) repeatedly until i pick it up -> great!

- when i pick up the phone my (test) audio from slot 1 comes. -> also great BUT the sound is in a loop until i press E or leave the place where the phone is. how can i change that the sound is only played once? and when i picked up the phone it does not disappear.

- when i'm finished i can open the door but the door has no sound although i put both sounds in slot 0 and 1

so the slot 1 sound is in a loop, the phone doesn't disappear and the door has no sound but the rest is wonderful. thank you! can you help me solve the last problems with it?
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd Aug 2015 23:25
You need to set the call duration in the script and it should work

For the door add PlaySound(e,1) next to each of the PlayAnimation(e) calls in the door script (default doors don't play sound)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 23rd Aug 2015 01:04 Edited at: 23rd Aug 2015 03:50
Quote: "You need to set the call duration in the script and it should work"

in the script on top there is

i don't understand what i must change, can you help me there?

i have better information about it: when i pick up the phone the answer call is looped three and a half times and then the phone disappears. i have just a very short file that is about 3 seconds long to test. i guess there is a value and the loop is repeated until that value is reached right? i think i would be more logical if the phone would disappear BEFORE the soundfile from slot1 comes.

Quote: "For the door add PlaySound(e,1) next to each of the PlayAnimation(e) calls in the door script (default doors don't play sound)"

it works! yes, i got it working! great!

how can i add "press E to pick up the phone" to the phone script?
edit: i fixed this how can i add "press E to pick up the phone" thing myself! thanks to your help i got this working myself. i'm so proud now can you help me with the rest?

getting better step by step
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 23rd Aug 2015 01:48
Well done. chaps!
Julian
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Aug 2015 10:48
like it says
Quote: "worked out in seconds and multiplied by 1000"

so 3 seconds would be 3000 but you'll need to adjust it til you're happy with it as it's unlikely the file will be exactly 3 seconds

to hide the phone earlier just move the Hide(e) earlier like so

life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 23rd Aug 2015 12:22
so that would mean the line

local call_duration = 5000

means that the sound will be played for 5 seconds? this is just like visionaire, exactly the same. after every line i had to tell the program how long the sound has to be played. so i have to change the 5000 to a smaller number depenting on the length of the sound file. did i get this right here?
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Aug 2015 12:55
yep that's correct
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 23rd Aug 2015 20:51
yeah now i got it! it is exactly just like in visionaire studio. so i already scripted but with a lego brick system- like tool.
thank you very very muchfor this smallg!!!
okay this is all working great. i have a last issue: the telephone appears again after i open the door!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Aug 2015 21:21 Edited at: 23rd Aug 2015 21:22
that's weird, not sure why it would do that but maybe you are moving out of range and so the script is getting shut off, try adding
Quote: "Destroy(e)"
below the the
Quote: "Hide(e)"
command *that i commented out* in the phone script (not the new Hide(e))
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 24th Aug 2015 06:24
okay i will try this. another question about this: when i change "call duration" will it also affect the ringtone in slot 0 ??
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 24th Aug 2015 23:46 Edited at: 24th Aug 2015 23:55
everything works! great thank you!!
i added "press e to use the door" when the cell phone is picked up.

i have a last question, when i have a long audio file playing (the phone call) can i open the door while i listen to the phone call or do i have to wait until the file is over? if the player could wait it would be better
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Aug 2015 11:56
currently you have to wait
if you wanted to change it so you can leave earlier you would need to add another if in the part when sound 1 is playing, like



would let you leave after the call is 1/2 way through etc
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 25th Aug 2015 12:05
no that's great. i would like the player to wait until the call is over. i recorded a phone call dialogue in english and ... no. i will have to do it in german and add some subtitles later somehow. that's not really nice to hear

thank you smallg for your help!!!!!

i have decided that i want the player to disarm bombs in the resort.
in "the big escape" there is a script how to blow up supplies but i don't want to blow things up, i want to disarm the bombs. OR i have to collect 3(f.e.) detonators to disarm the bombs until i will be allowed to enter the hotel (locked door).

how could i do this with a script? this would be my last request, when i got this i can go on with my game. i have tried to change the scripts fom "big escape" but i always caused GG to crash.

what would you suggest? collect the detonators (display like "4 of 5 collected") or go to the bomb "press E to disarm the explosive" ?? and how would this be done? would it be useful to use a script from "the big escape" or "cartoon" where i have to collect the coins just change the coins to detonators or something? this is really twisting my brain...
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 27th Aug 2015 09:07
can anybody help me with this? i have made two scripts but they both don't work and cause crashes
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 28th Aug 2015 10:20
If possible do a point by point of your requirements so anyone writing the script will know what you want (where to put sounds, prompts etc, the order of the actions) because there's so much variation in how to achieve things like this its better to be specific so it matches your idea rather than someone else's version of it.

Or post your script and we can help correct it
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 28th Aug 2015 12:02
the problem is i don't know what i want. i want the player to be forced to roam the area and find a number of bombs (maybe 3 or 4) and the player has to disarm them to get access tpo the next part of the area. i would like to have "3 of 4 bombs disarmed" displayed until this target is done.

so a possible idea would be:

- the player has got the key to the resort, opens the gate and gets a phone call (this can be done with a sound trigger) and he gets told that there are 4 bombs that need to be disarmed. a text might be displayed "disarm the bombs" then there comes a text that should be visible all the time "x of x bombs disarmed"

- the player finds 3 or 4 bombs. i think this will be crates with dynamite and explosives (i already made this object) and the bomb should be ticking when the player comes close to the bombs. not really important but would be nice.

- when the player is standing in front of the bomb a text appears: "Press E dis disarm the bomb". Then the bomb is disarmed, the ticking stops and there is "1 of 3 (or 4 whatever) bombs disarmed" The player needs to have all bombs disarmed to get thru the gate to the next part of the level.

that would be all of it.

i created a script based on the comic level where you have to collect coins (i wanted the player to collect the bombs instead) but it doesn't work. i want the gate to be only accessable when all bombs are collected but it doesn't work.
i tried to alter the scripts from "big escape" there is the same task but you have to blow up supplies. i have the gate that says "you can't open this gate before you completed your objective" but the script regarding the supply makes the supplies be explodable. the player already has explodables and he must use them to blow up the supplies. but this doesn't make sense here.

terrorists have taken oven the resort and i want to have a plot that makes the player have to walk around the area. i have two key puzzles but this is getting boring and the map is not so good for another key puzzle.

in another map i can really use this "blow up the crates" script but here i would like to have to disarm bombs.
when i got this i would like the alter this script into "save the hostages to go on" this is always the same routine but with different ways to get there.

i have a script but it's not worth posting here (i'll do it when i'm home) because it's full of errors. when i start GG i get a lot of error messages about the scripting that doesn't work because of some wrong lines. this is really annoying. i'm reading ho to code in the tutorial but i still get this wrong all the time.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Aug 2015 19:14
place an entity to act as the trigger for the phone call (rather than a zone so you can set it always active - for the prompt) it will be hidden automatically so no worries.
sound 0 is a ringing noise, sound 1 is the actual conversation (you will need to open the script to change the conversation length i guess)
name it (in the editor) however many bombs there are to destroy in the map - this is important.

place your bombs and give them a noise at slot 0 for the ticking

place the gate like normal but give it the script from here
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 30th Aug 2015 19:43
oh this looks really great! i'm trying this right now and can you tell me where in wich file (line) i can change how many bombs i have to disarm? i was looking thru the script, trying to undestand and i didn't find an obvious number
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 30th Aug 2015 19:54
what can i say..


Harry
Harry
PM
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 30th Aug 2015 20:04
thank you very much for this script it looks like this is exactly what i needed. thank you!
i have made some screenshots how i set up the objects and what error code i get. i did not enter a umber how many bombs i have to disarm (see above) so i guess the error message in the end has something to do with this. i answer the phine, get the call and read "disarm the bombs" then it freezes and i can't disarm the bombs.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Attachments

Login to view attachments
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Aug 2015 21:22
Quote: "name it (in the editor) however many bombs there are to destroy in the map - this is important."


life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 30th Aug 2015 22:14
ok, got it. i didn't really understand that i have to go on properties and enter a "5" (f.e.) in the field "Name". now i got it.
i still have a problem. no wait. i forgot to set the bombs as "dynamic". i think now it works... i'm testing now...
THANK YOU smallg for helping me, this is awesome! and it's working!

a little question: when i don't pick up the phone and just go on to the bombs i can still disarm the bombs. when i disarm all bombs i can't go thru the gate until i picked up the phone. is there a way to prevent this? i mean not only by scripting but by level designing? i mean this is totally right already, this is just if some player doesn't follow the commands.

i will now try to change this script into a "save the hostages" script on my own. am i right that the basis is the same and can be changed into this?
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Aug 2015 22:28 Edited at: 30th Aug 2015 22:29
for the name i did it like that so it's very easy to add multiple instances of this but with different number of bombs all over the map (not very useful in this case maybe but it's a nice habit im trying to get into - and im not 100% sure it would even work correctly as i didn't test it with this set up but that's the theory anyway, would probably have been easier to automatically count the bombs but there we go )

i would likely just change the code a bit so it's like this
phone script:


then if they ignore the e press and walk away they will automatically answer the phone.

and yes the principle is exactly the same for the hostages
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 30th Aug 2015 23:14
thank you, that's very useful! now i can make my first level map really playable. just finding keys is boring all the time. thank you a lot! i will try to change the script for saving hostages and tell you here what's happening
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 30th Aug 2015 23:46
happy! it's working! just a new question: how can i reduce the radius of the bomb ticking sound (i would like to hear the sound of the ticking a little later when i go to the bomb)?
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Attachments

Login to view attachments
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 31st Aug 2015 00:44
in the bomb script it should say something like
if GetPlayerDistance(e) < 500 then
LoopSound(e,0)
else

just change the 500 to a lower value
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 31st Aug 2015 20:51
yes, that worked! now the bomb starts ticking when i'm right in front of it, to make the puzzle a little more challenging the whole thing is working a 100% and is really really a great way to make the game more interesting. thank you!!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 1st Sep 2015 20:56
okay here's my new try fpr a script to save hostages.
i have changed the three scripts from "disarm the bombs" (see above) that were made by smallg and have changed them to my demands. it is working but it has one VERY BIG error i would like you to help me with.

first of all the trigger for the whole thing. the player gets a call and has to answer it. he gets told that he has to save 5 (just example) hostages. i kept everything the same as in the bomb script. it may not look nice but it's working:

geiseltrigger.lua


and i have the door that i just can open when i have saved the hostages
geiselendtuer.lua


and now my problem. i have this script based on the bombs that i want to use as "button" to save the hostages. i want to have it as a door. thereis a door. i open it and it opens and the hostages are free.

so this script...
(geiseltuer.lua)

that is a script for a bomb that must be disarmed with "E" i need to be changed to be a script for a working door. everything must stay the same just that when i press "E" the door should open. i want to put a character behind the door that runs out when i open the door. the hostage will be free then and over the door you can read "the hostages are free" (this is already working with the text)

i have no idea how to do this. i wanted to copy the script of a regular door into the script but i don't know where to put it. i had some crashed due to my limited knowledge so it would be nice if you could help me.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 4th Sep 2015 14:49
hey dear people of the GG, i would REALLY be happy if some nice person could help me complete this door script in my post above so i can complete my map / game. thank you in advance, i'm really desperate because i have tried so many times to get this door thing running and everytime i caused GG crahses because i did it all wrong. how can i add a working door script into the bomb script ("Geiseltuer.lua"). i have the door script and the bomb script but i can't blend them together into one script.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Sep 2015 15:44 Edited at: 4th Sep 2015 18:01
not sure if you wanted the door itself to be the button or not so i just used the door... hope that's ok

replaced the bombs_disarmed variable with a hostages_saved variable so there's no confusion from the previous quest

1. set the name of the zone to the total number of hostages - give it geiseltrigger.lua
2. place a door at the exit/entrance to each room and name it however many hostages are inside (if the hostages aren't responding it's because they are starting too far from the door so move them closer) - give it geiseltuer.lua
3. finally place some hostages inside the room (to match the number/name set on the door) - give them geisel.lua


edit, forgot to turn off collision for the door
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 4th Sep 2015 17:28
oh that's a completely new approach
i wanted that the door is opened and this is the same as if i would disarm the bomb. the door is open and the hostages can walk out. thank you smallg, i will take a look at these new scripts and tell you. i'm not really sure how to place this but i will take very close look. happy you helped me you are right the old names would confuse me later
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Sep 2015 17:32
ah sorry you still have the main (final) gate too but i didn't change that so you can just use your script for that - my door is for the rooms holding the hostages
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 4th Sep 2015 19:46
Quote: "1. set the name of the zone to the total number of hostages - give it geiseltrigger.lua"

okay. i put up a trigger zone and did as you told me. i named it "5".

Quote: "2. place a door at the exit/entrance to each room and name it however many hostages are inside - give it geiseltuer.lua"

i put 2 houses on the map. they both got a door with "geiseltuer.lua" and i named the left door "2" and the right one "3".

Quote: "3. finally place some hostages inside the room (to match the number/name set on the door) - give them geisel.lua"

in the left house i put 2 uzi girls and 3 in the right house and they all were with "geisel.lua"

Quote: "ah sorry you still have the main (final) gate too but i didn't change that so you can just use your script for that - my door is for the rooms holding the hostages"

the final door i used "geiselendtuer.lua" for it.

Quote: "(if the hostages aren't responding it's because they are starting too far from the door so move them closer) "

i put the hostages right behind the door but they do nothing at all.

i see in the script that when i activate the part in the end i can make the hostages disappear when they walk away, that is great! i wanted to ask this but it's already answered.

i get an error screen when i start (see in the attachments) BUT it works when i play.
the telephone rings, i can save the hostages and the thing with the final door is working as well. so i think it's working great and is just how i wanted it.

so this leaves me with two questions: 1: can you help me with the screenshot? 2: how would you suggest me to make the hostages run away when i open the door? waypoints?

thank you very much, this is going to work very soon, i guess!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Attachments

Login to view attachments
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 4th Sep 2015 22:10
the hostages don't care about waypoints. although i got it like this in the screenshot the hostages don't react when i open the door. does this come from the error code i get?

another question: when i walk towards the door and there come "Press E to free hostages" OR "The hostages are free" the text is at the bottom of the door. where can i change the height of the displayed text?
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Attachments

Login to view attachments
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Sep 2015 22:10 Edited at: 4th Sep 2015 22:13
ah sorry it's because i have my own function included to get the distance between 2 objects (not the player)
you just need to add this code to the very bottom of the hostage script (after the very last end)


they will already run out the door, its based on a certain distance though so they will stop after a while (which is why i left the ability to make them vanish) but if you're happy to you can easily adjust the coordinates to make them run wherever you wish.

for the text i didnt change your prompts so that's the same, if you want you will need to change PromptLocal with Prompt or Text calls.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 4th Sep 2015 23:32 Edited at: 4th Sep 2015 23:56
okay, i changed it and added the lines. now it starts without an error message but now when i open the door the free the first hostages i get this one:

EDIT: feels like this only happens when i use characters using custom faces. when i open the door with the regular characters first and THEN the door with the custom faced dudes it works. when i open the door with the customized faces FIRST i get this error. can this be the reason?

EDIT2: no that's not the reason. when i take the right door first it always works on both doors and when i take the left door first i get the error screen. i just checked the left door, i didn't find a difference to the right door?!


EDIT3: i copied the characters from the right house to the left house and deleted the old ones, now it works. obviously it seemed like this script doesn't work on all characters made by the character creator.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Attachments

Login to view attachments
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 5th Sep 2015 02:48
i put all the scripts into my map (before that i was running testgames on a blank map to try if it works) and i have some problems. the text "XY hostages left" disappears and the hostages don't walk out of the building. would a video help?
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 5th Sep 2015 15:06
firstly you need to set the phone entity as always active.

the hostages wont move if the script isn't being loaded, there are 2 issues, #1 is that you aren't starting far enough away before you rescue the first hostages so it's not storing the location for them to run to - hence the error and why it works when you go to the other door first.
i have reworked it for you so that it'll just store the location as soon as you're in range of the script - if your starting location is a "safe" spot it might be worth turning them always active too.
#2 is that they are too close to the door and it's not giving them a clear path to run with, spread them out inside the room a bit more and it should fix the problem

i have updated the door prompt to a normal one too

everything is working fine for me so hopefully these few tweaks will solve everything for you too
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-12-22 06:53:08
Your offset time is: 2024-12-22 06:53:08