sNeaksieGarrett on 19/7/2013 at 14:59
Cool, thanks Watcher!
Larry, here's NV's response:
Quote Posted by Nameless Voice
Dropdown lists are treated as numbers, usually from 0 (first entry) onwards.
For some reason, the Contains link starts at -3. So try:
Try NVLinkBuilderLinkData#Field=-3
Don't ask me why it's -3.
Didn't work though. :/ Oh, and I changed it to this instead: NVCreateAndLinkLinkData#Field=-3; since that's actually what we're using. Should be the same as doing the above.
LarryG on 19/7/2013 at 17:20
Quote Posted by The Watcher
I'll see if I can put something together to test this evening, I promise nothing but there shouldn't be anything particularly hard there.
Great! Thanks.
The Watcher on 19/7/2013 at 22:52
I have a script done that should do the job, but I still need to document it, test it properly, and put together an example for sNeaksieGarrett to copy. It's midnight here now, and I'm going to qwertyface if I don't sleep soon, but I'll try to have it all ready (provided nothing unexpected arises!) by this time tomorrow.
[edit]So, something unexpected has arisen: something is corrupting several script variables, and trying to trace why is proving distinctly non-trivial. More when I find it out...[/edit]
The Watcher on 20/7/2013 at 23:29
Okay, good news: I found out what was causing the bizarre behaviour I was experiencing (and it is truly odd), and I now have a working breath system. Setup involves:
- add a ~ParticleAttachement link from the AI archetype to an appropriate SFX archetype (say a new one called 'AIBreath' for example)
- add Tweq -> Flicker: {Continue; [None]; Scripts; [None]; 3000} to the AI Archetype
- add Tweq -> FlickerState: { On; [None]; 0; 0} to the AI Archetype
- add an Editor -> Design Note containing
Code:
TWTrapAIBreathSFX=AIBreath;TWTrapAIBreathColdRooms=Outside,Cellar
Now any time the AI enters the 'Outside' concrete room(s) or the 'Cellar' concrete room(s) the particles attached to the AI are made active, and when the AI leaves those rooms the particles are deactivated. Scaling the breathing rate based on alertness is working,
Bad news is that it isn't quite ready yet: I still need to sort out handling knockouts and death. But progress!
LarryG on 20/7/2013 at 23:48
Awesome!
sNeaksieGarrett on 21/7/2013 at 01:22
Great! But in terms of death/knockout, couldn't I just link the SFX particle from a destroytrap linked from the AI? That's what I've already done with the old setup.
LarryG on 21/7/2013 at 02:35
The script uses the archetype, not a concrete SFX, and IIRC what you did was link the emitter to the destroy trap. So no, you couldn't do that with the new script. This eliminates the need for the all that Rube Goldberg setup.
Sounds like you just put the script on the AI archetype and link the archetype to the SFX archetype (which you already have), a flicker tweq to set the timing of the puffs, and some outside concrete rooms, and you're all set. This is very different, and sounds much simpler.
The part I worry about is the particle attachment link to the AI archetype. From what we've seen, that's not a good type of attachment for positioning the breath puffs at the mouth ... but I will reserve judgement until the script is done. I would prefer not to attach the particle to the AI, but instead to just position it with respect to the AI and let it stay there. That's more natural for a breath puff anyway. Once you breath out, the breath is not attached to you.
sNeaksieGarrett on 21/7/2013 at 15:00
Hi Watcher. I tried your demo and it seems to work great (I even tried knocking the guard out and the breath disappeared just fine), except for the fact that it's the wrong particle (but of course because you don't have the same setup as me) and it emits behind the guard's head. If you mess with Particle Launch Info you can get it to appear in front of the guard's face. I just need to test this with my actual breath particle.
Quote Posted by LarryG
I would prefer not to attach the particle to the AI, but instead to just position it with respect to the AI and let it stay there.
That's actually a pretty good point, because one of the flaws of using one of the attachment types (don't remember which one, but my original breath setup with emitter/Contains link works fine) is that if the AI leans forward while in search mode for example, the breath will appear in a different spot instead of in front of the guard's mouth. Actually, I think it has to do with modifying Particle Launch Info, because you're basically forcing the breath to appear at a certain spot that is different from the default.
The Watcher on 21/7/2013 at 15:57
Quote Posted by sNeaksieGarrett
I just need to test this with my actual breath particle.
As I stated in my PM, This is incomplete alpha code. While you may want to try that, I can pretty much guarantee it's not going to work properly, and you almost certainly don't want to use that twscript.osm anywhere because it contains a number of problems.
A quick demo of the current version:
[video=youtube;oeHtDMiEQB4]http://www.youtube.com/watch?v=oeHtDMiEQB4[/video]
What it does right now:
* Turns on and off automatically (no additional fnords and Rube Goldberg setup needed), when the AI enters and leaves concrete rooms listed as 'cold' in the script's design note
* Scales the breath rate based on alertness level (AI breathes faster at higher alert levels)
* AIs continue breathing when knocked out (see later), and the breath particles will be turned on and off automatically when the body is carried into or out of cold areas.
* When the AI is killed the breath effect stops
What it doesn't do right now:
* Have any end-user docs, I'm working on that now.
* When AIs are knocked out, the particle group ends up in the wrong place. I'm really not sure how much can actually be done about this.
* The emitted particles are relative to the particle group, so sharp turns while the AI is breathing out can look a little odd from some angles. Again, I'm not entirely sure what can be done about that either, as the particle object needs to track the mouth location.
I'm going to fix up the docs, release it properly as it's working good enough for a general approximation, and then see if I can work out a way to deal with the remaining problems.
Oh, yes, and I forgot there is one significant issue that is likely to be impossible (or nearly so) to solve: the breath particles are turned on by a tweq and off by a timer. This works fine, but it also entirely ignores things like AI speech, whistles, and other vocalisations (as you can tell in the video). I'd be
amazed if there was much I could do about that.
sNeaksieGarrett on 21/7/2013 at 17:26
Great, thanks for doing this.
"when AIs are knocked out, the particle group ends up in the wrong place."
That can be solved by turning off the breath, right? While Larry mentioned having it still emit while they are knocked out, to be honest I don't think that's really necessary and if this is too much trouble you might as well just have it shut off in my opinion. Maybe that will save you some time?
Quote:
This works fine, but it also entirely ignores things like AI speech, whistles, and other vocalisations (as you can tell in the video). I'd be amazed if there was much I could do about that.
That's really more than I need. I'm not that picky.:p No problem if you can't get that to work, I never even considered that to be an issue. Also, the time between breaths should be a bit longer in my opinion, which I assume I can modify myself once you release the workable "final" version.. so this may actually end up not being an issue because the guard may have finished whistling by the time the next breath appears.
Also, I'm curious how you actually go about writing a script for thief? What software do you use/what programming language? How hard would it be for someone who isn't an expert programmer to write a script for thief?