-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathZScript.zsc
More file actions
72 lines (65 loc) · 6.06 KB
/
ZScript.zsc
File metadata and controls
72 lines (65 loc) · 6.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*=============================================================================================================================
___ ___ ___ ___ ___ ___ ___ ___
/\__\ /\ \ ___ /\__\ ___ /\ \ /\ \ /\ \ /\ \ |\__\
/:/ / /::\ \ /\ \ /:/ / /\ \ /::\ \ /::\ \ /::\ \ /::\ \ |:| |
/:/__/ /:/\:\ \ \:\ \ /:/ / \:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ |:| |
/::\__\____ /::\~\:\ \ /::\__\ /:/ / /::\__\ /::\~\:\__\ /::\~\:\ \ /::\~\:\ \ /::\~\:\ \ |:|__|__
/:/\:::::\__\/:/\:\ \:\__\ __/:/\/__/ /:/__/ __/:/\/__//:/\:\ \:|__|/:/\:\ \:\__\/:/\:\ \:\__\/:/\:\ \:\__\ /::::\__\
\/_|:|~~|~ \/__\:\/:/ //\/:/ / \:\ \ /\/:/ / \:\~\:\/:/ /\/_|::\/:/ /\/__\:\/:/ /\/_|::\/:/ //:/~~/~
|:| | \::/ / \::/__/ \:\ \\::/__/ \:\ \::/ / |:|::/ / \::/ / |:|::/ //:/ /
|:| | /:/ / \:\__\ \:\ \\:\__\ \:\/:/ / |:|\/__/ /:/ / |:|\/__/ \/__/
|:| | /:/ / \/__/ \:\__\\/__/ \::/__/ |:| | /:/ / |:| |
\|__| \/__/ \/__/ ~~ \|__| \/__/ \|__|
===============================================================================================================================*/
Version "4.14.0"
//CUSTOM CODE TAGS:
//DOCUMENT: This bit of code needs documentation.
//PLAYTEST: The code has been written, but not tested, so it might be buggy.
//URGENT: This is something urgent, likely a bugfix, some really visible debug code I don't want to appear in-game etcetera.
//CREDIT: This is to credit some bit of code or function to someone else. Usually when someone else helps me with writing some code.
//DEBUG: Unlike the defintion on Wikipedia, here this signifies some bit of debugging code, probably something that should be removed or commented out before a full release.
//MAYDO: Unlike TODO, this means that it's something I may or may not do. Hence the name.
//IDEA: This is just an idea for the project. Likely some far away goal that would take a lot of time to implement.
//IDEA:
/*Today (1/7/2023) I made a suggestion to PBs' developers on how to implement the hitbox system to monsters. Move the hitbox handling to a HandleLocalDamage
virtual, change the hitbox factors (e.g if an attack hit 0.8 of the monsters' height or above ,it hit the head) into properties instead of hardcoded values etc.
Maybe I should add locational damage to the library as well based on this suggestion ? Might be out of scope though, since this is an AI library.
The body part types for normal NPCs should be PART_HEAD, PART_TORSO, PART_LEG, and PART_ARM.
For vehicles it should be PART_ENGINE, PART_WHEEL (With an alternate PART_TRACK name too), PART_SENSOR (?).
These parts should be interchangeable between NPC types, especially for vehicles. Since a vehicle like a mech can have legs, arms, and an engine.
Also add generic hit locations for what part of the hitbox was hit relative to the victims' angle. HIT_FRONT, HIT_BACK, HIT_LEFT, HIT_RIGHT, HIT_TOP, HIT BOTTOM.
This one will be especially useful for vehicles, allowing me to for example, make the top and back of the MBT more vulnerable compared to the sides and front.
Since these part types will just be ints, it should also be able to define custom parts similar to thread levels. Like PART_DICK, PART_FOOT, PART_HAND etc.
Add a GetBodyPart virtual to NPCs, to define positions for parts, and return the right part based on position. Callable from other actors like projectiles,
allowing for projectiles to do special effects like double damage on headshots.
Maybe also add an OnBodyPartHit callback for projectiles to use. Such as to make the victim itself react to a headshot. Or the back of the tank being hit.
*/
//Ugh, try making velocity-based movement for ground actors again using the KMT_3D code?
//Behavior module ideas, for when that's FINALLY put into a goddamn release.
//Make a multi-target and priority queue system. Like, for having NPCs optionally target multiple enemies and sort them by some heuristic to focus on more than one target.
//Move over the target position tracking into its' own behavior.
//Make tracking for the last seen position of a target (Or multiple targets), for behaviors such as heading there and suppressive fire.
//=====|Library structure|=====\\
/*The most basic NPC class, all types are based on this, land/water/air vehicles, humanoids, flying creatures, you name it.
So, the code that is meant to be shared by all NPCs also goes here.*/
#Include "ZScript/Bases/Base.zsc" //Base NPC/actor class
#Include "ZScript/Bases/Projectile.zsc" //Base projectile class
#Include "ZScript/Bases/AIFunctions.zsc"
#Include "ZScript/Bases/OtherFunctions.zsc"
#Include "ZScript/Bases/OtherCode.zsc"
#Include "ZScript/Bases/Hazard.zsc" //Universal code for hazards, hazard zones, etc
#Include "ZScript/Bases/Groups.zsc" //NPC group/squad handling.
#Include "ZScript/Bases/Voices.zsc" //NPC voice system
#Include "ZScript/Bases/SharedCode.zsc" //Mixins and shit.
//The base *land* vehicle class. As of 8/4/2023, this basically a direct rip from a dev build of MVP 0.5.0.
//Any future vehicle types like air and water vehicles will be based on this.
#Include "ZScript/Bases/Vehicle/Base.zsc"
#Include "ZScript/Bases/Vehicle/BaseProp.zsc"
#Include "ZScript/Bases/Vehicle/CommonFunctions.zsc"
#Include "ZScript/Bases/Vehicle/TurretFunctions.zsc"
//Air, sea, etc vehicles.
//The base creature class, for living NPCs like demons and animals.
#Include "ZScript/Bases/Creature/Base.zsc"
//The base class for more intelligent creatures, based on KAI_Creature.
#Include "ZScript/Bases/Humanoid/Base.zsc"
#Include "ZScript/Bases/Humanoid/Emplacement.zsc" //Player and KAI_Humanoid-usable emplacements, like turrets.