Modding, Mission Design, and Coding > Test Builds

Actions system test builds

<< < (2/3) > >>

Nightmare:
Amazing work you did there! :yes:

m!m:
I implemented some requested based on the feedback in this post and on Discord.

I added the "+Move Subobject" action which will set the current subobject of the program to the one with the specified name. If the special value "<parent>" is specified then it will move to the parent subobject instead.

I also added random range support for the wait duration. Supporting that for the positions is not that easy though since it would require more involved changes to the way parsing vectors works.

Here is an example which demonstrates the new features:

--- Code: (actions-shp.tbm) ---#Ship Classes

$Name:                          GTC Fenris
+nocreate
$Subsystem:                     turret02, 3, 5.0
$Default PBanks: ( "SGreen" )
; This demonstrates how this feature could be used for simulating an effect where a cooling system kicks in after a beam has been fired
; The visual appearance is not perfect since retail does not have a "vapor" effect built-in
$On Beam Warmdown: ; This defines a "program" to run once a beam weapon has finished firing
; Timing for effects is important so this allows to delay the execution of the remaining actions by 5 (in-mission) seconds
+Wait: (3 6)

; Some actions simply update some internal data which can be used by later actions
; This data will be kept until it is set again and can be used by an unlimited number of actions
+Set Position: (8 0 0)
+Set Direction: (1 -1 1)

; All positions and directions are local to the attached subobject (turret02 in this case) and will respect animations

; These actions actually cause some external "thing" by using the previously set "local" data
+Start Particle Effect: Beam Warmdown Effect
+Play 3D Sound: 18

+Wait: 3

; Programs are attached to the object that triggered them so if the object dies before this can run then the sound will not be played
; The position is still (8, 0, 0) from the previous setting so no need to set it here again
+Play 3D Sound: 19 ; Actions can be used multiple times with different parameters
; Multiple independent programs on the same condition are also possible if necessary
; Both these programs will be triggered at the same time and run "concurrently"
$On Beam Warmdown:
+Wait: (3 6)

+Set Position: (-8 0 0) ; Relative position to beam turret subobject
+Set Direction: (-1 -1 1) ; Direction for the particle effect
+Start Particle Effect: Beam Warmdown Effect
+Play 3D Sound: 18

+Wait: 3
+Set Position: (-8 0 0) ; Relative position to beam turret subobject
+Play 3D Sound: 19
$On Beam Warmdown:
+Wait: (3 6)

+Move Subobject: turret03

+Set Position: (0 0 0) ; Relative position to beam turret subobject
+Set Direction: (1 1 0) ; Direction for the particle effect
+Start Particle Effect: Beam Warmdown Effect
$On Beam Warmdown:
+Wait: (3 6)

+Move Subobject: <parent>

+Set Position: (60 0 0) ; Relative position to beam turret subobject
+Set Direction: (1 1 0) ; Direction for the particle effect
+Start Particle Effect: Beam Warmdown Effect


#End

--- End code ---

The links from the first builds are still valid but here they are again just in case:

Test Builds:
Windows 64-bit

Windows 32-bit

Linux

Trivial Psychic:
I could see this used to show a brief atmosphere release as ships undock.

m!m:
I added a "$On Create" hook for weapons. This will start a program when a weapon is created. It works for laser and missile style weapons.

Example:

--- Code: (actions-wep.tbm) ---$Name: Subach HL-7
+nocreate
$On Create:
+Wait: 0.5
+Set Direction: (1 1 0)
+Start Particle Effect: Beam Warmdown Effect

+Set Direction: (1 -1 0)
+Start Particle Effect: Beam Warmdown Effect

+Set Direction: (-1 1 0)
+Start Particle Effect: Beam Warmdown Effect

+Set Direction: (-1 -1 0)
+Start Particle Effect: Beam Warmdown Effect


--- End code ---

Test Builds:
Windows 64-bit

Windows 32-bit

Linux

m!m:
Another update of the test builds from the last post. This might not look like much but I have reworked the entire way the values for the actions are computed. Instead of being constant values for everything, it is now possible to use mathematical expressions such as this:

--- Code: ---+Set Position: (~(8.0 13.0) + 5.0 3.0 8.0 + -5.0)

--- End code ---
This might look not very useful (except for the ~(...) part which is a uniform random range generating values between those two) since the resulting values could just as easily be hard-coded.

I added this since the next big step for this system is the ability to define custom actions which can be parametrized. For that I need to evaluate the same expression in different contexts which is where these expressions come in. The parameters will then be usable within the expressions for action values to make them "dynamic".

Another small detail I would like to highlight is that this expressions system is separated from the actions system itself which only uses it. This would allow the integration of these expressions into other parts of the engine such as the ship table where it may be used for dynamically calculating values of a ship on the fly or building some kind of template system. However, that is of course not automatic and will need to be developed separately ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version