The Vault Dev. Canteen (General Discussion)

I'll knock up some documentation on the new trait tags. Its very different, much more flexible that the old mechanism. It works a bit like the event system in that you have the definition of the Trait in one file with another file (TraitTriggerInfos) defining when the trait counter is changed, and by how much. The events (Hooks) that can cause the counter to be changed are stored as enum values so are defined in /Assets/XML/GlobalTypes.xml .... this is going to make you go :crazyeye: until you get your head round it, but it's a better system once you understand how the pieces fit together

Process in short is:

1 - Game runs along until it reaches a hook (e.g. one unit killing another) from the GlobalTypes.xml in the dll code
2 - All the TraitTriggersInfos that are associated with that hook are then processed
3 - Traits get their counters changed based on the info in the TraitTriggerInfo

I have only added the places where GreyFox had hooks to change the counters for now, so I need to expand it a bit to add some new ones in such as Improvements being built, etc. The way it is coded makes it very simple to add new hooks so those can be added almost at will.

I have moved the existing trait changes over to the new system where there are hook's in place for them so you have some examples. The easiest way is to look at the examples in the TraitTriggerInfos and work your way backwards from there.

Walking through a couple of simple examples:
a - When the player constructs any building increase the Industrious trait counter by +5
b - When the player constructs a religious shrine increase Spritual by 10%, but the change must be at least +5 and capped at +25 additionally increase Organised by +2

Spoiler :

The process is the same for both:
1 - Identify the hook and any available options you need from GlobalTtpe.xml file. In this case it is the TRAITHOOK_CONSTRUCT_BUILDING and we have the shrine option. The options will all have a corresponding prereq tag in the TraitTrigger file

2 - Identify the traits from the Trait file: TRAIT_INDUSTRIOUS, TRAIT_SPIRITUAL & TRAIT_ORGANIZED

3 - Create the trait triggers that links these together.
Each trigger has 2 main parts: The trait change section and the prereq section. You can combine multiple trait changes into a single trigger IF the prereqs match. In our case we have 2 different sets of prereqs: 'all buildings' and 'shrine only' so we need 2 triggers.

All Buildings
======================
Firstly we need to define a unique name for the trigger:
Code:
<Type>TRAITTRIGGER_ALL_BUILDINGS</Type>

The trait change section is all contained in a single tag <CounterChanges> to increment Industrious by 5 we would use:
Code:
<CounterChanges>
  <CounterChange>
    <TraitType>TRAIT_INDUSTRIOUS</TraitType>
    <iModifier>5</iModifier>
  </CounterChange>
</CounterChanges>
You then need to define under what conditions these changes are made.
You always need to define the hook, and optionally any prereqs. For the all buildings there are no addtional prereqs so we just need the hook:
Code:
<TraitHookType>TRAITHOOK_CONSTRUCT_BUILDING</TraitHookType>

Now we can put the complete all buildings TraitTrigger together:
Code:
<TraitTriggerInfo>
  <Type>TRAITTRIGGER_ALL_BUILDINGS</Type>
  <CounterChanges>
    <CounterChange>
      <TraitType>TRAIT_INDUSTRIOUS</TraitType>
      <iModifier>5</iModifier>
    </CounterChange>
  </CounterChanges>
  <TraitHookTypes>
    <TraitHookType>TRAITHOOK_CONSTRUCT_BUILDING</TraitHookType>
  </TraitHookTypes>
</TraitTriggerInfo>

Building a Shrine
============================
The second scenario is for when a shrine is built. Firstly define its unique name
Code:
<Type>TRAITTRIGGER_BUILDING_SHRINE</Type>

There are 2 traits that get modified in this scenario so we need 2 entries in the <CounterChanges> element. The first to say that Spiritual gets a 10% increase in the trait counter, but will get at least +5 and no more that 25; the second to give Organised a flat +2 to the counter
Code:
<CounterChanges>
  <CounterChange>
    <TraitType>TRAIT_SPIRITUAL</TraitType>
    <iPercentChange>10</iPercentChange>
    <iPercentChangeMin>5</iPercentChangeMin>
    <iPercentChangeMax>25</iPercentChangeMax>
  </CounterChange>
  <CounterChange>
    <TraitType>TRAIT_ORGANIZED</TraitType>
    <iModifier>2</iModifier>
  </CounterChange>
</CounterChanges>

We now need to define the hook, which is the same as before
Code:
<TraitHookType>TRAITHOOK_CONSTRUCT_BUILDING</TraitHookType>

In this scenario we also have a prereq condition (Shrine) so look for the assocated tag in the Trigger:
Code:
<bPrereqShrine>1</bPrereqShrine>

Putting it all together we get:

