Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Delta Force (https://novahq.net/forum/forumdisplay.php?f=101)
-   -   [DFX] Wac limits? :( (DFX/JO) (https://novahq.net/forum/showthread.php?t=48958)

Oscarmike247 05-16-2018 07:02 AM

Wac limits? :( (DFX/JO)
 
So i am experiencing sys error crashing the game and it seems to be linked to the WAC. Im not aware of any WAC limits, but this has me baffled.

What ive gathered so far, the problem seems to stem from the looping wac scripts and med events. My map requires many looping wac scripts (does not contain "never ()") to test the trigger conditions repeatedly throughout the game. my theory is that theres a limit to how many triggers and actions can be tested on a loop at once.

Heres some map specs and what i know so far...

Singleplayer
WAC size 37kb
1600+ WAC lines
160+ med events
700 decorations
Less than 30 AI

The problem:

1) If i add one more trigger or action to any looping WAC script (does not contain "never ()") then it will cause a sys error during map load.

2) It does not matter what type of trigger or action.

3) it does not crash if the action or trigger is added to a non looping script (containing "never ()").

4) adding new triggers or actions to looping med events causes the same error.

5) game crashes right before the map is completely loaded.


Has anyone heard of such an issue? Any ideas?

Guest001 05-17-2018 05:55 PM

WAC meltdown is usually caused by invalid objects in the map, incorrect values for variables, wac statements with incorrect wording (syntax).

Also as you can imagine one action can cancel out another action, this is especially so when looping commands are still running and other actions are called at the same instance.

Guest001 05-17-2018 06:19 PM

If you're not doing so already, try using variables to switch, I rely heavily on them to build huge wac files, in this example the wac is well over 1000 lines.

Code:

;Operation Twilight

//                                        ***VARS***
if never() then
        set(v8,0) // control
        set(v9,0) // Friendly Zodiac Crews (SET BELOW)
        set(v10,0) // Friendly Infils
        set(v11,0) // Friendly Zodiac (SET BELOW)
        set(v15,0) // Final Bombardment
        set(v16,0) // Final Bombardment
        set(v17,0) // Weather1
        set(v18,0) // Enemy Mass Attack (SET BELOW)
        set(v20,0) // HUD - Unit Assists (SET BELOW)
        set(v21,0) // HUD - Casualties (SET BELOW)
        set(v27,0) // Weather2
        set(v28,0) // Bombing
        set(v30,0) // Control
        set(v34,0) // Enemy group 34
        set(v35,0) // Enemy group 35 (SET BELOW)
        set(v36,0) // Enemy group 36
        set(v37,0) // Enemy group 37
        set(v37,0) // infil Enemy group 39
        set(v40,0) // Control infil effects
        set(v41,0) // Control infil flags
        set(v50,0) // HUD - Team Rating / clamp at 0 if <= 1 (SET BELOW)
        set(v51,0) // Tgts 5
        set(v52,0) // Tgts 12, 13, 14, 15, 16 (SET BELOW)
        set(v61,0) // Control
        set(v70,0) // ka52 (SET BELOW)
        set(v71,0) // BTR (SET BELOW)
        set(v80,0) // Group Casualties / respawning
        set(v81,0) // Group Casualties / respawning
        set(v82,0) // Group Casualties / respawning       
        set(v83,0) // Group Casualties / respawning       
        set(v84,0) // Group Casualties / respawning       
        set(v85,0) // Group Casualties / respawning
        set(v90,0) // Group Casualties / respawning
endif
//                                        ***INIT***
if past(1) and never() then
        fx2tgt (Effect_FxFire2mF,3)
        ssnhp(61,200) // first enemy
        hidessn(98) //  flag A
        hidessn(99) //  flag B
        hidessn(100) // flag C
        hidessn(101) // flag D
        hidessn(102) // flag E
        hidessn(103) // flag F
        hidessn(104) // flag G
        hidessn(2) // Group39 Start
        hidessn(3)
        hidessn(4)
        hidessn(37)
        hidessn(38) // Group39 End
        hidessn(49) // Group40 Zodiac Enemy Infil Start
        hidessn(50)
        hidessn(51)
        hidessn(52)
        hidessn(53)
        hidessn(54)
        hidessn(55)
        hidessn(56)
        hidessn(57)
        hidessn(58) // Group40 Zodiac Enemy Infil End
