Author Topic: Trouble with SEXP repeats...  (Read 2043 times)

0 Members and 1 Guest are viewing this topic.

Offline Mav

  • 28
  • location: Shivan fleet - closing in on GTVA space
Trouble with SEXP repeats...
I'm trying to revive this.
I already added the new lines that beam-modifying .tbms seem to need by now.

I have several timers in it.
There are timers (repeating SEXPs that decrease some variable) for:
* control of beam firing & primaries using lock/unlock, which seems to currently never work (sometimes once, but usually not at all)
* launching ships, which has worked back then, but now only the first time a ship is launched, and later none [edit: Ok, this is fixed.]
* some "special weapons" that I added as gimmicks - a subspace teleporter a la Master of Orion 2 and a shockwave-weapon like on Homeworld:Cataclysm's dreadnought ; both only for your personal "captains' fighter" that you can switch into
      - the shockwave only works once, and the make-player-invulnerable that I used to prevent you from damaging yourself doesn't seem to have effect either
      - the teleporter waits 'til it is first triggered, but afterwards fires everytime the counter reaches zero, no matter if I order it to engage

The timers look like this:
Code: [Select]
$Formula: ( when
   ( > @LaunchTimer1[0] 0 )
   ( modify-variable
      @LaunchTimer1[0]
      ( - @LaunchTimer1[0] 1 )
   )
   ( key-reset-multiple "Spacebar" )
)
+Name: LaunchSystem2---timer01
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( key-pressed "Spacebar" )
      ( not ( = @LaunchTimer1[0] 0 ) )
      ( = @CptnFghtr[0] 0 )
   )
   ( key-reset-multiple "Spacebar" )
)
+Name: LaunchSystem2---timeCatcher01
+Repeat Count: 10000
+Interval: 1
+Team: 0

Later, this is tested like:

