Frictional Games Forum (read-only)

Full Version: Unlimited stun baton script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
EDIT:
I'm reading the scripting page https://wiki.frictionalgames.com/hpl3/ga...layer_tool
Can unlimited stun baton be achieved like this?
1)call script that gives stun baton in inventory
2)Player_ToolIsInInventory - checks to see if the player has picked up a tool with this name.
3)Player_EquipTool -> stun baton - the player holds up the tool in his hand if it's in the inventory.
4)if Player_EquipTool -> omnitool, then Player_UnequipTool -> stun baton (for the main gameflow)
5)set Player_RemoveTool to zero because we don't stun baton be removed from inventory


And with that we probably have to use PlayerHands_PlayAnimation
Creating the stun baton object itself would be fairly simple, granted one knows how to generate the model, put it together in the ModelEditor, and mark it as a tool. Then you could use any or all of those four functions in your map's logic to determine how a player might pick it up, equip/unequip it, or lose it. Even that is fairly trivial, and you can download the developer-created short campaign for a simple example of how to pick up and equip a tool, then using the tool on the proper target.

Actually implementing it into the game would be a different matter. As far as I can tell, there aren't any built-in weapons in the code base, so setting up a system that would handle the using of the weapon, including the collision detection and handling of any damage dealt (as I'm not sure if monsters/enemy characters have health) and anything else involved with putting that together would have to be coded from the ground up.
(10-14-2015, 12:21 PM)Abion47 Wrote: [ -> ]Actually implementing it into the game would be a different matter. As far as I can tell, there aren't any built-in weapons in the code base, so setting up a system that would handle the using of the weapon, including the collision detection and handling of any damage dealt (as I'm not sure if monsters/enemy characters have health) and anything else involved with putting that together would have to be coded from the ground up.

As far as I know, everything has health, but:

1. Not everything has a "death" animation.
2. As such, not everything has a "broken" animation (the glass smashing when the chair collides with the window in the first moments is a good example here).
3. If the stun baton is implemented, if the way enemies health systems worked, at least back in Amnesia, was if the enemy was stunned by a chair, they lost health, but it practically immediately climbed back to 100, so you may have to edit the cores of certain enemies or enemy classes as well.
You just want to create a super space alien gun to kill some monsters don't you? :3
(10-14-2015, 03:41 PM)TheTieMan Wrote: [ -> ]You just want to create a super space alien gun to kill some monsters don't you? :3
To zapp them momentarily [Image: depressed-smiley-emoticon.gif] when I hide [Image: afraid.gif]
Okay, it took me watching a Let's Play to remember what the stun baton actually was, so that's my misunderstanding painted in neon letters. I thought this was about an actual swung weapon rather than a tool that had a special interaction with specific entities and/or types of entities.

So yeah, in that case, what you propose would work, although I'd suspect that you would also have to edit all the kinds of enemies you want to be able to stun in order to be able to actually stun them.