endif


Guest001 05-17-2018 06:37 PM

Here is a small section triggering events using the vars.
Note that actions for v18 are set in the MEd event editor.

Code:

// ***MassAttack***
if past(200) and eq(v9,6) and never() then
set(v18,1)
endif

// ***ShootersInTheHills***
//
if area(27) and lt(v50,0) and not eq(v34,2) or eq(v34,3) and never() then
        set(v34,1)
endif
if previous() and waveready() and never() then
        wave("ALPH554.wav")
        text("Shooters In The Hills!")
endif
//
if area(27) and eq(v50,0) and not eq(v34,1) or eq(v34,3) and never() then
        set(v34,2)
endif
if previous() and waveready() and never() then
        wave("ALPH554.wav")
        text("Shooters In The Hills!")
endif
//
if area(27) and gt(v50,0) and not eq(v34,1) or eq(v34,2) and never() then
        set(v34,3)
endif
if previous() and waveready() and never() then
        wave("ALPH554.wav")
        text("Shooters In The Hills!")
endif


Guest001 05-17-2018 06:58 PM

Now we get to always on events

Code:

// ***RANDOM***
if past(1) and elapse(12) and random(2) then
        set(v27,0) // weather on
        set(v28,1) // bombing off
endif
if past(14) and elapse(12) and random(2) then
        set(v27,1) // weather off
        set(v28,0) // bombing on
endif

if eq(v27,1) then
        if elapse(120) and random(2) then
                rain(40,20)
                overcast(40,20)
                set(v17,1)
        end
        if chain(60) and random(2) then
                rain(0,20)
                overcast(0,20)
                set(v17,0)
        end
endif

if eq(v28,1) then
if elapse(6) and random(16) and waveready() then
        wave("xpLgF4.wav")
        quake(14)
end
if chain(0) then
        lightning(50,5,5)
        flash()       
end
endif
if eq(v17,1) then
        if past(1) and elapse(4) and random(30) then
                lightning(100,30,30)
                flash()
        end
endif

// ***CHOOSE***
if area(15) and never() then
        if lt(v50,0) then
                set(v64,1)
                elseif eq(v50,0) then 
                        set(v64,2)
                        elseif gt(v50,0) then 
                                set(v64,3)
                        end
                end
        end
endif
// var 64 2 area 16
if area(16) and never() then
        if lt(v50,0) then
                set(v64,4)
                elseif eq(v50,0) then 
                        set(v64,5)
                        elseif gt(v50,0) then 
                                set(v64,6)
                        end
                end
        end
endif
// var 64 3 area 17
if area(17) and never() then
        if lt(v50,0) then
                set(v64,7)
                elseif eq(v50,0) then 
                        set(v64,8)
                        elseif gt(v50,0) then 
                                set(v64,9)
                        end
                end
        end
endif

// ***REACTIONS***
if ssnalive(96) then
        if ssnarea(96,18) or ssnnearssn(96,121,30) then
                ssncspd(96,4)
                ssnpspd(96,4)
                else
                ssncspd(96,36)
                ssnpspd(96,36)
                end
        end
endif
// EZodiac ssn27
if ssnalive(27) and eq(v18,1) then
        if ssnarea(27,14) then
                ssncspd(27,26)
                ssnpspd(27,16)
                else
                ssncspd(27,46)
                ssnpspd(27,36)
                end
        end
endif
// Ferryboat ssn33
if ssnalive(33) and eq(v18,1) then
        if ssnarea(33,25) or ssnarea(33,26) or ssnnearssn(33,29,30) then
                ssncspd(33,4)
                ssnpspd(33,4)
                else
                ssncspd(33,36)
                ssnpspd(33,36)
                end
        end
endif
// Eboat2 ssn29
if ssnalive(29) and eq(v18,1) then
        if ssnarea(29,14) then
                ssncspd(29,22)
                ssnpspd(29,12)
                else
                ssncspd(29,46)
                ssnpspd(29,36)
                end
        end
endif

