User Tools

Site Tools


4rpl:ai_orbitals

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

4rpl:ai_orbitals [2021/03/31 13:57] – created heritor4rpl:ai_orbitals [2021/03/31 15:45] (current) – removed Karsten75
Line 1: Line 1:
-~~NOTOC~~ 
-<=[[4rpl:start| Index]] 
  
-====== AI Orbital ====== 
-AI Orbital 
- 
-===== Description ===== 
-This is a companion cpack to Autopilot AI - allowing a limited use of the Orbital rockets. 
-This has 2 modes: it will use Rain on the deepest creeper, and also - less often, will target the deepest creeper to hit with Singularity, and fire Conversion just as it's finished. 
-The AI will need to have the Rocket factory built and working, or an alternative means of incrementing the orbital count. 
- 
-<code 4rpl> 
-# --AIOrbital-- 3/31/2021 3:30:25 PM 
-#Damper 1 - not implemented 
-#Singularity 1 -  ~900 update counts 
-#Rain 2 - ~900 update counts 
-#Conversion 5 - instant 
- 
-#The following need to be at least 1500 otherwise they'll cause multiple rains and orbitals to fire at the same location at the same time 
-#Defaults are 4000 rain, 6000 orbital 
-$raincooldown:4000  
-$orbitalbombcooldown:6000 
- 
-:Frame 
-GetOrbitalCount <-*orbitals + ->*orbitals 
-SetOrbitalCount(0) 
- 
-trace(<-*orbitals) 
- 
-#Singularity plus Conversion 
-if ((<-*orbitals gt (6))  and (<-*orbitalbomb eq0) and (<-*rainstorm neq (1))) #Fire Singularity 
-           CreateUnitOnTerrain("singularity" GetMaxCreeperCellWithDamage 0) 
-           <-*orbitals 1 - ->*orbitals 
-           1 ->*orbitalbomb 
-            GetGameUpdateCount ->*orbitalbombcount 
-#trace("singularity fired") 
-endif 
-if((<-*orbitalbomb eq (1)) and (GetGameUpdateCount gt(<-*orbitalbombcount 900 +))) #Singularity finished, fire Conversion 
-           CreateUnitOnTerrain("conversion" GetMaxCreeperCellWithDamage 0) 
-           <-*orbitals 5 - ->*orbitals 
-           2 ->*orbitalbomb 
-#trace("singularity done, now conversion") 
-endif 
-if((<-*orbitalbomb eq (2)) and (GetGameUpdateCount gt(<-*orbitalbombcount 1200 +))) 
-           3 ->*orbitalbomb 
-#trace("rain can fire") 
-endif 
-if((<-*orbitalbomb eq (3)) and (GetGameUpdateCount gt(<-*orbitalbombcount <-orbitalbombcooldown +))) #give Rain a chance to fire after this 
-           0 ->*orbitalbomb 
-#trace("conversion off cooldown") 
-endif 
- 
-#Rain 
-if ((<-*orbitals gt (2))  and (<-*orbitalbomb neq (1)) and (<-*orbitalbomb neq (2)) and (<-*rainstorm eq0))  
-#If we're not in the middle of, or recovering from a Conversion Bomb 
-           CreateUnitOnTerrain("rain" GetMaxCreeperCellWithDamage 0) 
-           <-*orbitals 2 - ->*orbitals 
-           1 ->*rainstorm 
-            GetGameUpdateCount ->*rainstormcount 
-#trace("rain fired") 
-endif 
-if((<-*rainstorm eq (1)) and (GetGameUpdateCount gt(<-*rainstormcount 1200 +))) #Rain has finished 
-           2 ->*rainstorm 
-#trace("singularity can fire") 
-endif 
-if((<-*rainstorm eq (2)) and (GetGameUpdateCount gt(<-*rainstormcount <-raincooldown +))) #Cooldown time 
-           0 ->*rainstorm 
-#trace("rain off cooldown") 
-endif 
- 
-:Once 
-RegisterForMSG("MSG_FrameAdvance" "Frame") 
-0 ->*orbitals 
-0 ->*orbitalbomb 
-0 ->*rainstorm 
-</code> 
- 
-<=[[4rpl:tutorials| Tutorials]] 
4rpl/ai_orbitals.1617199077.txt.gz · Last modified: 2025/02/14 14:56 (external edit)