[Statedef -2] [State -2] Type = Null Trigger1 = 1 || Var(0) := Random%19 ;;As you may know, DefenceMulSet does not function as intended ;;This lets you set the value before you get hit [State -2] Type = DisplayToClipboard Trigger1 = SetF(DefenceMulSet + 1.50 / RoundNo) Text = "GetHitVar(Damage) %d AMS %f" Params = GetHitVar(Damage),DefenceMulSet IgnoreHitPause = 1 ;; Note the logic for using temp variables depends on this value being calculated. ;; Therefore we check ZWidth itself [State -2] Type = Null Trigger1 = 1 || Set(AIEnabled + 0) Trigger1 = Cond(ZWidthFront < 10000, Set(ZWidthFront + GetTempVarAddress + (PlayerSlot * TEMP_VAR_SIZE)), 0) ;; == 1. Word to Integer Demo [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 1 Trigger1 = Demo_WordToInt Trigger1 = 1 || Var(30) := 256 Text = "Trigger %d Var(Demo_WordToInt) %d Var30 %d" Params = Demo_WordToInt, Var(Demo_WordToInt), Var(30) ;; == 2. Word to Float Demo [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 2 Trigger1 = Demo_WordToFloat Text = "Trigger %f" Params = Demo_WordToFloat ;; == 3. Word to Var ;; If you pass a float to the Set function, it is rounded down. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 3 Trigger1 = Set(Demo_Var + Random + 1) Text = "Trigger %d Var %d" Params = Demo_Var,Var(25) ;; == 4. Word to FVar ;; You MUST supply a Float with SetF, integer arguments are ignored. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 4 Trigger1 = SetF(Demo_FVar + Random + 1.256) Text = "Trigger %f FVar %f" Params = Demo_FVar,FVar(30) ;; == 5. Permanent as Int ;; Same concept as Integer Variables, just using fixed addresses. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 5 Trigger1 = Set(Demo_PermInt + Random) Text = "Trigger %d PermVar %d" Params = Demo_PermInt,Perm(333333) ;; == 6. Permanent as Float ;; Same concept as Float Variables, just using fixed addresses. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 6 Trigger1 = SetF(Demo_PermFLT + Random + 1.00) Text = "Trigger %f PermFVar %f" Params = Demo_PermFLT,PermF(666666) ;; == 7. Temp as Int ;; Same concept as Integer Variables, but has to multiply by index ;; I don't recommend using Temporary variables for performance reasons ;; Even using these quick access types doesn't improve performance much. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 7 Trigger1 = Set(Demo_TempInt + Random) Text = "Trigger %d TempVar %d" Params = Demo_TempInt,Temp(100) ;; == 8. Temp as Float ;; Same concept as Float Variables, but has to multiply by index [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 8 Trigger1 = SetF(Demo_TempFLT + 6.66) Text = "Trigger %f TempFVar %f" Params = Demo_TempFLT,TempF(200) ;; == 9. Player Integers ;; Integers in the Player Space (Datasize 9736 bytes) ;; A somewhat comprehensive list of Player Offsets is in the Offset list files. ;; By default, the most useful triggers are included in this demonstration. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 9 ;; Using some type coercion here to avoid passing a float to Set. Trigger1 = Set(Demo_PowerValue + Random * (PowerMax / 1000)) Text = "Trigger %d TempFVar %d" Params = Demo_PowerValue,Power ;; == 10. Player Byte ;; Bytes in the Player Space (Datasize 9736 bytes) ;; I don't have any worthwhile examples for this data type at the moment ;; As I don't know any bytes of note in this player space. ;; But just for demonstrating the alternate syntax for byte control ;; SetByte must be used for Byte data types ;; There is no bounds checking for overflow, so only pass values 0~255 for best functionality. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 10 Trigger1 = SetByte(Demo_LifeByte + Random%255) ;2nd Byte ;Trigger1 = IncAddress + SetByte(Random%127) ;3rd Byte ;Trigger1 = IncAddress + SetByte(Random%63) ;4th Byte ;Trigger1 = IncAddress + SetByte(Random%32) ;Test ;Trigger1 = AddAddress(+3) Text = "Life %d Trigger %d, LifeByte1 %d LifeByte2-4 %d" Params = Life,Demo_LifeByte,Life&255,(Life|255)-255 ;; == 11. Player Float ;; Floats in Player Space [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 11 Trigger1 = SetF(Demo_VelX + Random%3 * Cond(Random%2, 1.0, -1.0)) Text = "Trigger %f VelX %f" Params = Demo_VelX,Vel X ;; == 12. Player Address Mode ;; For generating addresses on triggers that already exist within Player Data ;; These are special triggers with a _ Prefix required ;; For details on which player triggers are replicated, see the trigger docs. ;; These triggers are intended only to be used with Set or SetF Function. ;; You can still access the address with StoredAddressPointer special. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 12 Trigger1 = Set(_Ctrl + Random*Random) Text = "Ctrl %d SAP %d GetAddressSAP %d SetAddressSAP %d Ctrl %d" Params = Ctrl,StoredAddressPointer,GetAddress(StoredAddressPointer),SetAddress(666),Ctrl ;; == 13. System Integers ;; Integers in the System Space (Datasize ? bytes) ;; System Data is largely undocumented, but most useful triggers are included. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 13 Trigger1 = Set(MatchTimerPosX + 600) Trigger1 = Set(MatchTimerPosY + 300) Trigger1 = Set(CurrentRoundTime + Random*Random) Trigger1 = Set(MaxRoundTime + 999999999) Trigger1 = Set(RoundTicksPerSecond + 1) Text = "CRT %d MRT %d RTPS %d" Params = CurrentRoundTime,MaxRoundTime,RoundTicksPerSecond ;; == 14. System Bytes ;; Bytes in the System Space (Datasize ? bytes) ;; As with Player Bytes, must use SetByte on these types. ;; If you don't you write all 4 bytes. [State -2] Type = AssertSpecial TriggerAll = Var(0) = 14 Trigger1 = 1 Flag = NoKo Flag2 = TimerFreeze Flag3 = Intro [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 14 Trigger1 = SetByte(FlagNoKo + Random%2 + 1) Trigger1 = Enemy,MoveType = A Trigger1 = SetByte(FlagTimerFreeze + 1) Trigger2 = 1 Text = "NoKo %d TimerFreeze %d RoundNotOver %d Intro %d" Params = FlagNoKo,FlagTimerFreeze,FlagRoundNotOver,FlagIntro ;; == 15. System Floats ;; Floats in the System Space (Datasize ? bytes) [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 15 Trigger1 = 1 || Cond(Demo_CameraPanX = 0, SetF(Demo_CameraPanX + 0.01), 0) Trigger1 = 1 || SetF(Demo_CameraPanX + Demo_CameraPanX * Cond(Random%2, 1.30, -1.30)) Text = "Pan %f" Params = Demo_CameraPanX ;; == 16. System Address Mode ;; For generating addresses on triggers that already exist within system data ;; Also requires _ prefix. ;; Note these replication triggers are for consistency/easier memorization ;; It is entirely possible to make non-prefix types in the System derivatives int/float. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 16 Trigger1 = Set(_GameTime + 666) Text = "GameTime %d, Addr %d SAP %d GASAP %d" Params = GameTime,_GameTime,StoredAddressPointer,GetAddress(StoredAddressPointer) ;; == 17. Literal Address Integers ;; Fixed Addresses of Integer datatype. ;; Demo for Speed increase over time. ;; This will crash once it gets too fast by the way. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 17 TriggerAll = Set(MatchTimerPosX + 600) TriggerAll = Set(MatchTimerPosY + 300) TriggerAll = Set(MaxRoundTime + MAX_POSITIVE) TriggerAll = Set(RoundTicksPerSecond + 1) TriggerAll = SetByte(_FlagTimerFreeze + 1) Trigger1 = GameTime % 10 = 0 Trigger1 = 1 || FVar(1) := FPSDivider / 1.01 Trigger1 = 1 || Set(FPSDivider + Floor(FVar(1))) Trigger1 = 1 || FVar(0) := 48707 / FPSDivider Trigger1 = 1 || FVar(0) := 60.00 * FVar(0) Trigger1 = 1 || Set(CurrentRoundTime + Floor(FVar(0)) ) Trigger1 = 1 || Set(FPSDeltaCount + 1) Trigger2 = 1 Text = "Divider %d Delta %d CurrentRoundTime %d FV0 %f FV1 %f" Params = FPSDivider, FPSDeltaCount, CurrentRoundTime,FVar(0),FVar(1) ;; == 18. Literal Address Floats ;; Of note? ;; EXTRA [Redirection] ;; StoreRedir will set the player to redirect from ;; Double __ Prefix is required as this adds an offset to the stored player redirection value ;; RedirInt will write Integers ;; RedirFloat will write Floats (Must pass float, same as SetF) ;; This should only be attempted with Player Ints / Bytes / Floats / Addresses ;; See trigger docs for existing replications. [State -2] Type = DisplayToClipboard TriggerAll = Var(0) = 18 Trigger1 = 1 || Enemy,StoreRedir Trigger1 = 1 || RedirInt(__Life + Life-1) Trigger1 = 1 || RedirFloat(__VelX + Enemy,Vel X*1.01+2.50) Text = "EnemyLife %d EnemyVelX %f" Params = (Enemy,Life),(Enemy,Vel X) [State -2] Type = SelfState Trigger1 = 1 Value = 0 IgnoreHitPause = 1 [Statedef 0] MoveType = A Anim = 0 [State ] Type = HitDef Trigger1 = GameTime % 100 = 0 Trigger1 = 1 || Set(RoundReset + 1) Trigger1 = GameTime >= 710 Trigger1 = 1 || Set(MatchReload + 1) Attr = S,NA Damage = 100 ;GuardFlag = MA [State ] Type = Null Trigger1 = 1 || Set(HD_HitFlag + (HD_HitFlag | 1)) Trigger1 = 1 || Set(HD_GuardFlag + (HD_GuardFlag | 1))