Pilot Mode (Proof of concept)

Started by Nicant, January 16, 2018, 06:39:17 PM

Previous topic - Next topic

Nicant

So here is a proof of concept of a new mode i made called pilot mode. Basically instead of using the mouse to control ships, you use wasd.

1.
First thing you need is this script, just put it in a core and move it off the map somewhere.
# --ShipControl-- 1/16/2018 5:19:46 PM

once
@awake
endonce

<-Ship -1 neq if
"W" GetKey if
MoveShip(<-Ship @ShipCoordX(<-Ship) @ShipCoordY(<-Ship) 1 add 0)
endif
"S" GetKey if
MoveShip(<-Ship @ShipCoordX(<-Ship) @ShipCoordY(<-Ship) 1 sub 0)
endif
"A" GetKey if
MoveShip(<-Ship @ShipCoordX(<-Ship) 1 sub @ShipCoordY(<-Ship) 0)
endif
"D" GetKey if
MoveShip(<-Ship @ShipCoordX(<-Ship) 1 add @ShipCoordY(<-Ship) 0)
endif
endif

"T" GetKey if
<-slot 24 lt if
GetTimer0 eq0 if
<-slot 1 add ->slot
15 SetTimer0
<-slot GetShipFromSlot ->Ship
"Slot: " <-slot concat SetText
endif
endif
endif
"G" GetKey if
<-slot 1 gte if
GetTimer0 eq0 if
<-slot 1 sub ->slot
15 SetTimer0
<-slot GetShipFromSlot ->Ship
"Slot: " <-slot concat SetText
endif
endif
endif


:awake
Self "main" "NONE" SetImage
0 GetShipFromSlot ->Ship
"Slot: 0" SetText

:ShipCoordX

->sc_sid

<-sc_sid GetShipCoordX ->sc_x

<-sc_x

:ShipCoordY

->sc_sid

<-sc_sid GetShipCoordY ->sc_y

<-sc_y


2.
Then you need to get ships. Just get any ship and add it. Just make sure it have the command module in the center of the ship. Note: Ships with the command module in the very center of the ship will only work. If the command module is not in the center of the ship, then the ship controls wont work properly.

3.
After that you are pretty much ready to play!
--Controls--
W, A, S, and D = Movement

T and G = Cycle through ship slots

Attached is a test map i used to make it/test it. Let me know what you think about this!
CW4 hype!!