[FREE] Search Object and Search Object Delayed - Script/Behavior
UPDATE : V1.2 UPDATE : V1.2 UPDATE : V1.2 UPDATE : V1.2 UPDATE : V1.2 UPDATE : V1.2 UPDATE : V1.2 UPDATE : V1.2
I just fixed the Search Object Delayed script so it should work without the error now. Thanks to shivers for the heads up!!
I realized I forgot to add a few lines to the search object delayed script. It should only allow you to search 1 object at a time now. And I fixed the sound cut-off. It should stop the sound after the delay on sounds that are longer than the delay.
This. Is. GAMEGURU MAAAAAXXX (Kicks all other game dev software into pit)....
Today, I have for you, two search object scripts. Included are 2 different progress bar image sets and a 4 second search sound.
(1) Search Object :
* Instant spawning of loot items
* Can be set to "Empty" state to display "Empty" prompt after searched
* Can toggle to display "Found" prompt
* Customizable "Prompt"
* Customizable "Found" prompt
* Customizable "Empty" prompt
* Plays sound when searched
* Plays the animation in the objects Anim0 slot ( The animation will reset if there's more than 1 animation in the object.
* It's best to use an object with only 1 animation )
(2) Search Object Delayed :
* Delayed spawning of loot items ( up to 10 seconds )
* Displays progress bar on screen during delay ( up to 10 segments )
* Can be set to "Empty" state to display "Empty" prompt after searched
* Can toggle to display "Active" prompt
* Can toggle to display "Found" prompt
* Can toggle to display timer on screen
* Customizable "Prompt"
* Customizable "Active" prompt
* Customizable "Found" prompt
* Customizable "Empty" prompt
* Plays sound when searched
* Plays the animation in the objects Anim0 slot ( The animation will reset if there's more than 1 animation in the object.
* It's best to use an object with only 1 animation )
How to use :
(1) Add one of these scripts to the objects you want to be searched.
(2) In the loot item's "General tab", set it to "Physics on" or "Physics off" (not Static).
(3) In the loot item's "General tab", uncheck the "Show at start of level" box.
(4) Connect the object to the loot item with a logical connection.
(5) Set the sound to be payed when the object is searched ( the sound should be the same length as the delay, however, the sound will be stopped after the delay if the sound is longer )
* Now the loot item will spawn once the player searches the object.
* The object can only be searched once.
Other possible uses :
* The object can also use the logical connection to activate other things too (like a door opening after you search a container).
* The "Search Object Delayed" script could be used for other things besides searching a container (Like hacking a terminal or picking a locked door).
How to add custom progress bar images :
You need 1 more image than the number of seconds that the delay is set to. A 4 second delay will need 5 images ( 0-4 ), a 5 second delay need 6 images ( 0-5 ), etc.... The 0 image will be shown first when the object is clicked on, then each second that goes by, the next image will be shown ( 0 > 1 > 2 > 3 > 4 > 5, and so on, until the timer reaches the set number. ) The new images MUST use the same names as the current images. The current images are set up for a 4 second delay. There are 11 images total ( 0-10 ). All images past 4 are the same as 4. But ALL IMAGES ARE REQUIRED ( 0-10 ) even if you only use half of them. Otherwise the script will crash. That's why the extra images are the same as 4. They could be blank or anything else (they won't be seen). As long as they're in the folder. Just replace the images you need to and leave the rest the same.
Thanks For Looking!!
Keep Making Stuff You Enjoy.