Food & Drink Script
Alright first upload. It's fairly simple actually, the way I've done it can be refined further (as TScript gurus will surely be able to do and point out) I can already see an improvement to be made, however that is irrelevant really.
What I've done is supplied three canteens, two of them heal you, the third will cause you to become irradiated, and you will slowly die of radiation poisoning (this is all best viewed with ATX HUD on or in a level with a working Anne tattoo) each canteen has it's own TScripted trigger (it has to have its own, I can't think of a way to globalise it) and performs a sequence of grouped actions.
Here's the Script itself:
Code: Select all
group Trig_PCanteen01Drink = {
string Class = "CObjectTrigger"
string A00 = "<INSERT INSTANCE NAME>"
bool UseObject = true
int ProcessStyle = 3
int FireCount = 1
group Action00 = {
int ActionType = 34
string OverlayText = "Drank: Water"
float R = 0.000000
float G = 1.000000
float B = 0.000000
float TextDisplayTime = 2.500000
int TextPosition = 0
}
group Action01 = {
int ActionType = 23
string Sample = "DINO-CARN-SWALLOW"
string Emitter = "Player"
}
group Action02 = {
int ActionType = 17
string ObjectName = "Player"
float Damage = -10.000000
}
}
This is an ObjectTrigger, which activates only when you use the instance specified by A00 and it fires once and never again. Actually now that I think of it, you can use FireCount to give items multiple uses. I believe ObjectTriggers only fire if you PickUp/PutDown/Use the item, so FireCount won't change unless you do one of those actions.
If the instance was used, Action00 is run which displays the text in green.
Action01 plays the swallow effect sound borrowed from the Carnivore swallow
Action02 heals the player, negative damage adds health.
Some more information as well, well suggestions.
AT #17 can modify a few different things. You can set the HitPoints value, MaxHitPoints, Regeneration (how much health regenerates over time, I believe 1.0 is 1 hp per second... which is the default IIRC, and 0.0 heals no hp over time.) and so on. You can do all sorts with just these values. Be creative
Also with the overlay text, it might be best to come up with a few different items, eg; good, mild, bad for instance. And colour code the overlay text. Green == Good, Orange == Mild, Red == Bad, this way, at a glance, players can easily tell if the effect was good or bad.
One thing I will say about this script is that Anne plays her "Ouch" VO and the screen flashes white (not so bad, I like the effect
) ATX has a fix for this I believe, in the form of ATX AT #104 which allows you to modify the player's health without VO and effects.
Also as a final note, hopefully people remember my toxic gas trigger in beta-PF
that was achieved via ActionType 17
remember to experiment and be creative.
That's all for this post... might wrangle another interesting script tonight though. Thanks for reading folks.
EDIT:
Sorry, the forum tells me that we've reached the board attachment quota :/ So I uploaded it to mediafire:
http://www.mediafire.com/?q2nnt3i227d8r51
I might, in future, upload it to my webhost instead.