Code: [Select]
$Formula: ( when
   ( and
      ( key-pressed "Spacebar" )
      ( = @LaunchTimer1[0] 0 )
      ( = @CptnFghtr[0] 0 )
   )


So - what am I doing wrong, or is this some problem with the build (5618) I'm using?


[edit:
Nevermind, I got launching to work again... But the other issues remain :( .
]
-__ o_O___O_o
I______O_O_______dragons
________o

-----------------------------------
capship shields DO WORK !!!
my models, now with pics
test mission for commanding capships
-----------------------------------
suffering from a late stage of BoE-infection - DON'T call a doctor, it's too late for that anyway ;o)

 

Offline Mav

  • 28
  • location: Shivan fleet - closing in on GTVA space
Re: Trouble with SEXP repeats...
...oh, well - I should have posted the complete SEXPs directly, I guess - sorry for the double-post :o . Though fact is that the not-working SEXPs rely on exactly the same sort of timer, and the specifics of the problems make it seem likely that the timers would be the reason.

Anyway, here you go:
Code: [Select]
#Sexp_variables

$Variables:
(
0 "BasePosX" "0" "number"
1 "BasePosY" "0" "number"
2 "BasePosZ" "0" "number"
3 "BaseShip" "Alpha 1" "string"
4 "BeamCtrlWait" "0" "number"
5 "BeamCtrlWaitFlag1" "0" "number"
6 "BeamWait01" "0" "number"
7 "CptnFghtr" "0" "number"
8 "CptnHull" "100" "number"
9 "CptnPosX" "0" "number"
10 "CptnPosY" "0" "number"
11 "CptnPosZ" "0" "number"
12 "CptnSec" "100" "number"
13 "CptnSec2" "100" "number"
14 "CptnSec3" "100" "number"
15 "CptnShields" "100" "number"
16 "CptnSpeed" "15" "number"
17 "CptnTur01" "100" "number"
18 "LandingShip" "Arjuna 1" "string"
19 "Launch1X" "0" "number"
20 "Launch1Y" "0" "number"
21 "Launch1Z" "0" "number"
22 "LaunchBank" "0" "number"
23 "LaunchHeading" "0" "number"
24 "LaunchName01" "Alpha 1" "string"
25 "LaunchPitch" "0" "number"
26 "LaunchTimer1" "0" "number"
27 "LaunchType1" "L-SFDragon" "string"
28 "LaunchType2" "L-SFMara" "string"
29 "LaunchType3" "L-SBNahema" "string"
30 "LaunchX" "0" "number"
31 "LaunchY" "0" "number"
32 "LaunchZ" "0" "number"
33 "PrimaryWait" "0" "number"
34 "PrimaryWaitFlag1" "0" "number"
35 "RepulsorTimer" "0" "number"
36 "SquadStateBool" "0" "number"
37 "SubTel_Deg" "150" "number"
38 "SubTel_Deg2" "70" "number"
39 "SupLasTarget" "Cephei 6" "string"
40 "SupLasWait" "0" "number"
41 "SupLasWaitFlag1" "0" "number"
42 "SupLasX" "0" "number"
43 "SupLasY" "0" "number"
44 "SupLasZ" "0" "number"
45 "TeleportTimer" "0" "number"
)


...and:

Code: [Select]
#Events ;! 34 total

$Formula: ( when
   ( true )
   ( beam-lock "Alpha 1" "turret01" )
   ( beam-lock "Alpha 1" "turret02" )
   ( beam-lock "Alpha 1" "turret03" )
   ( beam-lock "Alpha 1" "turret04" )
   ( lock-primary-weapon "Alpha 1" )
)
+Name: BeamControlInitialization
+Repeat Count: 1
+Interval: 1
+Team: 0

$Formula: ( when
   ( > @LaunchTimer1[0] 0 )
   ( modify-variable
      @LaunchTimer1[0]
      ( - @LaunchTimer1[0] 1 )
   )
   ( key-reset-multiple "Spacebar" )
)
+Name: LaunchSystem2---timer01
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( key-pressed "Spacebar" )
      ( not ( = @LaunchTimer1[0] 0 ) )
      ( = @CptnFghtr[0] 0 )
   )
   ( key-reset-multiple "Spacebar" )
)
+Name: LaunchSystem2---timeCatcher01
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( key-pressed "Spacebar" )
      ( = @LaunchTimer1[0] 0 )
      ( = @CptnFghtr[0] 0 )
   )
   ( when
      ( not
         ( secondaries-depleted "Alpha 1" )
      )
      ( when
         ( is-secondary-selected "Alpha 1" 0 )
         ( modify-variable
            @LaunchX[0]
            ( get-object-x
               "Alpha 1"
               "fighterbay02"
            )
         )
         ( modify-variable
            @LaunchY[0]
            ( get-object-y
               "Alpha 1"
               "fighterbay02"
            )
         )
         ( modify-variable
            @LaunchZ[0]
            ( get-object-z
               "Alpha 1"
               "fighterbay02"
            )
         )
      )
      ( when
         ( is-secondary-selected "Alpha 1" 1 )
         ( modify-variable
            @LaunchX[0]
            ( get-object-x
               "Alpha 1"
               "fighterbay02"
            )
         )
         ( modify-variable
            @LaunchY[0]
            ( get-object-y
               "Alpha 1"
               "fighterbay02"
            )
         )
         ( modify-variable
            @LaunchZ[0]
            ( get-object-z
               "Alpha 1"
               "fighterbay02"
            )
         )
      )
      ( when
         ( is-secondary-selected "Alpha 1" 2 )
         ( modify-variable
            @LaunchX[0]
            ( get-object-x
               "Alpha 1"
               "fighterbay01"
            )
         )
         ( modify-variable
            @LaunchY[0]
            ( get-object-y
               "Alpha 1"
               "fighterbay01"
            )
         )
         ( modify-variable
            @LaunchZ[0]
            ( get-object-z
               "Alpha 1"
               "fighterbay01"
            )
         )
      )
      ( when
         ( is-secondary-selected "Alpha 1" 0 )
         ( ship-create
            "SF Dragon"
            "SF Dragon"
            @LaunchX[0]
            @LaunchY[0]
            ( + @LaunchZ[0] 150 )
         )
      )
      ( when
         ( is-secondary-selected "Alpha 1" 1 )
         ( ship-create
            "SF Mara"
            "SF Mara"
            @LaunchX[0]
            @LaunchY[0]
            ( + @LaunchZ[0] 150 )
         )
      )
      ( when
         ( true )
         ( when
            ( and
               ( string-equals
                  "@LaunchType3[L-SBNahema]"
                  "L-SBNahema"
               )
               ( is-secondary-selected "Alpha 1" 2 )
            )
            ( ship-create
               "SB Nahema"
               "SB Nahema"
               @LaunchX[0]
               @LaunchY[0]
               ( + @LaunchZ[0] 150 )
            )
         )
      )
      ( when
         ( true )
         ( when
            ( and
               ( string-equals
                  "@LaunchType3[L-SBNahema]"
                  "L-SBNephilim"
               )
               ( is-secondary-selected "Alpha 1" 2 )
            )
            ( ship-create
               "SB Nephilim"
               "SB Nephilim"
               @LaunchX[0]
               @LaunchY[0]
               ( + @LaunchZ[0] 150 )
            )
         )
      )
      ( change-iff
         "Friendly"
         "@LaunchName01[Alpha 1]"
      )
      ( change-ai-class
         "Colonel"
         "@LaunchName01[Alpha 1]"
      )
      ( key-reset-multiple "Spacebar" )
      ( modify-variable @LaunchTimer1[0] 5 )
   )
)
+Name: LaunchSystem2---001
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( false )
   ( set-secondary-ammo
      "Alpha 1"
      0
      ( -
         ( get-secondary-ammo "Alpha 1" 0 )
         5
      )
   )
)
+Name: LaunchSquad
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( key-pressed "Left Ctrl" )
      ( = @BeamCtrlWait[0] 0 )
      ( = @CptnFghtr[0] 0 )
   )
   ( beam-free "Alpha 1" "turret01" )
   ( beam-free "Alpha 1" "turret02" )
   ( beam-free "Alpha 1" "turret03" )
   ( beam-free "Alpha 1" "turret04" )
   ( key-reset-multiple "Left Ctrl" )
)
+Name: BeamControl2---001
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( = @CptnFghtr[0] 0 )
   ( beam-lock "Alpha 1" "turret01" )
   ( beam-lock "Alpha 1" "turret02" )
   ( beam-lock "Alpha 1" "turret03" )
   ( beam-lock "Alpha 1" "turret04" )
   ( modify-variable @BeamCtrlWait[0] 5 )
)
+Name: BeamControl2---002
+Repeat Count: 100000
+Interval: 1
+Chained: 2
+Team: 0

