Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: WMCoolmon on July 01, 2006, 09:34:03 pm

Title: New Scripting Thing
Post by: WMCoolmon on July 01, 2006, 09:34:03 pm
Working on a new scripting.tbl setup, so that I can keep scripting all in one spot. I call it 'conditional hooks'.

The idea behind it is that you may only want hooks to execute for certain ships, ship classes, types, or on certain missions, (or any combination of the aforementioned) but at the same time, keep all of the scripting in scripting.tbl.

Also, I modified the code to allow for modular scripting tables, since all conditional hooks are additive. See the below example, which demonstrates all the conditions and trigger actions that I've implemented so far.

Yes, this should allow for per-mission scripting with standalone missions (:nervous:)

test-sct.tbm
Code: [Select]
#Conditional Hooks
--Generic mission hook (executes every frame)
$Mission: test
$Hook: []

--Hooks for ship 'Mohawk', in mission 'test', that is of ship class 'Fenris' and type 'Cruiser'
$Mission: test
$Ship: Mohawk
$Ship Class: Fenris
$Ship Type: Cruiser
$On Warpout: []
$On Warpin: []
$On Death: []

--Hook that executes all the time when in-mission
$State: GS_STATE_GAME_PLAY
$Hook: []
#End

http://fs2source.warpcore.org/temp/wmc/conditionalhooks.zip
Title: Re: New Scripting Thing
Post by: Wanderer on July 02, 2006, 01:30:41 pm
Nice! I think SoL team can find a lot of use for that.. Atleast it makes various currently used rather odd statements useless :p

Also the ship type and ship class options seem very promising ones indeed...
Title: Re: New Scripting Thing
Post by: Cobra on July 02, 2006, 02:46:56 pm
Nice, if I'm reading that right we don't have to put in a hundred AI-order SEXPs in FRED anymore.