Difference between revisions of "HPL2/AMFP/NewEntities"
m (Darkfire moved page Hpl2:Machine for pigs:new entity types to HPL2/AMFP/NewEntities: Reorganising old pages) |
(Syntax highlightin fix) |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
== PhoneBox == | == PhoneBox == | ||
− | The entity which executes phonecalls. There's only one such | + | The entity which executes phonecalls. There's only one such asset in the game, and the entity file doesn't have any User Defined Settings. In the Level Editor, it has multiple settings: |
* GlowEnabled - If on, the phone will glow like an inventory item until it's interacted with (even when it's not calling). | * GlowEnabled - If on, the phone will glow like an inventory item until it's interacted with (even when it's not calling). | ||
Line 19: | Line 19: | ||
Not all 7 entries must be used, but there can't be more than that in a single phonecall. | Not all 7 entries must be used, but there can't be more than that in a single phonecall. | ||
− | The PhoneBox entity has dedicated functions for it: | + | The PhoneBox entity has two dedicated functions for it: |
− | <syntaxhighlight lang=""> | + | <syntaxhighlight lang="cpp"> |
− | StartPhoneRinging(string &in asPhonebox); | + | void StartPhoneRinging(string &in asPhonebox); |
− | StopPhoneRinging(string &in asPhonebox); | + | void StopPhoneRinging(string &in asPhonebox); |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 30: | Line 30: | ||
The phone won't start calling until the ''StartPhoneRinging '' function is played. ''StopPhoneRinging '' can be used when e.g. the player leaves an area without picking up the phone, or takes too long. | The phone won't start calling until the ''StartPhoneRinging '' function is played. ''StopPhoneRinging '' can be used when e.g. the player leaves an area without picking up the phone, or takes too long. | ||
− | When | + | When <code>StartPhoneRinging()</code> is used, the phone will start ringing (the sound is only hearable in a quite short distance, and a bell animation will play) and the player will be prompted with a custom interaction icon to click on the phone. This will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used). |
− | + | Keep in mind that the green light which appears on the phoneboxes is not a part of the entity - it's a regular lamp entity which needs to be enabled by scripting. | |
== Enemy_ManPig == | == Enemy_ManPig == | ||
Line 38: | Line 38: | ||
This enemy type has multiple new settings in the LevelEditor. They are all documented in the editor hover-hints, but some of them require additional explanations: | This enemy type has multiple new settings in the LevelEditor. They are all documented in the editor hover-hints, but some of them require additional explanations: | ||
− | ''Hallucination ''- uses enemy_hallucination_disappear.snt, which isn't in the game files but could be modded in. The hallucination effect now consist of some organic particles instead of the TDD dust particle. | + | *''Hallucination ''- uses enemy_hallucination_disappear.snt, which isn't in the game files but could be modded in. The hallucination effect now consist of some organic particles instead of the TDD dust particle. |
− | + | *''Pose ''- determines whether the enemy will move and attack upright or on all fours. | |
− | * None - the enemy will stand in place. | + | *''ThreatenOnAlert ''- if ticked, the enemy will play an additional animation before chasing/fleeing from the player. |
− | * Stalk - the enemy will walk and on occassions run from node to node, sometimes also pausing along the way. | + | *''FleeFromPlayer ''- the enemy will run away when it notices the player. Running to the furthest pathnode seems to be the main behaviour. The monster will still attack if the player comes too close or encounters the monster after it fled. |
− | * Track - unspecified behaviour. Might be broken, unfinished, or dependant on particular circumstances. Testing resulted in same behaviour as None. | + | {{warning|Before setting this as true, make sure that your level has PathNodes - otherwise the game will crash when the monster notices the player!}} |
+ | *''AutoDisableAfterFlee ''- if the monster flees and can't be seen by the player anymore, it will disappear. | ||
+ | *''IdleBehaviour'' - determines what the enemy does when not engaged or patrolling (or when there are no patrol nodes left to walk to). Options are: | ||
+ | *# None - the enemy will stand in place. | ||
+ | *# Stalk - the enemy will walk and on occassions run from node to node, sometimes also pausing along the way. | ||
+ | *# Track - unspecified behaviour. Might be broken, unfinished, or dependant on particular circumstances. Testing resulted in same behaviour as None. | ||
== Enemy_Child == | == Enemy_Child == | ||
− | It is an enemy variation used for acting out scenes. It has some of the Pig enemy settings. However, | + | It is an enemy variation used for acting out scenes. It has some of the Pig enemy settings. However, most of them seem to have no effects. |
This "enemy" doesn't seem to respond to any player input, asides from proximity. | This "enemy" doesn't seem to respond to any player input, asides from proximity. | ||
− | It also has a lot of Level Editor settings ( | + | It also has a lot of Level Editor settings (statements marked with ''(?) '' marks haven't been confirmed): |
* AutoRemoveAtPathEnd - If enemy should be removed when it reaches the end of the path. | * AutoRemoveAtPathEnd - If enemy should be removed when it reaches the end of the path. | ||
Line 58: | Line 63: | ||
* Invisible, Blind, Deaf - don't seem to have any effect. | * Invisible, Blind, Deaf - don't seem to have any effect. | ||
* DamageMul - Doesn't seem to be useful since Child NPCs don't even have attack animations. | * DamageMul - Doesn't seem to be useful since Child NPCs don't even have attack animations. | ||
− | * RunSpeedMul - Multiplier; how | + | * RunSpeedMul - Multiplier; how many times faster than in the entities' settings (?) should the enemy run |
− | * PatrolMoveSpeed - Whether this NPC walks or runs along its patrol. One of the few ManPig settings which has actual effects. | + | * PatrolMoveSpeed - Whether this NPC walks or runs along its patrol. One of the few ManPig settings which has actual effects in this entity type. |
== AnimatedProp == | == AnimatedProp == | ||
+ | This type doesn't seem to have any particular use. It is unclear why it was added, as''.dae'' with animations will play automatically anyway, and <code>PlayPropAnimation()</code> isn't used with AnimatedProps. | ||
+ | == VoiceFlashbackTrigger == | ||
− | + | It's the type of all entities from ''entities/voice_triggers''. It seems that these entities weren't used in any of the maps, which makes this entity type unrestorable. | |
− | |||
− | |||
− | + | {{note|'''Note:''' This entity type is patched in the custom config so that it doesn't give errors when loaded into the editor. However, the intended functionality cannot be used and the editors will only show generic settings for the entity.}} |
Latest revision as of 16:59, 23 July 2020
Contents
New Entity Types
MFP features a few new entity types.
PhoneBox
The entity which executes phonecalls. There's only one such asset in the game, and the entity file doesn't have any User Defined Settings. In the Level Editor, it has multiple settings:
- GlowEnabled - If on, the phone will glow like an inventory item until it's interacted with (even when it's not calling).
- GlowColor - Pick the glow color
- GlowOutlineColor - doesn't seem to affect anything
- UpdateAnimationWhenCulled - Whether the animations should play when the phone isn't looked at (?)
- VoiceFile1 - The .ogg file to play. The file has to be located in the sounds folder or one of its subfolders.
- TextEntry1 - First subtitle lang entry. Category must be 'Voice'
- Delay1 - Time until the first subtitle is displayed
- TextEntry2 through 7 - the next subtitle entries.
- Delay2 through 7 - Time(s) since the last subtitle after which the next subtitle is displayed.
Not all 7 entries must be used, but there can't be more than that in a single phonecall.
The PhoneBox entity has two dedicated functions for it:
void StartPhoneRinging(string &in asPhonebox);
void StopPhoneRinging(string &in asPhonebox);
asPhonebox - the phone box entity to use
The phone won't start calling until the StartPhoneRinging function is played. StopPhoneRinging can be used when e.g. the player leaves an area without picking up the phone, or takes too long.
When StartPhoneRinging()
is used, the phone will start ringing (the sound is only hearable in a quite short distance, and a bell animation will play) and the player will be prompted with a custom interaction icon to click on the phone. This will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used).
Keep in mind that the green light which appears on the phoneboxes is not a part of the entity - it's a regular lamp entity which needs to be enabled by scripting.
Enemy_ManPig
This enemy type has multiple new settings in the LevelEditor. They are all documented in the editor hover-hints, but some of them require additional explanations:
- Hallucination - uses enemy_hallucination_disappear.snt, which isn't in the game files but could be modded in. The hallucination effect now consist of some organic particles instead of the TDD dust particle.
- Pose - determines whether the enemy will move and attack upright or on all fours.
- ThreatenOnAlert - if ticked, the enemy will play an additional animation before chasing/fleeing from the player.
- FleeFromPlayer - the enemy will run away when it notices the player. Running to the furthest pathnode seems to be the main behaviour. The monster will still attack if the player comes too close or encounters the monster after it fled.
- AutoDisableAfterFlee - if the monster flees and can't be seen by the player anymore, it will disappear.
- IdleBehaviour - determines what the enemy does when not engaged or patrolling (or when there are no patrol nodes left to walk to). Options are:
- None - the enemy will stand in place.
- Stalk - the enemy will walk and on occassions run from node to node, sometimes also pausing along the way.
- Track - unspecified behaviour. Might be broken, unfinished, or dependant on particular circumstances. Testing resulted in same behaviour as None.
Enemy_Child
It is an enemy variation used for acting out scenes. It has some of the Pig enemy settings. However, most of them seem to have no effects.
This "enemy" doesn't seem to respond to any player input, asides from proximity.
It also has a lot of Level Editor settings (statements marked with (?) marks haven't been confirmed):
- AutoRemoveAtPathEnd - If enemy should be removed when it reaches the end of the path.
- AutoReverseAtPathEnd - If enemy should turn around (?) when it reaches the end of the path.
- IsOccluder - function unknown, possibly related to rendering or lighting
- AutoRemoveMinPlayerDistance - At what distance from the player to remove the NPC (?)
- Invisible, Blind, Deaf - don't seem to have any effect.
- DamageMul - Doesn't seem to be useful since Child NPCs don't even have attack animations.
- RunSpeedMul - Multiplier; how many times faster than in the entities' settings (?) should the enemy run
- PatrolMoveSpeed - Whether this NPC walks or runs along its patrol. One of the few ManPig settings which has actual effects in this entity type.
AnimatedProp
This type doesn't seem to have any particular use. It is unclear why it was added, as.dae with animations will play automatically anyway, and PlayPropAnimation()
isn't used with AnimatedProps.
VoiceFlashbackTrigger
It's the type of all entities from entities/voice_triggers. It seems that these entities weren't used in any of the maps, which makes this entity type unrestorable.