$Formula: ( when
   ( and
      ( > @BeamCtrlWait[0] 0 )
      ( = @BeamCtrlWaitFlag1[0] 1 )
   )
   ( modify-variable
      @BeamCtrlWait[0]
      ( - @BeamCtrlWait[0] 1 )
   )
)
+Name: BeamControl2---Timer1
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( false )
      ( order
         "Alpha 1"
         "Form on my wing"
         "Arjuna 1"
      )
      ( = @CptnFghtr[0] 0 )
   )
   ( modify-variable
      "@LandingShip[Arjuna 1]"
      "Arjuna 1"
   )
)
+Name: LandingSystem1---000
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( order
         "Alpha 1"
         "Form on my wing"
         "@LandingShip[Arjuna 1]"
      )
      ( = @CptnFghtr[0] 0 )
   )
   ( remove-goal
      "@LandingShip[Arjuna 1]"
      ( ai-warp-out 89 )
   )
   ( add-goal
      "@LandingShip[Arjuna 1]"
      ( ai-play-dead 89 )
   )
)
+Name: LandingSystem1---001
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( has-docked-delay
         "@LandingShip[Arjuna 1]"
         "Alpha 1"
         1
         3
      )
      ( not
         ( =
            100
            ( secondary-ammo-pct "Alpha 1" 0 )
         )
      )
      ( = @CptnFghtr[0] 0 )
   )
   ( ship-vanish
      "@LandingShip[Arjuna 1]"
   )
   ( set-secondary-ammo
      "Alpha 1"
      0
      ( +
         ( get-secondary-ammo "Alpha 1" 0 )
         1
      )
   )
)
+Name: LandingSystem1---002
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( has-docked-delay
         "@LandingShip[Arjuna 1]"
         "Alpha 1"
         1
         4
      )
      ( =
         100
         ( secondary-ammo-pct "Alpha 1" 0 )
      )
      ( = @CptnFghtr[0] 0 )
   )
   ( add-goal
      "@LandingShip[Arjuna 1]"
      ( ai-chase-any 89 )
   )
)
+Name: LandingSystem1---003
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( key-pressed "E" )
      ( = @CptnFghtr[0] 0 )
   )
   ( modify-variable
      @CptnPosX[0]
      ( get-object-x
         "Alpha 1"
         "fighterbay01"
      )
   )
   ( modify-variable
      @CptnPosY[0]
      ( get-object-y
         "Alpha 1"
         "fighterbay01"
      )
   )
   ( modify-variable
      @CptnPosZ[0]
      ( get-object-z
         "Alpha 1"
         "fighterbay01"
      )
   )
   ( modify-variable
      @CptnHull[100]
      ( hits-left "Alpha 1" )
   )
   ( modify-variable
      @CptnShields[100]
      ( shields-left "Alpha 1" )
   )
   ( modify-variable
      @CptnSec[100]
      ( get-secondary-ammo "Alpha 1" 0 )
   )
   ( modify-variable
      @CptnSec2[100]
      ( get-secondary-ammo "Alpha 1" 1 )
   )
   ( modify-variable
      @CptnSec3[100]
      ( get-secondary-ammo "Alpha 1" 2 )
   )
   ( modify-variable
      @CptnSpeed[15]
      ( current-speed "Alpha 1" )
   )
   ( modify-variable
      @CptnTur01[100]
      ( hits-left-subsystem
         "Alpha 1"
         "turret01"
      )
   )
   ( modify-variable
      @BasePosX[0]
      ( get-object-x "Alpha 1" )
   )
   ( modify-variable
      @BasePosY[0]
      ( get-object-y "Alpha 1" )
   )
   ( modify-variable
      @BasePosZ[0]
      ( get-object-z "Alpha 1" )
   )
   ( change-ship-class
      "SF Mara (terrans)"
      "Alpha 1"
   )
   ( set-object-position
      "Alpha 1"
      @CptnPosX[0]
      @CptnPosY[0]
      ( + @CptnPosZ[0] 100 )
   )
   ( unlock-primary-weapon "Alpha 1" )
   ( ship-create
      "Ravana"
      "SD Ravana"
      @BasePosX[0]
      @BasePosY[0]
      @BasePosZ[0]
   )
   ( modify-variable @CptnFghtr[0] 1 )
   ( modify-variable
      "@BaseShip[Alpha 1]"
      "Ravana"
   )
   ( key-reset-multiple "E" )
   ( set-subsystem-strength
      "@BaseShip[Alpha 1]"
      "Hull"
      @CptnHull[100]
   )
   ( set-secondary-ammo
      "@BaseShip[Alpha 1]"
      0
      @CptnSec[100]
   )
   ( set-secondary-ammo
      "@BaseShip[Alpha 1]"
      1
      @CptnSec2[100]
   )
   ( set-secondary-ammo
      "@BaseShip[Alpha 1]"
      2
      @CptnSec3[100]
   )
   ( set-subsystem-strength
      "@BaseShip[Alpha 1]"
      "turret01"
      @CptnTur01[100]
   )
   ( clear-goals "Cephei" )
   ( clear-goals "Hammer" )
   ( add-goal
      "Cephei"
      ( ai-chase "@BaseShip[Alpha 1]" 89 )
   )
   ( add-goal
      "Hammer"
      ( ai-chase "@BaseShip[Alpha 1]" 89 )
   )
   ( add-goal
      "@BaseShip[Alpha 1]"
      ( ai-chase "Cephei" 89 )
   )
   ( beam-free-all "@BaseShip[Alpha 1]" )
   ( add-nav-ship
      "NavBase"
      "@BaseShip[Alpha 1]"
   )
)
+Name: CptnsShip1---001
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( key-pressed "E" )
      ( = @CptnFghtr[0] 1 )
      ( false )
   )
   ( modify-variable
      @BasePosX[0]
      ( get-object-x "@BaseShip[Alpha 1]" )
   )
   ( modify-variable
      @BasePosY[0]
      ( get-object-y "@BaseShip[Alpha 1]" )
   )
   ( modify-variable
      @BasePosZ[0]
      ( get-object-z "@BaseShip[Alpha 1]" )
   )
   ( ship-vanish "@BaseShip[Alpha 1]" )
   ( change-ship-class
      "SD Ravana"
      "Alpha 1"
   )
   ( key-reset-multiple "E" )
   ( clear-goals "Cephei" )
   ( clear-goals "Hammer" )
   ( add-goal
      "Cephei"
      ( ai-chase "Alpha 1" 89 )
   )
   ( add-goal
      "Hammer"
      ( ai-chase "Alpha 1" 89 )
   )
   ( set-object-position
      "Alpha 1"
      @BasePosX[0]
      @BasePosY[0]
      @BasePosZ[0]
   )
   ( modify-variable @CptnFghtr[0] 0 )
)
+Name: CptnsShip1---002
+Repeat Count: 10000
+Interval: 1
+Chained: 0
+Team: 0

