Results 1 to 10 of 22

Thread: Triple Mortar

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #22
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Well, as we all seemingly agree that it is quite far-fetched OP made these scripts, lets discuss them

    Code:
    GetTargetedPos()
    {
             startOrigin = self getEye();
             forward = anglesToForward(self getplayerangles());
              forward= maps\mp\_utility::vectorScale(forward, 100000);
             endOrigin = startOrigin + forward;    
             trace = bulletTrace(startOrigin, endOrigin, false, self);
             if(trace["fraction"] == 1.0 || trace["surfacetype"] == "default")
                    endOrigin = trace["position"];
             else if(trace["fraction"] < 1)
                    endOrigin = trace["position"];
    
             //iprintln(endOrigin);
         return endOrigin;
    }
    What is that last if doing there? Really?

    Code:
    PlaySoundAtLocation(sound, location, iTime)
    {
        org = spawn("script_model", location);
        wait 0.05;
        org show();
        org playSound(sound);
        wait iTime;
        org delete();
    
        return;
    }
    No need to
    1) spawn a script_model, a script_origin suffices
    2) wait before playing a sound
    3) show for playing a sound
    4) wait before deleting.

    Code:
    			meleepoint=spawn("script_origin",trace["position"]);
    			meleepoint playsound(level.meleesound);
    			meleepoint delete();
    Works fine in the cod4mod.

    The rest of the script feels awefully coded (can easily be wrapped into a loop) and contains unnecessary waits.

    Very linear, obviously copy-pasted scripting.
    Last edited by IzNoGoD; 29th August 2013 at 18:43.

Posting Permissions

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