Thread: [DFX] Wac limits? :( (DFX/JO)
View Single Post
  #13  
Old 05-20-2018, 05:06 PM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 229

Quote:
Originally Posted by stompem View Post
I was working on a better example for you when I noticed your script would display the text every second.

If past(1) then
Text ("test")
Endif


try the following script with a delay of 7 seconds between the text display.

Code:
if past(1) and elapse(7) then
text("test")
endif
or try this one with as many text outputs needed in a given scenario, I've put 3 here using your example variable 60.
Trigger the values 1 to 3 from elsewhere in the wac or med.

Code:
if not eq(v60,0) then
 if eq(v60,1) and never() then
  text("Test1")
  set(v60,0)
 else
 if eq(v60,2) and never() then
  text("Test2")
  set(v60,0)
 else
  if eq(v60,3) and never() then
  text("Test3")
  set(v60,0)
 end
 end
 end
endif
alternatively

Code:
if not eq(v60,0) then
 if eq(v60,1) and never() then
  text("Test1")
  set(v60,0)
 end
else
 if eq(v60,2) and never() then
  text("Test2")
  set(v60,0)
 end
else
  if eq(v60,3) and never() then
  text("Test3")
  set(v60,0)
  end
endif
PLEASE NOTE: I don't have access to the dfx and JOE mission editors at the moment
Thanks, but the example I used was not a script from the map, I was just making the point that if you create a script without "never()" and include an action ( ANY action), even one as simple as text, it will crash the game. but if you include no action, it runs fine. doesn't matter what trigger you're using, as soon as you include an action it crashes.

Here are some examples of scripts from my maps WAC...


Code:
;===v Player kills counter v===

;Pre mission med event sets v16 to 1.

if piskills(v16) then
	inc(V16)
	inc(V17)
endif

;===^ Player kills counter ^===

;Weather script
if Eq(v14, 1) and elapse(V59) and random(9) then
	dornd
		Flash()
		gain(60,80,230)
		next
		FarFlash()
		gain(10,25,100)
		next
		SS2SSN(Thunder, 10000)
	enddo
endif

;Battle difficulty levels
if eq(v14, 1) and lt(v17, 5) then //Teir 1
Rain(60)
Gsetaccuracy(8, 65)
Set(V59, 9) //Weather script: Frequency
	elseif eq(v14, 1) and ge(v17, 5) and lt(v17, 10) then //Teir 2
	Rain(60)
	Gsetaccuracy(8, 75)
	Set(V59, 8) //Weather script: Frequency
		elseif eq(v14, 1) and ge(v17, 10) and lt(v17, 15) and elapse(3) then //Teir 3
		ammoarea(Ammo_60mm_mortar, 8)
		Rain(75)
		Gsetaccuracy(8, 85)
		Set(V59, 7) //Weather script: Frequency
			elseif eq(v14, 1) and ge(v17, 15) and elapse(1) then //Teir 4
			ammoarea(Ammo_60mm_mortar, 8)
			ammoarea(Ammo_60mm_mortar, 8)
			Rain(100)
			Gsetaccuracy(8, 100)
			Set(V59, 6) //Weather script: Frequency
			endif
		endif
	endif
endif
In this script, Reach 20 kill points to win (1 point per kill). Player will lose 3 points every time he dies. Level difficulty progresses through 4 levels of difficulty based on points. if you lose points, the difficulty will revert back as well.

Last edited by Oscarmike247; 05-20-2018 at 05:28 PM.
Reply With Quote