$Formula: ( when
   ( and
      ( key-pressed "E" )
      ( = @CptnFghtr[0] 1 )
   )
   ( player-use-ai )
   ( ship-invulnerable "Alpha 1" )
   ( set-cutscene-bars )
   ( lock-perspective ( true ) 2 )
   ( add-nav-ship
      "NavBase"
      "@BaseShip[Alpha 1]"
   )
   ( add-goal
      "Alpha 1"
      ( ai-waypoints-once "NavBase" 89 )
   )
)
+Name: CptnsShip1---002-2
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( or
      ( has-docked-delay
         "Alpha 1"
         "@BaseShip[Alpha 1]"
         1
         0
      )
      ( <
         ( distance
            "Alpha 1"
            "@BaseShip[Alpha 1]"
         )
         450
      )
   )
   ( modify-variable
      @BasePosX[0]
      ( get-object-x "@BaseShip[Alpha 1]" )
   )
   ( modify-variable
      @BasePosY[0]
      ( get-object-y "@BaseShip[Alpha 1]" )
   )
   ( modify-variable
      @BasePosZ[0]
      ( get-object-z "@BaseShip[Alpha 1]" )
   )
   ( ship-vanish "@BaseShip[Alpha 1]" )
   ( change-ship-class
      "SD Ravana"
      "Alpha 1"
   )
   ( ship-vulnerable "Alpha 1" )
   ( player-not-use-ai )
   ( key-reset-multiple "E" )
   ( clear-goals "Cephei" )
   ( clear-goals "Hammer" )
   ( add-goal
      "Cephei"
      ( ai-chase "Alpha 1" 89 )
   )
   ( add-goal
      "Hammer"
      ( ai-chase "Alpha 1" 89 )
   )
   ( set-object-position
      "Alpha 1"
      @BasePosX[0]
      @BasePosY[0]
      @BasePosZ[0]
   )
   ( lock-perspective ( false ) 0 )
   ( modify-variable @CptnFghtr[0] 0 )
   ( unset-cutscene-bars )
)
+Name: CptnsShip1---003-2
+Repeat Count: 10000
+Interval: 1
+Chained: 1
+Team: 0

