Go Back   Novahq.net Forum > Games > Delta Force

Delta Force Anything to do with the Delta Force series of games, DF1, DF2, LW, TFD, BHD, DFX, AF etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-10-2012, 01:52 PM
MERMITE is offline MERMITE
Registered User

Join Date: May 2006
Posts: 736

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"
Reply With Quote
  #2  
Old 05-10-2018, 06:59 AM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 137

Why is ploop necessary though? The command without ploop would work just the same.

if ssnnearssn(1234,player,3) then
ssnhp(player,150)
endif
Reply With Quote
  #3  
Old 05-10-2018, 07:03 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

Quote:
Originally Posted by Oscarmike247 View Post
Why is ploop necessary though? The command without ploop would work just the same.

if ssnnearssn(1234,player,3) then
ssnhp(player,150)
endif
What if you had more than one player?
Reply With Quote
  #4  
Old 05-11-2018, 08:09 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

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
Reply With Quote
  #5  
Old 05-12-2018, 12:18 PM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 137

Quote:
Originally Posted by stompem View Post
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
Make more sense. Thanks Stomp.

What are some examples of P variables?
Reply With Quote
  #6  
Old 05-13-2018, 01:05 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

There may be more...Note - experimentation is the order of the day here...

onptick
pconsol
ptext
Pisvar
PisKills
psetvar
pisteam
ploop
Reply With Quote
  #7  
Old 05-13-2018, 01:45 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

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
Reply With Quote
  #8  
Old 05-13-2018, 01:51 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:32 AM.




Powered by vBulletin®