// ***DIVERSION***
;sniper under dock
if ssnalive(72) and ssnwounded(72) then
        SSNtoWP(72,15,0)
endif
;first enemy
if ssnalive(61) and ssnwounded(61) then
        SSNtoWP(61,20,0)
endif


Oscarmike247 05-17-2018 08:01 PM

Quote:

Originally Posted by stompem (Post 389608)
If you're not doing so already, try using variables to switch, I rely heavily on them to build huge wac files, in this example the wac is well over 1000 lines.

Code:

;Operation Twilight

//                                        ***VARS***
if never() then
        set(v8,0) // control
        set(v9,0) // Friendly Zodiac Crews (SET BELOW)
        set(v10,0) // Friendly Infils
        set(v11,0) // Friendly Zodiac (SET BELOW)
        set(v15,0) // Final Bombardment
        set(v16,0) // Final Bombardment
        set(v17,0) // Weather1
        set(v18,0) // Enemy Mass Attack (SET BELOW)
        set(v20,0) // HUD - Unit Assists (SET BELOW)
        set(v21,0) // HUD - Casualties (SET BELOW)
        set(v27,0) // Weather2
        set(v28,0) // Bombing
        set(v30,0) // Control
        set(v34,0) // Enemy group 34
        set(v35,0) // Enemy group 35 (SET BELOW)
        set(v36,0) // Enemy group 36
        set(v37,0) // Enemy group 37
        set(v37,0) // infil Enemy group 39
        set(v40,0) // Control infil effects
        set(v41,0) // Control infil flags
        set(v50,0) // HUD - Team Rating / clamp at 0 if <= 1 (SET BELOW)
        set(v51,0) // Tgts 5
        set(v52,0) // Tgts 12, 13, 14, 15, 16 (SET BELOW)
        set(v61,0) // Control
        set(v70,0) // ka52 (SET BELOW)
        set(v71,0) // BTR (SET BELOW)
        set(v80,0) // Group Casualties / respawning
        set(v81,0) // Group Casualties / respawning
        set(v82,0) // Group Casualties / respawning       
        set(v83,0) // Group Casualties / respawning       
        set(v84,0) // Group Casualties / respawning       
        set(v85,0) // Group Casualties / respawning
        set(v90,0) // Group Casualties / respawning
endif
//                                        ***INIT***
if past(1) and never() then
        fx2tgt (Effect_FxFire2mF,3)
        ssnhp(61,200) // first enemy
        hidessn(98) //  flag A
        hidessn(99) //  flag B
        hidessn(100) // flag C
        hidessn(101) // flag D
        hidessn(102) // flag E
        hidessn(103) // flag F
        hidessn(104) // flag G
        hidessn(2) // Group39 Start
        hidessn(3)
        hidessn(4)
        hidessn(37)
        hidessn(38) // Group39 End
        hidessn(49) // Group40 Zodiac Enemy Infil Start
        hidessn(50)
        hidessn(51)
        hidessn(52)
        hidessn(53)
        hidessn(54)
        hidessn(55)
        hidessn(56)
        hidessn(57)
        hidessn(58) // Group40 Zodiac Enemy Infil End
endif


Thanks for the replies. Yes i use variables for a host of different triggers and switches.

Initially, i was thinking the same. There must be a conflict in some of the loops or something. I looked through everything and i don't see where a conflict could have occurred, but the map is very complex using several scripts, events, and variables. So it is hard to tell

If this was the case though, then why would the error occur no matter where I put a command, or what kind of command it is for that matter? It will only happen if you added something to a looping trigger.

Even if you added one more simple looping script like...

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

... the error would occur.


I have removed a few looping scripts that were necessary and it has fixed the issue for now. But i feel that it will return once i add more stuff to the WAC. :dontknow:

Oscarmike247 05-19-2018 08:14 AM

So, once again i have run into the error. (I knew it would happen again once i added a certain number of looping scripts)

Im trying to get to the bottom of this. I experimented and pasted my wac into a new blank map and it caused the same error. And again if i remove a looping script (doesnt matter which one) it will fix it.

This suggests that there is nothing in my maps events or objects causing the error. Its all in the WAC.

Guest001 05-20-2018 05:02 AM

Quote:

