aliens

Author Topic: A Few Questions Regarding The Rulesets  (Read 3847 times)

Offline Cirius

  • Captain
  • ***
  • Posts: 64
    • View Profile
A Few Questions Regarding The Rulesets
« on: May 08, 2013, 10:18:47 pm »
Apologies if this topic is in the wrong place.

Now I've started work on the dalek mod, I'm getting a little bit confused when it comes to comprehending the rulesets.

How do you attach a species-specific weapon to a creature, like the cyberdisk/silacoid? I note there's a - type: ***_WEAPON section that defines what the weapons do, but I'm not seeing anywhere in the ruleset that actually covers their assignment to the creature itself?

I'm guessing it has something to do with the 'itemsets' further down the ruleset, but I'm flummoxed nonetheless.

Misc Questions:
What does the 'fixedWeapon: true' field do?
I'm presuming 'spawnUnit:' determines what unit is spawned by the death of the zombie. Will this work if added to other units?
Likewise with the  Chrysallid's 'zombieUnit:' field. Is this hardwired to the Chrysallid, or can I merrily add it to other units to enable zombification?

What do the Cyberdisk & Silacoid's 'specab' refer to?

Again, forgive my interminable questions. I'm sorry if the rulesets have been explained somewhere and I just haven't seen it. If not, we could really do with a wiki or tutorial somewhere.
« Last Edit: May 08, 2013, 10:22:22 pm by Cirius »

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: A Few Questions Regarding The Rulesets
« Reply #1 on: May 08, 2013, 10:53:55 pm »
When a unit of rank terrorist is spawned, it will automatically get a weapon from the ruleset of type <race name>+_WEAPON. The race name is the link.

when fixedWeapon = true, it can not be thrown (if you control the unit, you don't see throw in the menu), it will not be dropped when you die or get stunned. It's also used in the drawing code and also when equipping a craft, ammo stuff, battlescape generation and debriefing... basically to make a weapon be part of a unit, but have the functionality of a weapon.

spawnUnit/zombieUnit with other units, I would say: try and see :)

specab is an enum in the code: enum SpecialAbility { SPECAB_NONE = 0, SPECAB_EXPLODEONDEATH, SPECAB_BURNFLOOR, SPECAB_RESPAWN };
so 1 = explode on death , 2 = burn floor.
You can add them to other units if you want.



Offline Cirius

  • Captain
  • ***
  • Posts: 64
    • View Profile
Re: A Few Questions Regarding The Rulesets
« Reply #2 on: May 08, 2013, 11:37:57 pm »
Thanks a lot, I just spotted the fixedweapon info in the ruleset, but that's all good to know.

I still haven't figured out how to get the terrorist weapon spawning working though. I've added a straight copy of the cyberdisk_weapon to the list, but changed the name to ETHEREAL

type: ETHEREAL_WEAPON
    weight: 3
    bigSprite: 40
    floorSprite: 31
    handSprite: 104
    bulletSprite: 8
    fireSound: 18
    hitSound: 19
    hitAnimation: 46
    power: 130
    damageType: 5
    accuracySnap: 75
    accuracyAimed: 110
    tuSnap: 30
    tuAimed: 60
    clipSize: -1
    battleType: 1
    fixedWeapon: true
    invWidth: 2
    invHeight: 3
    recover: false

Given that there is no ethereal terrorist, I'm guessing I need to create one elsewhere in the list?
I've run a quick search for ethereal, and added _terrorist to where it seemed necessary, but all I'm getting is a crash when I attempt to run the game.
« Last Edit: May 09, 2013, 12:51:21 am by Cirius »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2159
    • View Profile
Re: A Few Questions Regarding The Rulesets
« Reply #3 on: May 10, 2013, 05:45:53 pm »
Fixed weapons work a bit special, given they're hardcoded to mimic original X-Com behavior. Basically:
- Only terrorist units can have fixed weapons.
- For an alien unit to be considered a terrorist, it needs to have "rank: STR_LIVE_TERRORIST" in its unit definition.
- Terrorist units can't use regular weapons, and will automatically be assigned a fixed weapon with a matching name.
- For example if the unit's race is "STR_SECTOPOD", the fixed weapon must be called "SECTOPOD_WEAPON".

My suggestion would be, if you wanna make the Daleks work like a terrorist unit, to use an existing terrorist unit as the basis for the modification, so you will avoid errors. For example instead of trying to turn an Ethereal into a terrorist unit, just take an existing terrorist unit (eg. Sectopods) and change them to Daleks and  see how it works. Once you got the hang of it, you can make them their own separate unit/race (instead of a Sectopod replacement).