Frontpage Forums MAPPING HANGOUT MAPPING NICE-TO-KNOWS Best WAC ever: player ID's and how to avoid unnecessary PLOOPs
This topic has 0 replies, 1 voice, and was last updated 2 years, 11 months ago by Anonymous.
Viewing 1 post (of 1 total)
    • Inactive
      December 16, 2018 at 10:58 #2617

      Source: http://dfreload.com/forum/viewthread.php?tid=1578

      As I explained in another thread, extensive use of PLOOP, especially without triggers, is a major source for lag. Gamers hate lag!

      My example below works with NILE. You won’t need to put AI in sequential order. Other editors not so, please follow Ozferal’s instructions to set up your AI. If you are not comfortable with writing your own wac from scratch this topic is not for you!!!

      Step one:

      First off, the code in the source is not very elegant. Let’s start with refactoring. You’ll only need to retrieve your ID once, not infinitely!

      if never then
      v250 = 0
      endif

      if v250 = false then
      PLOOP
      if ssndead player then
      v250 = player
      endif
      END
      endif
      if ssndead v250 ENTER
      text# “Player has died”,v250  //Here is the value for your player variable, write it down or memorize!
      endif

      Step two:

      Now that you have the value of your player variable you will no longer need the code above, it was only for retrieving your ID and serves no purpose in your mission at all. Delete from your wac file!

      Please do mind I use the values from one of my scripts! Each script will return a value that corresponds with the number of AI in YOUR map, do not copy and paste but execute the code above for each mission! Only if your map is made with NILE and has 152 AI you will get the same value.

      if never then
      v250 = 152  //This is the value generated by the script above
      v251 = 153
      etc.
      endif

      Now you can use v250 as ssn for the first player, v251 for the second player etc.

      Some examples of many cool things you can do with such a variable:

      if v1,1 then
      GLOOP BATALLION1
      if ssnalive item and ssnalive v250 then
      ssnleadssn2ssn v250,item,xxxx //player v250 will lead the first batallion to ssn xxxx
      endif
      if ssnnearssn item,xxxx,25 then //here the batallion will stop following player and execute following order(s)
      {#actions} item //e.g. send them on a waypoint list to secure the area independent of the player’s actions
      endif
      END
      endif

      I have not tested this, I believe the entire batallion may commit suicide if the player dies on the way to ssn xxxx

      Handle with care!

      PS: I can recommend to use TWO machines to retrieve player ID’s for the first and second player! If you cannot test and verify this it’s better not to use these commands!

Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.

Latest 10 Maps

Hardmaps AW2 Mappack (12 maps by HmS Shadowman)

Escalation Mappack #2 (42 maps)

Escalation – Mappack (16 maps by oM)

AW2 – Heart Attack Airport

AW2 – L0C Deph-cation V3

AW2 – L0C Psycot

AW2 – L0C Port 2017

AW2 – L0C Lt Dogg

AW2 – Killtruder

AW2 – Green River

Recently Active Members

Profile picture of -ToF-Oldie
Profile picture of Captain
Profile picture of Andrey_Berg
Profile picture of Stinky
Profile picture of Shogun
Profile picture of Coopwarriors
Profile picture of Widow
Profile picture of TheWad
Profile picture of RR SNAKE UK
Profile picture of TO77
Profile picture of korzekwa
Profile picture of Noddynod443
Profile picture of Delta_Rat
Profile picture of Red Dog
Profile picture of chopperprop

Log In

Username:

Password:


Lost password? | Register