Originally Posted by Oscarmike247 (Post 389618)
So, once again i have run into the error. (I knew it would happen again once i added a certain number of looping scripts)

Im trying to get to the bottom of this. I experimented and pasted my wac into a new blank map and it caused the same error. And again if i remove a looping script (doesnt matter which one) it will fix it.

This suggests that there is nothing in my maps events or objects causing the error. Its all in the WAC.

That's hard to judge from here, especially with such limited data and no working example to go on, this problem has come up before and been overcome, so it may appear as you say but it could still be caused by script, med, windows etc.

Oscarmike247 05-20-2018 09:39 AM

Quote:

Originally Posted by stompem (Post 389620)
That's hard to judge from here, especially with such limited data and no working example to go on, this problem has come up before and been overcome, so it may appear as you say but it could still be caused by script, med, windows etc.

Well i seem to have singled out the problem to actions with looping scripts.

I added a new looped script with not action...

If eq(v60, 1) then
Endif


... the game runs fine.


But as soon as you add an action, even something as simple as text ("testing") it will crash. But if you remove 1 action from another looped script it will work again.

Guest001 05-20-2018 01:12 PM

Quote:

Originally Posted by Oscarmike247 (Post 389621)
Well i seem to have singled out the problem to actions with looping scripts.

I added a new looped script with not action...

If eq(v60, 1) then
Endif


... the game runs fine.


But as soon as you add an action, even something as simple as text ("testing") it will crash. But if you remove 1 action from another looped script it will work again.

Like I said before it may only look that way because other wacs in the past have failed in similar fashion with far fewer instructions in them than this one.

Also leaving out never() is not really looping in the strictest sense of the word, instructions in the same stream may be executing in the same instance, shorten your script and leave as many vars switched off until needed, use else, chain, link etc to exclude or reduce incidences of them queuing too long or firing whilst other variables are operating.

Guest001 05-20-2018 02:51 PM

Quote:

Originally Posted by Oscarmike247 (Post 389611)

Even if you added one more simple looping script like...

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

... the error would occur.

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

Guest001 05-20-2018 03:01 PM

Maybe even this may work?
Code:

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


Oscarmike247 05-20-2018 05:06 PM

Quote:

Originally Posted by stompem (Post 389625)
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.

Guest001 05-20-2018 09:36 PM

Ok

Oscarmike247 05-26-2018 06:56 AM

Reckon it has anything to do with using a 64 bit OS? Not sure why that would make a difference, but its just a thought.

Guest001 05-27-2018 06:20 AM

Quote:

Originally Posted by Oscarmike247 (Post 389659)
Reckon it has anything to do with using a 64 bit OS? Not sure why that would make a difference, but its just a thought.

It's a 32 bit program but based on the general understanding of things, I doubt it's anything relevant to this issue.

Guest001 05-28-2018 01:25 AM

Extrapolating on what you've put here...

Perhaps you could try this to circumvent v16 = 1 on init.




Code:

// v16 ;counter
// v17 ;helper

if piskills(v16) then
        add(v16, 1)
        if gt(v16, 1) then
                add(v17, 1)
        end
endif


Oscarmike247 05-28-2018 09:38 AM

Quote:

Originally Posted by stompem (Post 389665)
Extrapolating on what you've put here...

Perhaps you could try this to circumvent v16 = 1 on init.




Code:

// v16 ;counter
// v17 ;helper

if piskills(v16) then
        add(v16, 1)
        if gt(v16, 1) then
                add(v17, 1)
        end
endif


V16 should be the helper. V17 is the actual counter displayed to the player.


Im not where i can test this at the moment, but wouldnt v17 continue to climb as soon as v16 is gt 1? So if you get one kill, the counter (v17) would just keep increasing every second.

Guest001 05-28-2018 04:15 PM

Quote:

Originally Posted by Oscarmike247 (Post 389666)
V16 should be the helper. V17 is the actual counter displayed to the player.


Im not where i can test this at the moment, but wouldnt v17 continue to climb as soon as v16 is gt 1? So if you get one kill, the counter (v17) would just keep increasing every second.

No v17 won't keep counting, I think the reason is piskills is an action not a condition.