Code:
<TraitTriggerInfo>
  <Type>TRAITTRIGGER_BUILDING_SHRINE</Type>
  <CounterChanges>
    <CounterChange>
      <TraitType>TRAIT_SPIRITUAL</TraitType>
      <iPercentChange>10</iPercentChange>
      <iPercentChangeMin>5</iPercentChangeMin>
      <iPercentChangeMax>25</iPercentChangeMax>
    </CounterChange>
    <CounterChange>
      <TraitType>TRAIT_ORGANIZED</TraitType>
      <iModifier>2</iModifier>
    </CounterChange>
  </CounterChanges>
  <TraitHookTypes>
    <TraitHookType>TRAITHOOK_CONSTRUCT_BUILDING</TraitHookType>
  </TraitHookTypes>
  <bPrereqShrine>1</bPrereqShrine>
</TraitTriggerInfo>


When the game runs and any player constructs a building both these triggers will be processed for the player completing the building. The first trigger will always fire (make the defined trait counter changes) as it has no additional prereqs, but the second will only fire if the building is a shrine.
 
Question: I am in the process of getting a new computer. Even though windows XP is obviously the one true OS it is somewhat limited in processing power and lack of support for onboard wifi/missile lauchers.

Anyway the new computer has integrated graphics so I am trying to install a GPU. The issue is, is that the computer doesn't have any free power supply wires and the GPU appears to have space for two. At the same time the directions on installation of the GPU do not state that connecting the GPU to a power supply is nesecary.

The directions simply state to snap the graphics chip into the slot on the motherboard. Am I to assume that the GPU will pull all necessary power from the motherboard?

Sorry not trying to bury you with computer questions.
 
I think that is correct yes,I am just trying to recall if I have to plug/unplug a cable, and I don't think I do... I had a quick look through the window in my computer, and I don't see any wire coming out.

I think I often have to navigate it 'around' some wiring to get it in and out, rather than plugging/unplugging something which is where my current confusion lies.

The only other thing is to check that your power supply can handle the GPU wattage needs. I imagine it will, unless you have bought some $200+ monster card that requires it's own off grid fallout shelter to power it.
 
I think that is correct yes,I am just trying to recall if I have to plug/unplug a cable, and I don't think I do... I had a quick look through the window in my computer, and I don't see any wire coming out.

I think I often have to navigate it 'around' some wiring to get it in and out, rather than plugging/unplugging something which is where my current confusion lies.

The only other thing is to check that your power supply can handle the GPU wattage needs. I imagine it will, unless you have bought some $200+ monster card that requires it's own off grid fallout shelter to power it.

The GPU is just about an inch too long to fit in the case. There is enough space for the actual chip itself but not the fan that is attached to it. Which unnecessarily has a fin jutting out of it. I guess it needed to be more aerodynamic.
 
I somehow got it in the case. I had to put it in at an angle and then rotate it and move a few wires and such out of the way. Without plugging in the 6 pin wire. Unfortunately its not really doing anything. It turns out it really did need power.

 
I think I finally got it working. I got a few things to finish up on my current PC then I'm gonna switch over to this new one.
 
Nice one!

Ugh I have still got so many things to do to get the A5 Patch 2 finished...

I wish it didn't cause me such a headache! :D

I also have to finish upgrading my computer, I bought a new Graphics Card (When I thought my old one was broken but then it seemed to come back to life?!?) that is 2gb rather than 1gb.

I also have to hook up my old hard drive (now I hopefully have a a new and correct cable) and transfer everything over to my new hard drive, so that I can get reformat the old one and remove all the crud from it.then I will have a whopping 5tbs (4 internal and 1 external) of storage! RAAAH!

I also bought a new Computer for £200 which is pretty much better spec in every way than my current PC that has almost £1000 invested in it, but that has been over nearly 10 years. But still £200! Bargain! Now if only i had some friends to play LAN games with...
 
Ok, for some reason the OrPrereq tag for tech triggers in events does not work...

put NONE, event triggers, put in a tech and the event does't trigger when the tech is researched..

I will try and trigger see if that works instead!

EDIT:

Nope that doesn't work either...

Well that is a pain in the arse that is going to make things rather problematic...
 
Ok, for some reason the OrPrereq tag for tech triggers in events does not work...

put NONE, event triggers, put in a tech and the event does't trigger when the tech is researched..

I will try and trigger see if that works instead!

EDIT:

Nope that doesn't work either...

Well that is a pain in the arse that is going to make things rather problematic...

I have been having a similar problem with python concerning a zombie "promotion" It doesn't want to spawn the zombie.
 
Yeah it doesn't even want to run the trigger when it has a tech selected..

The python spawner seems to be fine, one thing I didn't check was whether the barbs would attack the city or not, but that is not improtant in this moment.

it is really annoying because it is going to be hard to spread out events across the timeline without being able to use a tech prereq..

I am also going to have to go through and see what other tags are not working..

If it is a lot then I have to try and figure out what would break the tags in events.

Is your idea that you replace one unit with a zombie on a certain event?
 
Top Bottom