|
Delta Force Anything to do with the Delta Force series of games, DF1, DF2, LW, TFD, BHD, DFX, AF etc. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
PL00P ya G00P's (3)
Gloop I use very very rarely, but the Ploop is a whole different matter, this time 'THE MAGIC HAPPENS TO THE THE PLAYER"
PLOOP: The ploop is a procedure that will cause a looping sequence within the code. The syntax of a ploop will start with the keyword ploop and conclude with the keyword end. It is used in conjunction with the keyword player to either check a players status in a condition or to modify an attribute of a player in an action statement. When a ploop is reached any conditions and statements within the ploop will cycle through for each of the players in the game until all have been checked and/or acted upon, before the sequential continuation of the wac code. In other words, the wac codes linear progression through the code is broken as though a subroutine that must check each member of the group before returning back to the remainder of the wac codes linear sequence. Syntax: ploop if conditions containing player then actions containing player endif end Example: (a favourite) ploop if ssnnearssn(1234,player,3) then ssnhp(player,150) endif end If the ssn#1234 represented a medic, this code will check to see if any player is within 3 meters of the medic and if that condition is met, then that player would have his hit points set to 150 (which is full health). What the loop does is replace the actual internal number of the player and use the keyword player to hold that number as a variable would hold a number, then check the condition to see if that player fits the criteria of the condition, and if true the same internal number represented by player in the action part of the statement will cause any activity designated there to be applied to that player. This is very strong magic, note esp. the use of end and endif, like the old RND or doseq you gotta lock the sucker up with END. Don't be like pvt. Harry Potter and run around with his wand exposed all over the place, better to make a small separate map one each Pl00p or Gl00p, and experiment. "M" |
#2
|
||
|
Why is ploop necessary though? The command without ploop would work just the same.
if ssnnearssn(1234,player,3) then ssnhp(player,150) endif |
#3
|
||
|
What if you had more than one player?
|
#4
|
||
|
Looking into it without any reference to any particular scenario I've found you can probably break them up into 3 main categories of influence.
Loop - Local - load from mission wac (on mission load) corresponds to local vars V Gloop - Global - load from game wac (on game load) corresponds to global vars G Ploop - Player - load from server wac or game wac (on game load) corresponds to player vars P |
#5
|
|||
|
Quote:
What are some examples of P variables? |
#6
|
||
|
There may be more...Note - experimentation is the order of the day here...
onptick pconsol ptext Pisvar PisKills psetvar pisteam ploop |
#7
|
||
|
server.wac
Code:
ploop if onptick 10 then ptext "<cf8932>[GSP] Garden Shed Productions<-co>" end if piskills(1) and never then if pisteam(1) then text "First Kill - <cfc0000FF>Blue Team<-co>" else text "First Kill - <cfcFF0000>Red Team<-co>" end ptext "Congrats on the first kill of the game!' psetvar(2) end if piskills(1) and not pisvar(2) then psetvar(2) ptext "Congrats on your first kill!" if pisteam(1) then ptext "Take your Team to Victory!" else ptext "Take your Team to victory!" end end end |
#8
|
||
|
mission_name.wac
I posted an old script here but looking at it now I reckon it was in error. Will check things out and post another example later... Last edited by Guest001; 05-13-2018 at 02:23 PM. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|