Also your difficulty script looks like it only counts upwards.

Try this to lower the difficulty one level below the current one on death.



Code:

if piskills(v16) then
        add(v16, 1)
        if gt(v16, 1) then
                add(v17, 1) ; helper display kills
                add(v19, 1) ; helper difficulty
        end
endif

if not ssnalive(10000) then
        if le(v18, 1) then
                set(v19, 0)
        end
        if eq(v18,2) then
                set(v19, 5)
        end
        if eq(v18,3) then
                set(v19, 10)
        end
else
        if eq(v14,1) and lt(v19, 5) then
                rain(60)
                gsetaccuracy 8,65
                set(v59, 9)
                set(v18, 0)
        end
        if eq(v14,1) and ge(v19, 5) and lt(v19, 10) then
                rain(60)
                gsetaccuracy 8,75
                set(v59, 8)
                set(v18, 1)
        end
        if eq(v14,1) and ge(v19, 10) and lt(v19, 15) and elapse(3) then
                rain(75)
                gsetaccuracy 8,85
                set(v59, 7)
                set(v18, 2)
                ammoarea(Ammo_60mm_mortar, 8)
        end
        if eq(v14,1) and ge(v19, 15) and elapse(1) then
                rain(100)
                gsetaccuracy 8,100
                set(v59, 6)
                set(v18, 3)
                ammoarea(Ammo_60mm_mortar, 8)
                ammoarea(Ammo_60mm_mortar, 8)
        end
end
endif


Guest001 05-28-2018 04:26 PM

Here's a simple alternative - I made this while back for another map but the var numbers shouldn't matter and you can drop it straight in just change the group and add weather etc...

For difficulty the ai just alternates between 2 standards.

Code:

;by stompem 2017
;Respawn AI if they kill themselves.
;if past(1) and gt(v223,0) and groupdead(0) then
;        GroupSpawn 0,1
;endif
// Inits
if never() then
        set(v223, 10) ; win target
endif
// Player
if piskills(v220) then
        add(v220, 1)
        add(v225, 1)
if gt(v220, 1) then
        add(v221, 1)
        sub(v223, 1)
end
if gt(v223,0) and groupdead(0) then
        GroupSpawn 0,1
end
endif
// Display
if not eq(v223,0) and elapse(7) then
        text# "Player Score",v221
        text# "Enemy Score",v222
        text# "Enemy Left",v223
endif
// AI
if not ssnalive(10000) then
        add(v224, 1)
        set(v225, 1)
if eq(v222, 10) and never() then
        win (0)
end
else
        set(v224, 0)
endif
if eq(v224, 1) then
        add(v222, 1)
endif
if lt(v225, 2) then
        accuracyspread = 10
        Gsetaccuracy 0,50,85
        GroupAtt 0,16
endif
if gt(v225, 1) then
        accuracyspread = 5
        Gsetaccuracy 0,100,100
        GroupAtt 0,320
endif
if never() and eq(v223, 0) then
        text "  GAME OVER"
        text# "Final Score",v221
        text# "Enemy Score",v222
endif
if chain(7) and never() then
        win (1)
endif


Oscarmike247 05-28-2018 05:25 PM

well see I want the level of difficulty to increase or decreased based on the players points in 5 point intervals. The player loses 3 points if he dies. The script I've got works fine for that.

if the player has 15 points and dies several times and drops back down to say 9 points, the difficulty will drop back down as well. points will not go below 0 (if V17 lt 0 then set V17, 0) and when the player reaches 20 points, the objective is won.

Guest001 05-28-2018 05:41 PM

Quote:

Originally Posted by Oscarmike247 (Post 389672)
well see I want the level of difficulty to increase or decreased based on the players points in 5 point intervals. The player loses 3 points if he dies. The script I've got works fine for that.

if the player has 15 points and dies several times and drops back down to say 9 points, the difficulty will drop back down as well. points will not go below 0 (if V17 lt 0 then set V17, 0) and when the player reaches 20 points, the objective is won.

So what if you killed 9 times?
What if the ai kills itself accidentally?

Oscarmike247 05-28-2018 05:53 PM

Quote:

Originally Posted by stompem (Post 389673)
So what if you killed 9 times?
What if the ai kills itself accidentally?


It doesnt matter how many times the player is killed. V17 (players points) will not go below zero.

If an ai kills itself or is killed by another means (like a mortar) it wont count as a player kill because v17 only increases if the player makes the kill.

Guest001 05-28-2018 06:08 PM

Note that vars can go below zero and looking back over this thread, you have left out crucial info making it difficult to know if you have accounted for this.

Your'e asking questions and my suggestions are based on the questions and bits and pieces.

The scripts I've posted work solidly, I posted them to aid you (and others) so I kindly suggest you look them over a little more closely and then if you see an issue, tell me how I they are wrong?

Also you said...

Quote:

V16 should be the helper. V17 is the actual counter displayed to the player.
IE won't the display to the player be altered by changing v17, or has the workaround for that been left out too?

Oscarmike247 05-28-2018 07:36 PM

Quote:

Originally Posted by stompem (Post 389675)
Note that vars can go below zero and looking back over this thread, you have left out crucial info making it difficult to know if you have accounted for this.

Your'e asking questions and my suggestions are based on the questions and bits and pieces.

The scripts I've posted work solidly, I posted them to aid you (and others) so I kindly suggest you look them over a little more closely and then if you see an issue, tell me how I they are wrong?

Also you said...



IE won't the display to the player be altered by changing v17, or has the workaround for that been left out too?

Sorry man, yes there are other scripts that account for the missing pieces. My scripts work fine, there was never anything wrong with them. I just posted them giving you examples of what was in my WAC.

Your examples are very helpful and i do learn from them, thank you...

As i said in my previous post, v17 will not go below zero via a script in the wac.

If lt(v17, 0) then
Set (v17, 0)
Endif

V17 is the actual points displayed to the player.

If eq (v14, 1) and ssnarea (10000, 9) then
Text("========")
Text#("kill points:", v17)
Text ("========")
Endif

V17 increases by 1 for every kill the player makes. It decreases by 3 for every time the player is killed.

Oscarmike247 05-28-2018 07:46 PM

Quote:

Originally Posted by stompem (Post 389670)
No v17 won't keep counting, I think the reason is piskills is an action not a condition.

Also your difficulty script looks like it only counts upwards.

Try this to lower the difficulty one level below the current one on death.

I just tried it and it works fine. it works just like my current script does. But help me out with understanding a few things. what advantages does this have over my script?

Also, I'm not sure that I understand your statement that piskills is an action. It's a condition not an action is it not? piskills is a condition that says if the player has killed X amount of enemies.

Guest001 05-28-2018 08:04 PM

Contradictions again my friend?

Aaaah well. Just trying give you any info that may or may not help you shorten your wac and also help prevent any possible oversights, as I said it's hard to answer you accurately when you are so cryptic about your answers to my answers.

I can go back over many of my own maps and now see (with extra info) that I could have shortened them further, or rather, made them more efficient.

It's all about Flow control.

Imagine that you're trying to stream it all down a narrow funnel neck.

BTW
Here's an example of a negative var for you.

It's a timer script that I shortened years ago.

Code:

if never() then
set(v60, -1)
set(v90, 10)
set(v100, 1)
endif

if not eq(v100, 1) then
dec(v100, 1)
else
set(v100, 60)
sub(v90, 1)
endif

if not eq(v60, 59) then
inc(v60, 1)
else
set(v60, 0)
add(v70, 1)
endif

if elapse(1) then
consol "Countdown"
consol# "Min Left",v90
consol# "Sec Left",v100
endif

if elapse(1) then
text "Time"
text# "Min Past",v70
text# "Sec Past",v60
endif


Guest001 05-28-2018 08:16 PM

Can you see any difference between these timer scripts compared to traditional methods?

Do you think they may be more efficient?

Notice I am using exclusion rather than inclusion.

Oscarmike247 05-28-2018 09:02 PM

Quote:

Originally Posted by stompem (Post 389678)
Contradictions again my friend?

Aaaah well. Just trying give you any info that may or may not help you shorten your wac and also help prevent any possible oversights, as I said it's hard to answer you accurately when you are so cryptic about your answers to my answers.

