Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32

Thread: Timed Door

  1. #1
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post

    Timed Door

    Hello!

    I just need some help here. I'm making a timed door (a door that opens at a exact time, example when time hits 20 mins left, the door will open automatic.) I have no idea how to make it, but i was hoping one of you guys might know how to. I was on a other webpage someone told me about, but absolutely everything was on polish, and i don't know any polish at all. If so, can someone make me a tutorial how to? With scripts if possible.

    Cheers!

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Just make a the easiest timer
    Code:
    t=0;
    while(1)
    {
        if(t==10)
        {
            doscriptwithdoor
        }
        t++;
        wait 60;
    }
    something like that

  3. #3
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    And in radiant, does i have to be a brushmodel there?

  4. #4
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Just make a normal door etc. And you place this in ur mp_mapname.gsc. It will be the same as a normal door script, but now with a timer

  5. #5
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    Ill try and i will report back

  6. #6
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    But i know something. Like i want like a double door, that opens and one part goes to the right, and the other part will go the the left. like this:
    Click image for larger version. 

Name:	door1.PNG 
Views:	62 
Size:	238.1 KB 
ID:	662Click image for larger version. 

Name:	door2.PNG 
Views:	63 
Size:	202.4 KB 
ID:	663

  7. #7
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    All i problaby need now is something like this:
    main()
    {
    something = getEnt("something", "targetname");

    angle = 90; // 4 times = one full round
    seconds = 1;

    while (1)
    {
    for (i=0; i<4; i++)
    {
    iprintlnbold("rotateYaw " + i); // 0,1,2,3 = 4
    something rotateYaw(angle, seconds);
    something waittill("rotatedone");
    }
    From http://killtube.org/showthread.php?3...ng-brushmodels

    Just that it takes 10 mins before it starts opening. and it rotates just 90 degrees and stops

  8. #8
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    116
    Thanks
    93
    Thanked 69 Times in 35 Posts
    Make 2 brushes that will be the doors you want to open.


    Make 2 brushes with 'origin' tool texture that will be the ''axis'' where the door will rotate on.

    Attachment 664

    Make each door script_brushmodel (with its origin brush too), like this:

    Attachment 665

    Attachment 666

    Now copy this script (change values if needed)

    PHP Code:
    main()
    {
        
    door1getent("lol1","targetname");
        
    door2getent("lol2","targetname");
        
    t=0;
        
        while(
    1)
        {
            if(
    t==10)
            {
                
    door1 rotateyaw(90,2);
                
    door2 rotateyaw(-90,2);
                
    door2 waittill("rotatedone");
            }
            
    t++;
            
    wait 60;
        }

    Last edited by pollo; 6th March 2014 at 20:22.

  9. The Following 2 Users Say Thank You to pollo For This Useful Post:

    ORDI (6th March 2014),wannabe (7th March 2014)

  10. #9
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    I cant see the pictures, but i get what you mean.
    In "n" Entity

    Key: targetname
    Value: door1/door2

    Is that right?
    Last edited by wannabe; 7th March 2014 at 14:09.

  11. #10
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    There is a error with the script. It says like:
    door1 rotateyaw(90,2);
    door2 rotateyaw(-90,2);
    door2 waittill("rotatedone");
    } < < < < <
    t++;
    wait 60;
    }
    }
    Watch arrows "<" hmm, i dont understand it, i dont see what the problem with } is ^^

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •