Frontpage Forums MAPPING HANGOUT MAPPING NICE-TO-KNOWS PLOOP – correct syntax to keep lag to a minimum
This topic has 1 reply, 2 voices, and was last updated 4 years, 6 months ago by Captain.
Viewing 2 posts - 1 through 2 (of 2 total)
    • Inactive
      February 23, 2018 at 13:35 #2480

      I see a lot of very bad use of PLOOP. I will give an example from ‘SG Rainbow in Vegas 3’ to show how you should and should not use PLOOP.

      PLOOP (PlayerLOOP) will CYCLE through ALL players EVERY second to check if the conditions for the trigger IN the PLOOP are met.

       

      Proper syntax for PLOOP:

      if TRIGGER and (optional) CONDITIONS then

      PLOOP

      if trigger and (optional) conditions then

      actions

      endif

      END

      endif

       

      Bad use of PLOOP:

      SG RAINBOW IN VEGAS 3 has close to 50 PLOOPS – all without triggers!!! As an inevitable result it generates a lot of lag despite low VB and texture memory.

      Example from RAINBOW IN VEGAS 3:

      PLOOP
      if never() and ssnlosssn(1738,player,8) then inc(v2)
      endif
      END

      PLOOP
      if never() and ssnlosssn(1739,player,8) then inc(v2)
      endif
      END

      PLOOP
      if never() and ssnlosssn(1740,player,8) then inc(v2)
      endif
      END

      PLOOP
      if never() and ssnlosssn(1741,player,8) then inc(v2)
      endif
      END

      Worst part is when you check what variable 2 does in the script. It only triggers the following and the incremental (v2) is total B.S.:

      if never() and gt(v2,0) then
      ssnwave(1743,”gdtv002d.wav”,100)
      endif
      if chain(5) then
      ssnatt(1738,50)
      ssnatt(1739,50)
      ssnatt(1740,50)
      ssnatt(1741,50)
      endif

       

      Proper use of PLOOP:

      if eq(v2,0) then

      PLOOP
      if ssnlosssn(1738,player,8) or ssnlosssn(1739,player,8) or ssnlosssn(1740,player,8) or ssnlosssn(1741,player,8) and NEVER then

      SET(v2,1)

      endif
      END

      endif

      if eq(v2,1) ENTER
      ssnwave(1743,”gdtv002d.wav”,100)
      endif
      if chain(5) then
      ssnatt(1738,50)
      ssnatt(1739,50)
      ssnatt(1740,50)
      ssnatt(1741,50)
      endif

      This way the PLOOP (reduced to ONE command instead of four separate ones) in the script will only fire as long as var2 is false. As soon as it equates to true, the PLOOP triggered by var2 will stop firing because it’s no longer needed.

    • Captain Keymaster
      March 1, 2018 at 19:16 #2486

      Thanks for sharing.
      I’ve also noticed a bit of lag on one of the halflife maps  – I thought it might had to do with my machine but it could very well be that as well.
      Great info to know for map makers 🙂

      ________________________
      Captain
      - Website Administrator

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.

Latest 10 Maps

AW2 – The Cage map series

AW2 – Wild Thing

AW2 – Operation Razorblade

AW2 – Nosebleed

AW2 – Shoot ‘Em Up Series

AW2 – Cry Havoc

AW2 – Angus : White Coast Part 1

AW2 – And Then Came The Morning

AW2 – A-7 BOHICA

AW2 – A Walk To The Devil

Recently Active Members

Profile picture of Walker*|*
Profile picture of Coopwarriors
Profile picture of -ToF-Oldie
Profile picture of BillySollocks
Profile picture of Gladiator
Profile picture of Captain
Profile picture of Red Dog
Profile picture of MonkTuk
Profile picture of Disco_Pete
Profile picture of Andrey_Berg
Profile picture of Ennio PG
Profile picture of Delta_Rat
Profile picture of korzekwa
Profile picture of ViperOps
Profile picture of Pvt.Herman

Log In

Username:

Password:


Lost password? | Register