$Formula: ( when
   ( key-pressed "Tab" )
   ( key-reset-multiple "Tab" )
   ( turret-change-weapon
      "Alpha 1"
      "turret01"
      "BFRed-suppl"
      1
      0
   )
   ( turret-change-weapon
      "Alpha 1"
      "turret02"
      "BFRed-suppl"
      1
      0
   )
   ( turret-change-weapon
      "Alpha 1"
      "turret03"
      "BFRed-suppl2"
      1
      0
   )
   ( turret-change-weapon
      "Alpha 1"
      "turret04"
      "BFRed-suppl2"
      1
      0
   )
   ( fire-beam
      "Alpha 1"
      "turret01"
      "Alpha 1"
      "beamfocus"
   )
   ( fire-beam
      "Alpha 1"
      "turret02"
      "Alpha 1"
      "beamfocus"
   )
   ( fire-beam
      "Alpha 1"
      "turret03"
      "Alpha 1"
      "beamfocus"
   )
   ( fire-beam
      "Alpha 1"
      "turret04"
      "Alpha 1"
      "beamfocus"
   )
)
+Name: Superlaser1---001
+Repeat Count: 10000
+Interval: 1
+Chained: 1
+Team: 0

$Formula: ( when
   ( true )
   ( turret-change-weapon
      "Alpha 1"
      "turret06"
      "BFRed"
      1
      0
   )
   ( beam-free "Alpha 1" "turret06" )
   ( fire-beam
      "Alpha 1"
      "turret06"
      "@SupLasTarget[Cephei 6]"
   )
)
+Name: Superlaser1---002
+Repeat Count: 100000
+Interval: 1
+Chained: 2
+Team: 0

