Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Lasers (SCRIPT)

  1. #1
    Private
    Join Date
    Jan 2013
    Posts
    15
    Thanks
    3
    Thanked 4 Times in 3 Posts

    Lasers (SCRIPT)

    Hi,

    Do you know any map with moving lasers which are killing people? Or maybe u now script than it would be nice if you will share of it, coz i need it to my map
    Last edited by BaX; 4th March 2013 at 10:00.

  2. #2
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Just make an laser texture and put an trigger to it > done

    Moving lasers = just move the lasers itself, for the trigger i think its trigger linkTo(laser.origin);
    No ... No ... this is not possible .......

  3. The Following User Says Thank You to Earliboy For This Useful Post:

    kung foo man (4th March 2013)

  4. #3
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    116
    Thanks
    93
    Thanked 69 Times in 35 Posts
    Do this:

    Make triggers -> hurt over all the lasers you have. Once made them , select all and give them these values (important: select all of them in one time, not one by one):

    key: targetname
    value: trig_dmg

    key: dmg
    value: <damage> (ammount of damage. values over 100 = instant death)

    Now select the lasers you made, script -> brushmodel and give them these values

    key: targetname
    value: lasers

    In the script:

    PHP Code:
    main()
    {
    thread lasers();
    }

    lasers()
    {
    lasers getent("lasers","targetname");
    trig_damage getent("trig_dmg","targetname");
        
    trig_damage enablelinkto();
        
    trig_damage linkto(lasers); // linking the damage trigger to the lasers
        
        
    while(1)
        {
        
    lasers moveto((x,y,z),time,accel time,decel time);
        
    lasers waittill("movedone");
        
    lasers moveto((x,y,z),time,accel time,decel time);
        
    lasers waittill("movedone");
        }

    Last edited by pollo; 4th March 2013 at 18:33.

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

    BaX (6th March 2013),kung foo man (5th March 2013)

  6. #4
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    You can use trigger_multiple too. You will need to script the damage, but you can disable the damage when you want and hide the brushmodel.

    Also you need to add this to the script before the loop starts:
    PHP Code:
    lasers notsolid(); 
    Edit: Just to be clear, you need to use enableLinkTo() before you can link triggers.
    Last edited by Mitch; 4th March 2013 at 18:42.

  7. The Following User Says Thank You to Mitch For This Useful Post:

    kung foo man (5th March 2013)

  8. #5
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    enableLinkTo() is not needed in COD2, only in COD4

  9. #6
    Private
    Join Date
    Nov 2012
    Posts
    15
    Thanks
    3
    Thanked 18 Times in 11 Posts
    Quote Originally Posted by Ni3ls View Post
    enableLinkTo() is not needed in COD2, only in COD4

    Some Triggers need, damage trigger for Example

  10. The Following User Says Thank You to KillerBoB For This Useful Post:

    Ni3ls (5th March 2013)

  11. #7
    Private
    Join Date
    Mar 2013
    Posts
    12
    Thanks
    2
    Thanked 6 Times in 5 Posts
    Hey, combined lasers here


    PHP Code:
    thread lasers(); 
    PHP Code:
    lasers()
    {
    laser_1 getent("laser_1","targetname");
    laser_hurt_1 getent("laser_hurt_1","targetname");
    laser_2 getent("laser_2","targetname");
    laser_hurt_2 getent("laser_hurt_2","targetname");
    laser_3 getent("laser_3","targetname");
    laser_hurt_3 getent("laser_hurt_3","targetname");
    laser_4 getent("laser_4","targetname");
    laser_hurt_4 getent("laser_hurt_4","targetname");
    laser_5 getent("laser_5","targetname");
    laser_hurt_5 getent("laser_hurt_5","targetname");
    laser_6 getent("laser_6","targetname");
    laser_hurt_6 getent("laser_hurt_6","targetname");
    laser_7 getent("laser_7","targetname");
    laser_hurt_7 getent("laser_hurt_7","targetname");
    laser_hurt_1 linkto(laser_1);
    laser_hurt_2 linkto(laser_2);
    laser_hurt_3 linkto(laser_3);
    laser_hurt_4 linkto(laser_4);
    laser_hurt_5 linkto(laser_5);
    laser_hurt_6 linkto(laser_6);
    laser_hurt_7 linkto(laser_7);

    while(
    1)

    {
    laser_1 movey(200,0.7);
    laser_2 movey(100,0.7);
    laser_3 movey(-100,0.7);
    laser_4 movex(-150,0.7);
    laser_5 movex(150,0.7);
    laser_6 rotateyaw(90,0.7);
    laser_7 rotateyaw(-90,0.7);
    wait 1;
    laser_1 movey(-200,0.7);
    laser_2 movey(-100,0.7);
    laser_3 movey(100,0.7);
    laser_4 movex(150,0.7);
    laser_5 movex(-150,0.7);
    laser_6 rotateyaw(-90,0.7);
    laser_7 rotateyaw(90,0.7);
    wait 1;
    }


  12. The Following 2 Users Say Thank You to kat_ For This Useful Post:

    BaX (6th March 2013),kung foo man (6th March 2013)

  13. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    If there is anything solid about the lasers, your movex and movey will probably fuck up their movements.

    To ensure proper movements, always use moveto()

  14. #9
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Whats wrong with movex()?
    timescale 0.01

  15. #10
    Private
    Join Date
    Jan 2013
    Posts
    15
    Thanks
    3
    Thanked 4 Times in 3 Posts
    I made something like this :

    PHP Code:
    trap1()
    {
        
    kosa getent("kosa_1""targetname");
        
    kosa_kill getent("kosa_2""targetname");
        
    kosa_kill enablelinkto();
        
    kosa_kill linkto(kosa);
        {
            
    kosa movex(82,5,2);
            
    wait (0.5);
            
    kosa movex(-82,5,2);
            
    wait (0.5);
        }

    And it gives me that error:

    Click image for larger version. 

Name:	error.png 
Views:	51 
Size:	298.5 KB 
ID:	189
    Last edited by BaX; 6th March 2013 at 11:29.

Posting Permissions

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