I can go back over many of my own maps and now see (with extra info) that I could have shortened them further, or rather, made them more efficient.

It's all about Flow control.

Imagine that you're trying to stream it all down a narrow funnel neck.

BTW
Here's an example of a negative var for you.

It's a timer script that I shortened years ago.

Code:

if never() then
set(v60, -1)
set(v90, 10)
set(v100, 1)
endif

if not eq(v100, 1) then
dec(v100, 1)
else
set(v100, 60)
sub(v90, 1)
endif

if not eq(v60, 59) then
inc(v60, 1)
else
set(v60, 0)
add(v70, 1)
endif

if elapse(1) then
consol "Countdown"
consol# "Min Left",v90
consol# "Sec Left",v100
endif

if elapse(1) then
text "Time"
text# "Min Past",v70
text# "Sec Past",v60
endif


Sorry, wasnt aware i was being "cryptic."

Contradictions? What do you mean?

Ill check out those scripts tomorrow, gotta get some sleep. Thanks.

Guest001 05-28-2018 09:04 PM

I've investigated concatenation, single line statements etc but I don't know enough to advise you reliably on that subject and I really don't know if it saves on overhead but it may help you.

Example:
Code:

if past(1) and never() then set(v17,5) endif

Guest001 05-28-2018 09:21 PM

Quote:

Originally Posted by Oscarmike247 (Post 389680)
"cryptic."

Contradictions?

I guess I mean this thread is 10 times longer than it could have been.

To clarify it would've been far better if you'd posted all the connected vars early on.

Not having all the connected vars certainly does makes it cryptic.


As for contradiction?

Questions on answers need to stay relevant and answers are only suggestions, so it's polite to accept

them and move on.

Also in regards to v17 again...

Quote:

V17 increases by 1 for every kill the player makes. It decreases by 3 for every time the player is killed.
This would probably be fairly useless information to most players in that form, it might be better if it displayed the total kills or Difficulty Level 1, 2, 3 etc. or (politely) :) have you also left that out?

My apologies but that's how it looks.

Oscarmike247 05-29-2018 05:18 AM

Quote:

Originally Posted by stompem (Post 389682)
I guess I mean this thread is 10 times longer than it could have been.

To clarify it would've been far better if you'd posted all the connected vars early on.

Not having all the connected vars certainly does makes it cryptic.


As for contradiction?

Questions on answers need to stay relevant and answers are only suggestions, so it's polite to accept

them and move on.

Also in regards to v17 again...



This would probably be fairly useless information to most players in that form, it might be better if it displayed the total kills or Difficulty Level 1, 2, 3 etc. or (politely) :) have you also left that out?

My apologies but that's how it looks.

No, it displays exactly what i want to display. The player is told to get 20 points (kills) and that there is a 3 point penalty if he dies. The closer you get to 20 points the harder it gets and vice versa.

In the example i gave, all of the linked variables were there. The only thing i really left out was the script that will not allow v17 to go below 0. My apologies, i just didnt think it was important info.

The single line idea is intetesting. Its worth a shot. Ill give it a try...

Guest001 05-29-2018 06:11 PM

Quote:

Originally Posted by Oscarmike247 (Post 389683)
No, it displays exactly what i want to display. The player is told to get 20 points (kills) and that there is a 3 point penalty if he dies. The closer you get to 20 points the harder it gets and vice versa.

In the example i gave, all of the linked variables were there. The only thing i really left out was the script that will not allow v17 to go below 0. My apologies, i just didnt think it was important info.

The single line idea is intetesting. Its worth a shot. Ill give it a try...

Well good luck with it then M8 because like I said re v17, it's probably useless info in that form, if there are any more redundancies as such, then a lot of good work is probably only contributing towards failure if you can't get it working, that's why my suggestion is you should probably start over again.

Guest001 05-29-2018 06:15 PM

Quote:

Originally Posted by Oscarmike247 (Post 389683)
The single line idea is intetesting. Its worth a shot. Ill give it a try...

Yes I thought it may perk you up. :run:

As I said, not sure if it saves overhead but if it's a line limit vs character limit then it may get you home. :gj:


All times are GMT -5. The time now is 01:46 AM.

Powered by vBulletin®