News:

Welcome to the new Sinister Design forums!

Main Menu

Developer's Log

Started by CraigStern, February 11, 2013, 07:19:44 PM

Previous topic - Next topic

CraigStern

Woo! Pressure plates are now working. When a character walks onto a destructible object with a Pressure trigger, the character will stop moving and the associated script will run.

Triggers are added on a map-by-map basis by adding a trigger parameter in the <Unit> tag of the destructible object you want to use the trigger with. This, for instance, will add a Pressure trigger to a PressurePlate object and set it to trigger the script PressurePlateTrap:

<Unit trigger="Pressure,PressurePlateTrap">0,99,PressurePlate,0,9,None,None</Unit>

You can now specify the triggering character's coordinates using -Y- and -X-, useful for things like having particle effects on the space a script has been triggered.

New script action: DamageChar. Has three parameters: the name of the character to damage, the base damage to deal, and the element the damage belongs to (Pierce, Slash, Heat, etc.) Optionally, you can add a fourth parameter, which will serve like the affects parameter in an attack. (By default, DamageChar actions affect Health.)

This script will trigger a shower of smoke and sparks at the triggerer's location, and deal 8 base Heat damage to the triggerer:

  <Script>PressurePlateTrap
<Action>SpawnParticlesAt/Smoke,-Y-,-X-</Action>
<Action>SpawnParticlesAt/Sparks,-Y-,-X-</Action>
<Action>DamageChar/-FNAME-,8,Heat</Action>
  </Script>

CraigStern

I've uploaded a video showing traps in action!

Also, new script action: DamageCharAt. It's just like DamageChar above, but instead of one parameter with character name, it starts with two parameters: the target's Y and X coordinates.

The four parameters: the Y coordinate of the character to damage, the X coordinate of the character to damage, the base damage to deal, and the element the damage belongs to (Pierce, Slash, Heat, etc.) Optionally, you can add a fifth parameter, which will serve like the affects parameter in an attack. (By default, DamageCharAt actions affect Health.)

(This action is actually probably better suited for use with traps than DamageChar, since it can affect enemies without unique names identifying them who bumble into traps.)

The installers have been updated.

CraigStern

Added new destructible object trigger type: Use. Unlike Pressure triggers, Use triggers simply give the player the option to trigger the object when a character is adjacent to it and has not yet attacked. This will then run the associated script, just like a Pressure triggered object.

There is now a third type as well, Use Once. This creates an object that can be used once and only once. (Recommended for treasure chests!)

CraigStern

So, how do you code script for a Use trigger, since the player can keep activating it over and over? Here's an example:

<Unit trigger="Use,UseSwitch">0,99,Switch,7,11,None,None</Unit>

<Dialog>OnTurn/0//
<Action>SetVal/LightsAreOff,=,0</Action>
<Action>EndConvImmediately/</Action>
<Reply>.../EndConv</Reply></Dialog>
 
  <Script>UseSwitch
<Action>IfValRun/LightsAreOff,=,0,TurnLightsOff</Action>
<Action>IfValRun/LightsAreOff,=,1,TurnLightsOn</Action>
<Action>IfValRun/LightsAreOff,=,2,PrepLightsForTurningOn</Action>
  </Script>
 
  <Script>TurnLightsOff
<Action>ChangeCondition/Global Lighting,Night</Action>
<Action>SetVal/LightsAreOff,=,2</Action>
  </Script>
 
  <Script>TurnLightsOn
<Action>ChangeCondition/Global Lighting,Indoors</Action>
<Action>SetVal/LightsAreOff,=,0</Action>
  </Script>
 
  <Script>PrepLightsForTurningOn
<Action>SetVal/LightsAreOff,=,1</Action>
  </Script>


You'll notice we're doing a few things here. First, we've set up our Switch with a Use trigger that runs the script UseSwitch when it's activated. We've also set up our map so it sets a custom integer variable named LightsAreOff to 0 at the very start of the battle (that's what the OnTurn/0 dialog is for). So far so good!

Next, we have UseSwitch itself. UseSwitch simply checks the value of LightsAreOff to see what it should do next, then runs the appropriate script. If LightsAreOff = 0, then that means the lights are on and flicking the switch should turn them off; thus, it runs TurnLightsOff. If LightsAreOff = 1, then that means the lights are off and flicking the switch should turn them on; thus, it runs TurnLightsOn.

All simple so far, yes? The only thing that gets a little tricky is that IfXRun actions don't behave in an if/else manner; we can't just set LightsAreOff to 1 in TurnLightsOff, or else UseSwitch will detect that the value is 1 and turn them right back on in the very next line! We have to be a little tricky and set them to 2 in TurnLightsOff; then, once we've passed the second line in UseSwitch, we then change the value from 2 back to 1 using PrepLightsForTurningOn.

And now, just to prove that this actually works: here's a movie showing it in action!

http://youtu.be/Ru99YVUW5n8

CraigStern

There's now an optional sixth parameter that can be used with the SpawnChar action: triggers. This works just like triggers added to the <Unit> tag in a map, except that the trigger type and script to run are delimited with a colon instead of a comma.

Fixed a bunch of bugs (version number wasn't showing up, game froze whenever SpawnChar was used, etc.) and updated the installers.

Did some work figuring out what size portraits we'll need for larger characters (golems and such), and did a test to determine the appropriate size for mouth variations in anticipation of possible support for talking animations.

CraigStern


CraigStern

I've begin some preliminary work on random battlefield generation!

For a variety of reasons, I have decided to limit this feature to dungeons for now, since (a) dungeons are the environment with the greatest potential for interesting procedural configurations, and (b) making a generator that intelligently combined all of the various outdoor tilesets would be a nightmare. (And really, I'd like to get started working on the campaign itself again, so I'm limiting the feature to a scope that I know I can finish somewhat expeditiously.)

Right now, the plan is to create an algorithm that intelligently cobbles together dungeons out of 5 x 5 prefabricated chunks. (Below is a picture of one such chunk.) I haven't 100% decided on all of the details yet, but I imagine that hallways will mostly be 3 x 5 in size, some with destructible objects to form choke points. I'll post more about it tomorrow when I make more progress. :)

CraigStern

Today was a dull day governed by business, administrative and marketing work. Blegh. I will return to coding tomorrow.

CraigStern

Since we didn't have any super-exciting updates out of me today, how about some sweet new character portraits? :D

Here are the crossbowman and skiakineticist portraits:

CraigStern

Oh, also: Tyvon finished up the spriggat breath attack animations! :D

CraigStern

Fixed a bug that prevented OnReachingSpace from working when you specified a team but not a particular named character as required to trigger the dialog.

Laid more groundwork for random level generation. (This one's gonna take a while, folks.)

CraigStern

Created an updated version of the "What is Telepath Tactics?" trailer showing off some of the game's new character animations and portrait art!

In the process of collecting the footage, I discovered a number of bugs that I'm in the process of fixing.

CraigStern

Created new 4-player, multiplayer map: Tavern.

The Control key now allows you to examine space properties; Shift no longer has this function. (It was annoying me that the space info would pop up every time I used the Shift + E hotkey combo.)

I've finished updating the "What is Telepath Tactics?" trailer with new footage.

CraigStern

Here's a screenie from the Tavern map, making use of some new destructible object sprites (including new double doors that each occupy a single space!)

CraigStern

Fixed a bug where the game would freeze if a Lock or Unlock action failed to find a door at the listed coordinates.

Also: the spriggat animations are now done. We're moving on to the Stone Golem now. :D