Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 16 Vote(s) - 4.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripts Recollection
DIGI Byte Offline
Senior Member

Posts: 376
Threads: 20
Joined: Dec 2010
Reputation: 1
#37
RE: Scripts Recollection

Now that I'm more awake, and well rested I can think better, the idea of my previous script is ok, but for what I was using it for, there was a simpler solution and that I could have more control over

The problem with sanity activated entities (when your sanity is low enough they spawn) is you have to be facing away from it before it will spawn

I wanted it to spawn in front of me

This script is activated on start by a simple timer that runs the reset function in the events, which loops back to the start, and starts my timed event

Timed Events: activate/fade entities & chaining multiple activate/fade events together and looping them back

What this script does in steps;
on start, create timer called auto_start_scare to run the void script initial_scare_delay after 5 seconds
// This runs when the map first starts
    void OnStart()
    {     //start "sanity scare" - comment out to disable!!!
        AddTimer("auto_start_scare", 5, "initial_scare_delay");
    }

This is the Intro to the script, it's where you will setup the initial start
(NOT to be included into void OnStart() )
    void initial_scare_delay(string &in asTimer)
    {
        int init_loop_delay = RandFloat(2.0f, 5.0f); // Initial delay before looping starts
        AddTimer("initial_scare_timer", init_loop_delay, "start_scare");
    }

activate (fade in) first object, create random number for timer to run next script, This can be repeated several times making quiet an advanced scene, but simple is better Cool
    void start_scare(string &in asTimer)
    {
        SetPropActiveAndFade ("ghost_chair", true, 0.2f);//chair activation
        int ghost_spawn_delay = RandFloat(15.0f, 45.0f);
        AddTimer("ghost_spawn_timer", ghost_spawn_delay, "spawn_ghost");
    }

this one fades out the entity and loops back to the start
    void reset_scare(string &in asTimer)
    {
        //de-activate all and restart scare
        SetPropActiveAndFade("ghost_man", false, 0.1f);
        SetPropActiveAndFade("ghost_chair", false, 0.2f);
        int loop_delay = RandFloat(2.0f, 5.0f);
        AddTimer("reset_scare_timer", loop_delay, "start_scare");
    }
01-05-2011, 06:02 AM
Find