$Formula: ( when
   ( true )
   ( turret-change-weapon
      "Alpha 1"
      "turret01"
      "LRed"
      1
      0
   )
   ( turret-change-weapon
      "Alpha 1"
      "turret02"
      "LRed"
      1
      0
   )
   ( turret-change-weapon
      "Alpha 1"
      "turret03"
      "LRed"
      1
      0
   )
   ( turret-change-weapon
      "Alpha 1"
      "turret04"
      "LRed"
      1
      0
   )
   ( turret-change-weapon
      "Alpha 1"
      "turret06"
      "Shivan Turret Laser"
      1
      0
   )
)
+Name: Superlaser1---003
+Repeat Count: 100000
+Interval: 1
+Chained: 10
+Team: 0

$Formula: ( when
   ( > @SupLasWait[0] 0 )
   ( modify-variable
      @SupLasWait[0]
      ( - @SupLasWait[0] 1 )
   )
)
+Name: Superlaser1---Timer1
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( key-pressed "Left Ctrl" )
      ( = @PrimaryWait[0] 0 )
      ( = @CptnFghtr[0] 0 )
   )
   ( unlock-primary-weapon "Alpha 1" )
   ( modify-variable @PrimaryWait[0] 8 )
   ( key-reset-multiple "Left Ctrl" )
)
+Name: PrimaryControl1---001
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( = @CptnFghtr[0] 0 )
   ( lock-primary-weapon "Alpha 1" )
   ( key-reset-multiple "Left Ctrl" )
)
+Name: PrimaryControl1---002
+Repeat Count: 100000
+Interval: 1
+Chained: 4
+Team: 0

$Formula: ( when
   ( > @PrimaryWait[0] 0 )
   ( modify-variable
      @PrimaryWait[0]
      ( - @PrimaryWait[0] 1 )
   )
   ( key-reset-multiple "Left Ctrl" )
)
+Name: PrimaryControl1---Timer1
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( and
      ( = @CptnFghtr[0] 1 )
      ( key-pressed "U" )
      ( = @RepulsorTimer[0] 0 )
   )
   ( ship-invulnerable "Alpha 1" )
   ( modify-variable
      @RepulsorTimer[0]
      58
   )
   ( key-reset-multiple "U" )
)
+Name: RepulsorWave---1
+Repeat Count: 10000
+Interval: 1

$Formula: ( when
   ( true )
   ( explosion-effect
      ( get-object-x "Alpha 1" )
      ( get-object-y "Alpha 1" )
      ( get-object-z "Alpha 1" )
      95
      10000
      1500
      350
      1500
      500
      0
      7
      5
      7
   )
)
+Name: RepulsorWave---2
+Repeat Count: 10000
+Interval: 1
+Chained: 2
+Team: 0

$Formula: ( when
   ( true )
   ( ship-vulnerable "Alpha 1" )
   ( key-reset-multiple "U" )
)
+Name: RepulsorWave---3
+Repeat Count: 10000
+Interval: 1
+Chained: 7
+Team: 0

$Formula: ( when
   ( and
      ( = @CptnFghtr[0] 1 )
      ( key-pressed "Q" )
      ( = @TeleportTimer[0] 0 )
   )
   ( modify-variable
      @SubTel_Deg[150]
      ( rand-multiple 0 359 )
   )
   ( modify-variable
      @SubTel_Deg2[70]
      ( rand-multiple 0 359 )
   )
   ( warp-effect
      ( get-object-x "Alpha 1" )
      ( get-object-y "Alpha 1" )
      ( get-object-z "Alpha 1" )
      0
      0
      0
      100
      3
      69
      70
      1
      1
   )
   ( set-object-position
      "Alpha 1"
      ( +
         ( get-object-x "Alpha 1" )
         ( * 500 1 )
      )
      ( +
         ( get-object-y "Alpha 1" )
         ( * 500 0 )
      )
      ( +
         ( get-object-z "Alpha 1" )
         ( * 500 0 )
      )
   )
   ( modify-variable
      @TeleportTimer[0]
      27
   )
)
+Name: SubspaceTeleporter---1
+Repeat Count: 10000
+Interval: 1
+Team: 0

