Home » MODDING HQ 1.13 » v1.13 Idea Incubation Lab » New drug system 2: Electric Boogaloo
New drug system 2: Electric Boogaloo[message #341445]
|
Wed, 17 June 2015 22:59
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
Drugs are bad.
To be precise, the new drug system is flawed. When I overhauled the old system in '12, I left as much of the vanilla system intact as possible. As a result, there are a few problems:
- Items are designated to be drugs via a special flag, like <DrugType>1081344</DrugType>. This is indecipherable to anyone not having the list of drug flags, and combining drug effects (which was the original intention) requires a calculator.
- It is not possible to have 2 drugs have the same effect, but with different sizes of the intended effect.
- In Drugs.xml, there are <ubDrugTravelRate>, <ubDrugWearoffRate>, <ubDrugEffect>, <ubDrugSideEffect> and <ubDrugSideEffectRate>. This is much more complicated than it should be.
- Related to the above, drug effects over time are weird. Vanilla adrenaline has always been more or less broken.
- Curing diseases via drugs is possible, but as this has been added later, not as smooth as it could be.
- Internal handling of consumables (items that are consumed when we drop them onto the merc silhouette, like camo, food, drugs, clothes...) is ugly. We have to cross-check several times in order not to consume an item too early. Yuk.
- Applying drugs via projectiles (darts!) is a popular request. Works somewhat, but again, not as easy or functional as it could.
- If one wants a drug to have several 'shots', one has to declare it food, as only food allows an item to have a fixed, <100% consumption per 'bite'.
- Drugs forcing the merc to have a different personality is possible, but adding a new disability here requires new flags, xml entries etc. Not coder/modder-friendly.
- Altering personality is not possible.
- The drug overdose effect of taking too many drugs is only possible of consuming a lot of drugs very rapidly. I've never even heard of that happening unless intentional. Which is sad, as this would be a logical counter to taking too many drugs.
I plan to address all this... and more. I am not sure when I will have the time for that though.
The xml structure I have in mind should give you an idea:
- Drugs.xml: To be completely redone.
<DRUG>
<ubIndex>1</ubIndex> index of drug - Items.xml has the <DrugType>-tag that uses this number. No more flags here.
<name>Adrenaline</name> name, used in editor, does not show up ingame directly
<opinionevent>1<opinionevent> 1 - consumption causes dynamic opinion event OPINIONEVENT_ADDICT where other mercs complain about drug consumption
every effect can be defined individually - if you want multiple effects, add multiple of these
you can define for how many turns an effect lasts after consumption
planned effects:
+/- HP regen
+/- AP
+/- BP
+/- morale
+/- phys. resistance in %
others?
<EFFECT>
<effect>2</effect> type of effect
<size>5</size> size of effect
<duration>10</duration> turns this effect lasts
</EFFECT>
A drug can add points to a disease (defined in Disease.xml). This happens instantly (there is no point in doing this over time).
We can add points (cause or increase a disease) or substract points (heal a disease).
Multiple disease effects are possible.
If we define a new disease 'DRUG ADDICTION', we can finetune exactly how much each drug causes us to be addicted, what the effects are, hwo long they last etc. etc.
We could even define different addiction effects to different drugs.
<DISEASE>
<disease>2</disease> refers to a disease in Disease.xml
<points>10</points> disease points added
</DISEASE>
We can define what disability/personality we get after taking the drug. If coded smartly, adding a new one in the code doesn't require any changes in Drug code or xmls.
If we ever get to the point where we can have multiple disabilities/personalities at once, this should still work (duration would have to get a mean value though).
<DISABILITY>
<disability>5</disability> new disability we get after taking drug
<duration>10</duration> turns this effect lasts
</DISABILITY>
<PERSONALITY>
<personality>5</personality> new personality we get after taking drug
<duration>10</duration> turns this effect lasts
</PERSONALITY>
</DRUG>
- Food.xml: Remove <ubPortionSize>-tag
- AmmoTypes.xml: Remove <ammoflag>-tag flags that deal with drugs.
- Lookup/DrugType.xml: Can be removed entirely? Not sure, depends on Xml Editor
- Items.xml:
- Change <DrugType>-tag, which uses a flagmask, to <Drug>, which simple refers to a number in Drugs.xml
- Add <ubPortionSize>-tag. This now works for all consumables, so no need to define items as food that aren't supposed to. Ignored by camo, as camo items decide how much is consumed depending on soldier. Somewhat odd for clothes, but perhaps useful if someone defines a 'stack of T-Shirts' item.
- Evaluate <Drug> not only for misc items, but also for ammo (applied when a soldier is hit by bullet that came from this mag), explosives (applied when soldier is hit by explosion from this item), melee items (applied when soldier is hit by this item)... This allows for truly wacky items. Camo paint that gives you cancer. A gun that heals people. A grenade that causes pregnancy. This is what modders want, I am sure of it.
As I've received some feedback on the old system over the years, I would very much welcome it if others, especially heavy users (modders) were to have a look at this. Whether its not-thought-out mechanisms, obvious flaws, or even further requests (don't overdo it, smeagol ).
[Updated on: Thu, 18 June 2015 13:10]
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Mon Dec 02 15:01:58 GMT+2 2024
Total time taken to generate the page: 0.01023 seconds
|