Messages In This Thread
Scripts Recollection - by Arvaga - 10-20-2010, 02:57 AM
RE: Scripts Recollection - by mastersmith98 - 10-20-2010, 05:59 AM
RE: Scripts Recollection - by Kyle - 10-20-2010, 12:01 PM
RE: Scripts Recollection - by Vincent - 10-20-2010, 01:05 PM
RE: Scripts Recollection - by Frontcannon - 10-20-2010, 02:20 PM
RE: Scripts Recollection - by mrscoomich - 03-18-2012, 05:58 PM
RE: Scripts Recollection - by mastersmith98 - 10-20-2010, 10:18 PM
RE: Scripts Recollection - by Arvaga - 10-20-2010, 11:03 PM
RE: Scripts Recollection - by Alex7754 - 10-20-2010, 11:54 PM
RE: Scripts Recollection - by Frontcannon - 10-21-2010, 01:35 AM
RE: Scripts Recollection - by The worst submarine - 10-21-2010, 02:54 AM
RE: Scripts Recollection - by mastersmith98 - 10-21-2010, 03:27 AM
RE: Scripts Recollection - by anzki - 10-21-2010, 09:23 AM
RE: Scripts Recollection - by house - 10-22-2010, 07:31 PM
RE: Scripts Recollection - by anzki - 10-23-2010, 11:07 AM
RE: Scripts Recollection - by anzki - 10-24-2010, 10:13 AM
RE: Scripts Recollection - by Everlone - 10-25-2010, 03:51 PM
RE: Scripts Recollection - by Frontcannon - 10-25-2010, 04:30 PM
RE: Scripts Recollection - by Everlone - 10-25-2010, 04:35 PM
RE: Scripts Recollection - by Frontcannon - 10-25-2010, 05:07 PM
RE: Scripts Recollection - by Everlone - 10-25-2010, 05:11 PM
RE: Scripts Recollection - by Frontcannon - 10-25-2010, 05:37 PM
RE: Scripts Recollection - by Everlone - 10-25-2010, 05:48 PM
RE: Scripts Recollection - by zlandael - 10-27-2010, 01:07 AM
RE: Scripts Recollection - by mastersmith98 - 10-27-2010, 01:55 AM
RE: Scripts Recollection - by anzki - 10-27-2010, 02:32 PM
RE: Scripts Recollection - by Arvaga - 11-11-2010, 05:29 PM
RE: Scripts Recollection - by Frontcannon - 11-11-2010, 06:05 PM
RE: Scripts Recollection - by Equil - 01-03-2011, 03:33 PM
RE: Scripts Recollection - by Frontcannon - 01-03-2011, 04:20 PM
RE: Scripts Recollection - by Equil - 01-03-2011, 04:25 PM
RE: Scripts Recollection - by Frontcannon - 01-03-2011, 04:36 PM
RE: Scripts Recollection - by Equil - 01-03-2011, 04:45 PM
RE: Scripts Recollection - by DIGI Byte - 01-04-2011, 03:28 PM
RE: Scripts Recollection - by Frontcannon - 01-04-2011, 04:35 PM
RE: Scripts Recollection - by DIGI Byte - 01-04-2011, 04:58 PM
RE: Scripts Recollection - by DIGI Byte - 01-05-2011, 02:53 AM
RE: Scripts Recollection - by DIGI Byte - 01-05-2011, 06:02 AM
RE: Scripts Recollection - by Frontcannon - 01-05-2011, 04:29 PM
RE: Scripts Recollection - by DIGI Byte - 01-05-2011, 09:30 PM
RE: Scripts Recollection - by Tony32 - 01-10-2011, 11:04 PM
RE: Scripts Recollection - by house - 01-10-2011, 11:59 PM
RE: Scripts Recollection - by Tony32 - 01-11-2011, 02:37 PM
RE: Scripts Recollection - by Frontcannon - 01-13-2011, 05:09 PM
RE: Scripts Recollection - by Tony32 - 01-13-2011, 04:21 PM
RE: Scripts Recollection - by Seragath - 01-13-2011, 04:32 PM
RE: Scripts Recollection - by Akumasama - 01-15-2011, 06:25 PM
RE: Scripts Recollection - by Frontcannon - 01-15-2011, 08:34 PM
RE: Scripts Recollection - by Akumasama - 01-18-2011, 05:51 PM
RE: Scripts Recollection - by Ianlis - 01-21-2011, 11:45 PM
RE: Scripts Recollection - by Akumasama - 01-22-2011, 01:20 AM
RE: Scripts Recollection - by Vradcly - 01-22-2011, 01:27 AM
RE: Scripts Recollection - by Ianlis - 01-22-2011, 05:42 AM
RE: Scripts Recollection - by Akumasama - 01-23-2011, 05:35 PM
RE: Scripts Recollection - by Tottel - 01-25-2011, 02:48 PM
RE: Scripts Recollection - by Beatlebattle - 01-27-2011, 07:04 PM
RE: Scripts Recollection - by Oscar House - 01-27-2011, 09:05 PM
RE: Scripts Recollection - by Beatlebattle - 01-29-2011, 12:19 AM
RE: Scripts Recollection - by adamhun - 02-07-2011, 04:47 PM
RE: Scripts Recollection - by kozek - 02-22-2011, 10:27 AM
RE: Scripts Recollection - by Nye - 02-25-2011, 01:38 AM
RE: Scripts Recollection - by kozek - 03-01-2011, 07:12 PM
RE: Scripts Recollection - by Zinnkio - 02-26-2011, 04:42 PM
RE: Scripts Recollection - by Ongka - 02-26-2011, 05:28 PM
RE: Scripts Recollection - by Zinnkio - 02-26-2011, 05:49 PM
RE: Scripts Recollection - by nkmol - 02-26-2011, 07:18 PM
RE: Scripts Recollection - by Zinnkio - 02-26-2011, 09:55 PM
RE: Scripts Recollection - by nkmol - 03-01-2011, 11:31 PM
RE: Scripts Recollection - by kozek - 03-04-2011, 05:45 PM
RE: Scripts Recollection - by Pandemoneus - 03-04-2011, 05:47 PM
RE: Scripts Recollection - by TheGreatCthulhu - 03-04-2011, 11:01 PM
RE: Scripts Recollection - by Pandemoneus - 03-05-2011, 12:16 AM
RE: Scripts Recollection - by Raymond - 03-05-2011, 08:14 AM
RE: Scripts Recollection - by Pandemoneus - 03-05-2011, 05:38 PM
RE: Scripts Recollection - by Raymond - 03-06-2011, 02:49 AM
RE: Scripts Recollection - by CrushedRaiD - 03-07-2011, 10:07 AM
RE: Scripts Recollection - by wisecow - 04-17-2011, 08:05 PM
RE: Scripts Recollection - by wisecow - 04-18-2011, 04:31 PM
RE: Scripts Recollection - by nkmol - 04-18-2011, 05:42 PM
RE: Scripts Recollection - by teddan50 - 12-12-2011, 10:40 PM
RE: Scripts Recollection - by Jahffax - 04-23-2011, 07:05 AM
RE: Scripts Recollection - by Kyle - 04-23-2011, 10:48 PM
RE: Scripts Recollection - by Jahffax - 04-24-2011, 11:36 AM
RE: Scripts Recollection - by Exostalker - 04-29-2011, 02:38 PM
RE: Scripts Recollection - by ufando - 04-24-2011, 09:56 AM
RE: Scripts Recollection - by wisecow - 06-08-2011, 02:38 PM
RE: Scripts Recollection - by laser50 - 06-17-2011, 10:25 PM
RE: Scripts Recollection - by Tanshaydar - 06-17-2011, 10:28 PM
RE: Scripts Recollection - by laser50 - 06-17-2011, 10:34 PM
RE: Scripts Recollection - by Fireintex - 11-09-2011, 12:09 AM
RE: Scripts Recollection - by Kyle - 11-09-2011, 12:52 AM
RE: Scripts Recollection - by Fireintex - 11-09-2011, 12:55 AM
RE: Scripts Recollection - by Kyle - 11-09-2011, 02:00 AM
RE: Scripts Recollection - by jessehmusic - 12-23-2011, 03:04 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-12-2012, 05:26 PM
RE: Scripts Recollection - by Elven - 01-13-2012, 10:19 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-15-2012, 01:09 PM
RE: Scripts Recollection - by Loveridge - 01-19-2012, 08:21 PM
RE: Scripts Recollection - by flamez3 - 01-20-2012, 02:32 AM
RE: Scripts Recollection - by Khyrpa - 01-19-2012, 08:35 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-20-2012, 05:15 PM
RE: Scripts Recollection - by SilentStriker - 01-21-2012, 10:03 AM
RE: Scripts Recollection - by CorinthianMerchant - 01-21-2012, 02:29 PM
RE: Scripts Recollection - by SilentStriker - 01-21-2012, 03:20 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-21-2012, 03:23 PM
RE: Scripts Recollection - by SilentStriker - 01-21-2012, 03:43 PM
RE: Scripts Recollection - by CorinthianMerchant - 01-21-2012, 04:21 PM
RE: Scripts Recollection - by jillis - 01-23-2012, 08:36 AM
RE: Scripts Recollection - by flamez3 - 01-23-2012, 10:14 AM
RE: Scripts Recollection - by jillis - 01-23-2012, 04:28 PM
RE: Scripts Recollection - by flamez3 - 01-24-2012, 03:27 AM
RE: Scripts Recollection - by jillis - 01-24-2012, 07:41 AM
RE: Scripts Recollection - by Stepper321 - 03-19-2012, 05:22 PM
RE: Scripts Recollection - by mrscoomich - 03-21-2012, 12:04 AM
RE: Scripts Recollection - by flamez3 - 03-21-2012, 12:47 PM
RE: Scripts Recollection - by mrscoomich - 03-25-2012, 01:41 AM



Users browsing this thread: 1 Guest(s)