Mandrake on 2/4/2005 at 00:28
Just thinking about how to make sure only weapons get set as dropable or not dropable - I think the way messages like this are done in the OM's is to have a script on the AI that "propogates" a certain message to all rigid attachments, and then you put a script ONLY on weapons which listens for that propogated message, and sets ITSELF dropable or not dropable.
So your two scripts would be attached to the weapon not the AI, but would be modified to listen for a propogated message instead of directly looking at the AI holstering state, and modified to change the drop property on ITSELF instead of rigid attachments.
Then you have a script on the AI that propogates the AI state message.
That way the holster state etc is propogated to all rigid attachment items on the guard (including coin bags etc) but only the weapon "listens" to the message and does something about it...
No triggerscript links required then, and weapon loadout can be used again, although it means one (maybe 2) extra scripts. I'll try it out anyway, as it should automatically avoid all the side effects we discussed.
Assuming this works, then health potitions etc will fall all the time as they do now, but by changing the Dontdropondeath property on the specific objects, such as health potions, we can decide whether they stay on the guard like Thief1/2 or drop like Thief3.
Mandrake on 2/4/2005 at 01:48
Looks like another thing that might need doing, is when an AI dies and their weapon DOESNT fall off, I think we need to add the weapon model to physics. (There is a script that does that)
The reason being, when they fall on the ground, depending on what angle they ragdoll, their sword can end up sticking straight into the ground or a nearby object, which isn't realistic at all. (The sword should prop them up, not go into the ground)
Bumbleson on 2/4/2005 at 06:35
Quote Posted by Mandrake
Err, I think that should be TRUE, not FALSE on your KeepWeapon script.
Oops! :o Changed!
Mandrake on 2/4/2005 at 07:46
Ok, here is a version of your scripts that makes using of propogated messages:
Attached directly to the Guard, or Guard archetypes:
Script: AIDropWeapon
Condition: When my behaviour state changes to [STATE_EQUIP_WEAPON]
Action: Propogate message [STATE_EQUIP_WEAPON] to linked object(s) [RigidAttachment]
Script: AIKeepWeapon
Condition: When my behaviour state changes to [STATE_HOLSTER_WEAPON]
Action: Propogate message [STATE_HOLSTER_WEAPON] to linked object(s) [RigidAttachment]
Attached directly to the weapon model (if manually attached) or to the weapon archetype:
Script: DropWeapon
Condition: When propogated message [STATE_EQUIP_WEAPON] detected on linked object(s) [MYSELF]
Actions: Set [DontDropOnDeath] to [FALSE] on linked objects of [MYSELF]
Script: KeepWeapon
Condition: When propogated message [STATE_HOLSTER_WEAPON] detected on linked object(s) [MYSELF]
Actions: Set [DontDropOnDeath] to [TRUE] on linked objects of [MYSELF]
The benefit of doing it this way even though it takes 4 scripts instead of 2, is that ONLY weapons have their DontDropOnDeath state changed, and things like health potions, bags of money, or any other objects that FM authors might choose to attach to AI's won't be inadvertantly affected, because none of them will be listening for these specific propogated messages.
I've tested that it actually works, and also that a health potion remains unaffected even after a guard is alerted then goes back into holster weapon mode :thumb:
Although I havn't tried it yet, it should be possible to add these scripts fairly high up the actor class hierachy so that they only have to be added in ONE or maybe two places to affect all AI types that have holstered weapons.
In fact it should be possible to make this easily into a mod for the standard game just by replacing the t3gamesys and adding the scripts to the scripts directory, something that I'll try later.
Now all that needs working on is at the point an AI is knocked out, we want to increase the highlight distance of the weapon so it can be picked up, and also I'll try to add physics to the weapon model so it can't stick through the ground... :)
Higgyq on 3/4/2005 at 04:03
Has anyone considered just keeping the weapon in the hand at all times like the original games? Then just remove the physics for it (like previously mentioned) so the the guard won't get proped up on it when he falls.
Mandrake on 3/4/2005 at 07:47
Quote Posted by Higgyq
Has anyone considered just keeping the weapon in the hand at all times like the original games? Then just remove the physics for it (like previously mentioned) so the the guard won't get proped up on it when he falls.
Err, why would we want to do that ? ;)
I actually like the way AI's holster and unholster weapons in T3. The silly thing is that the weapons fall to the ground from their holsters when knocked out.....
Higgyq on 3/4/2005 at 20:17
Yea I think that's cool too. I was just saying it might be easier to implement. Granted I am absolutely clueless as far as games development is concerned....
Bumbleson on 4/4/2005 at 22:29
By the way, there's no option to attach weapons to the hands of a guard (read: sword guard) via the weapon loadout.
Weasel on 4/4/2005 at 23:01
Quote Posted by Bumbleson
By the way, there's no option to attach weapons to the hands of a guard (read: sword guard) via the weapon loadout.
You can give an AI the property bWeaponAlwaysDrawn and set it to true. (I think I got the name of the property right).
jolynsbass on 4/4/2005 at 23:36
Mandrake and Bumbleson,
You two rule! You are doing all of us a great service with this discovery. Nothing is a disconcerting to me as knocking out a guard, hearing his sword make a huge clatter, and then realize that the guard just next to him didn't hear a thing! I would LOVE it if you guys figured out how to make this apply to not only FM's but the regular T3 as well. It would be a great addition. Keep up the good work! :thumb:
p.s. sorry if I left out anyone who has made significant contribution to this whole thing. It was not intentional, I just have seen a whole bunch from M and B, that's all...