$Formula: ( when
   ( true )
   ( key-reset-multiple "Q" )
)
+Name: SubspaceTeleporter---1b
+Repeat Count: 100000
+Interval: 1
+Chained: 5
+Team: 0

$Formula: ( when
   ( > @RepulsorTimer[0] 0 )
   ( modify-variable
      @RepulsorTimer[0]
      ( - @RepulsorTimer[0] 1 )
   )
)
+Name: RepulsorWave---Timer1
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( > @TeleportTimer[0] 0 )
   ( modify-variable
      @TeleportTimer[0]
      ( - @TeleportTimer[0] 1 )
   )
)
+Name: SubspaceTeleporter---Timer1
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( key-pressed "Left Ctrl" )
   ( key-reset-multiple "Left Ctrl" )
)
+Name: PrimaryReset---1
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( true )
   ( key-reset-multiple "Left Ctrl" )
)
+Name: PrimaryReset---2
+Repeat Count: 100000
+Interval: 1
+Chained: 1
+Team: 0

$Formula: ( when
   ( key-pressed "Spacebar" )
   ( key-reset-multiple "Spacebar" )
)
+Name: SecondaryReset---1
+Repeat Count: 100000
+Interval: 1
+Team: 0

$Formula: ( when
   ( true )
   ( key-reset-multiple "Spacebar" )
)
+Name: SecondaryReset---2
+Repeat Count: 100000
+Interval: 1
+Chained: 1
+Team: 0



...so, does anybody have an idea of what's going wrong there? The details of the problems are described in the first post...


-__ o_O___O_o
I______O_O_______dragons
________o

-----------------------------------
capship shields DO WORK !!!
my models, now with pics
test mission for commanding capships
-----------------------------------
suffering from a late stage of BoE-infection - DON'T call a doctor, it's too late for that anyway ;o)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Trouble with SEXP repeats...
You're using chained nested repeating when SEXPs with key-pressed?

That's pretty much every single thing you could do to create the perfect storm of key-pressed bugs. The fact that key-pressed reacts very strangely in repeating events is one of the reasons why every-time was created. I suggest you try making a simple test mission and try out both SEXPs until you can find what works for you.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Mav

  • 28
  • location: Shivan fleet - closing in on GTVA space
Re: Trouble with SEXP repeats...
Oh, thanks :) .
I'll try to replace it with every-time or something, then.

(and about what works for me... that's the strange point - launch control does work as is, although it uses just the same system as the others... :nervous: )


And why I did it this way... well, either every-time wasn't there when I did this, or I just was (and admittedly still am :nervous: ) unfamiliar with it.
But thanks for the tip, I hope it'll work that way, then... :)
-__ o_O___O_o
I______O_O_______dragons
________o

-----------------------------------
capship shields DO WORK !!!
my models, now with pics
test mission for commanding capships
-----------------------------------
suffering from a late stage of BoE-infection - DON'T call a doctor, it's too late for that anyway ;o)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Trouble with SEXP repeats...
The reason why I refer to key-pressed as being bugged is because the results you get will depend on the key you use. Some will repeat forever, some will only work the first time, etc. It all appears to depend on the type of key you're looking at. Keys which are meant to be held down (e.g. A for accelerate) are treated differently from the ones that are simply pressed (like Q for equalise shields).

I wrote a post about it a few years back detailing the odd behaviour.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

  

Offline Mav

  • 28
  • location: Shivan fleet - closing in on GTVA space
Re: Trouble with SEXP repeats...
Ahh, thanks :) .


So should using something like

Code: [Select]
every-time
     when
          key-pressed
     do-something
     key-reset

work?

-__ o_O___O_o
I______O_O_______dragons
________o

-----------------------------------
capship shields DO WORK !!!
my models, now with pics
test mission for commanding capships
-----------------------------------
suffering from a late stage of BoE-infection - DON'T call a doctor, it's too late for that anyway ;o)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Trouble with SEXP repeats...
Maybe. Depends on which key you use.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]