Skip to content

Commit

Permalink
Outsource system script prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed May 9, 2024
1 parent 7890c99 commit f15b6a2
Show file tree
Hide file tree
Showing 18 changed files with 104 additions and 47 deletions.
2 changes: 2 additions & 0 deletions _work/data/Scripts/System/GFA/Camera.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prototypes\Camera.d
instances\CamInst.d
2 changes: 2 additions & 0 deletions _work/data/Scripts/System/GFA/Menu.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prototypes\Menu.d
instances\Menu_Opt_GFA.d
2 changes: 2 additions & 0 deletions _work/data/Scripts/System/GFA/PFX_G1.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prototypes\ParticleFX.d
instances\PfxInst_G1.d
2 changes: 2 additions & 0 deletions _work/data/Scripts/System/GFA/PFX_G2.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prototypes\ParticleFX.d
instances\PfxInst_G2.d
2 changes: 2 additions & 0 deletions _work/data/Scripts/System/GFA/SFX.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prototypes\ParticleFX.d
instances\SfxInst.d
2 changes: 2 additions & 0 deletions _work/data/Scripts/System/GFA/VisualFX.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prototypes\VisualFX.d
instances\VisualFxInst.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
* identify the original author.
*/

Instance CamModGFA (CCamSys)
{
instance CamModGFA(GFA_CCamSys) {
bestRange = 1.8; // Decreased from 2.5
minRange = 1.4;
maxRange = 5.0; // Decreased from 10.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,41 @@ const int GFA_MENU_DY = 550; // Match MEN
const int GFA_MENU_CHC_H = 120; // Match MENU_CHOICE_YPLUS: height of choice entry
const string GFA_MENU_ITEM_BACK_PIC = ""; // Match MENU_ITEM_BACK_PIC
const string GFA_MENU_CHOICE_BACK_PIC = "MENU_CHOICE_BACK.TGA"; // Match MENU_CHOICE_BACK_PIC
const string GFA_MENU_FONT_DEFAULT = "FONT_OLD_20_WHITE.TGA"; // Match MENU_FONT_DEFAULT
const string GFA_MENU_FONT_SMALL = "FONT_OLD_10_WHITE.TGA"; // Match MENU_FONT_SMALL

// Redefinition of fixed menu constants to ensure their existence (do not change)
const int GFA_MENU_ITEM_TEXT = 1; // MENU_ITEM_TEXT
const int GFA_MENU_ITEM_CHOICEBOX = 5; // MENU_ITEM_CHOICEBOX
const int GFA_SEL_ACTION_UNDEF = 0; // SEL_ACTION_UNDEF
const int GFA_IT_CHROMAKEYED = 1; // IT_CHROMAKEYED
const int GFA_IT_TRANSPARENT = 2; // IT_TRANSPARENT
const int GFA_IT_SELECTABLE = 4; // IT_SELECTABLE
const int GFA_IT_TXT_CENTER = 16; // IT_TXT_CENTER
const int GFA_IT_EFFECTS_NEXT = 128; // IT_EFFECTS_NEXT


Instance MENUITEM_OPT_GFA (C_Menu_Item_Def) {
Instance MENUITEM_OPT_GFA (GFA_C_Menu_Item) {
backPic = GFA_MENU_ITEM_BACK_PIC;
type = MENU_ITEM_TEXT;
fontName = MENU_FONT_DEFAULT;
text[0] = GFA_MENU_LABEL;
text[1] = GFA_MENU_DESCR;
posx = 1000;
posy = GFA_MENU_START_Y + GFA_MENU_DY * GFA_MENU_ID;
dimx = 5550;
dimy = 750;
onSelAction[0] = GFA_SEL_ACTION_UNDEF;
flags = flags | GFA_IT_EFFECTS_NEXT;
flags = GFA_IT_CHROMAKEYED | GFA_IT_TRANSPARENT | GFA_IT_SELECTABLE | GFA_IT_EFFECTS_NEXT;
// Defaults (see C_Menu_Item_Def)
alphaMode = "BLEND";
alpha = 254;
openDuration = -1;
sizeStartScale = 1;
userFloat[0] = 100;
userFloat[1] = 200;
};


Instance MENUITEM_OPT_GFA_CHOICE (C_Menu_Item_Def) {
Instance MENUITEM_OPT_GFA_CHOICE (GFA_C_Menu_Item) {
backPic = GFA_MENU_CHOICE_BACK_PIC;
type = GFA_MENU_ITEM_CHOICEBOX;
fontName = GFA_MENU_FONT_SMALL;
Expand All @@ -67,8 +78,14 @@ Instance MENUITEM_OPT_GFA_CHOICE (C_Menu_Item_Def) {
posy = GFA_MENU_START_Y + GFA_MENU_DY*GFA_MENU_ID + GFA_MENU_CHC_H;
dimx = 2000;
dimy = 350;
flags = GFA_IT_CHROMAKEYED | GFA_IT_TRANSPARENT | GFA_IT_TXT_CENTER;
onChgSetOption = "freeAimingEnabled";
onChgSetOptionSection = "GFA";
flags = flags & ~GFA_IT_SELECTABLE;
flags = flags | GFA_IT_TXT_CENTER;
// Defaults (see C_Menu_Item_Def)
alphaMode = "BLEND";
alpha = 254;
openDuration = -1;
sizeStartScale = 1;
userFloat[0] = 100;
userFloat[1] = 200;
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* identify the original author.
*/

Instance GFA_TRAIL (C_ParticleFX) {
instance GFA_TRAIL(GFA_C_ParticleFX) {
ppsvalue = 20.000000000;
ppsislooping = 0;
ppsscalekeys_s = "1 1 1 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8"; // Artificial delay of 0.4 sec
Expand Down Expand Up @@ -45,7 +45,7 @@ Instance GFA_TRAIL (C_ParticleFX) {
trlwidth = 3;
};

Instance GFA_IMPACT (C_ParticleFX) {
instance GFA_IMPACT(GFA_C_ParticleFX) {
ppsvalue = 200.000000000;
ppsscalekeys_s = "1";
ppsissmooth = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
* identify the original author.
*/

Instance GFA_TRAIL (C_ParticleFX)
{
instance GFA_TRAIL(GFA_C_ParticleFX) {
ppsvalue = 100.000000000;
ppsislooping = 1;
ppsscalekeys_s = "1";
Expand Down Expand Up @@ -47,8 +46,7 @@ Instance GFA_TRAIL (C_ParticleFX)
useemittersfor = 1;
};

Instance GFA_IMPACT (C_ParticleFX)
{
instance GFA_IMPACT(GFA_C_ParticleFX) {
ppsvalue = 200.000000000;
ppsscalekeys_s = "1";
ppsissmooth = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
* identify the original author.
*/

Instance GFA_CRITICALHIT_SFX (C_SFX_Def) {
file = "BOW_FIRE_02.WAV";
vol = 60;
instance GFA_CRITICALHIT_SFX(GFA_C_SFX) {
file = "BOW_FIRE_02.WAV";
vol = 60;
reverbLevel = 1;
};

Instance GFA_COLLISION_BREAK (C_SFX_Def) {
file = "PICKLOCK_BROKEN.WAV";
vol = 50;
instance GFA_COLLISION_BREAK(GFA_C_SFX) {
file = "PICKLOCK_BROKEN.WAV";
vol = 50;
reverbLevel = 1;
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,75 @@
* identify the original author.
*/

// A copy of the default CFx_Base_Proto, to ensure the defaults
Prototype GFA_CFx_Proto(CFx_Base) {
// Base FX
instance GFA_TRAIL_VFX(GFA_CFx_Base) {
emFXLifeSpan = 2.0;
// Basics
visAlpha = 1;
emTrjMode_S = "FIXED";
emTrjOriginNode = "ZS_RIGHTHAND";
emTrjTargetRange = 10;
emTrjTargetAzi = 0;
emTrjTargetElev = 0;
emTrjNumKeys = 10;
emTrjNumKeysVar = 0;
emTrjAngleElevVar = 0;
emTrjAngleHeadVar = 0;
emTrjKeyDistVar = 0;
emTrjLoopMode_S = "NONE";
emTrjEaseFunc_S = "LINEAR";
emTrjEaseVel = 100;
emTrjDynUpdateDelay = 2000000;
emTrjDynUpdateTargetOnly = 0;
emFXTriggerDelay = 0;
emFXCreatedOwnTrj = 0;
emCheckCollision = 0;
emAdjustShpToOrigin = 0;
emInvestNextKeyDuration = 0;
emFlyGravity = 0;
emFXLifeSpan = -1;
emSelfRotVel_S = "0 0 0";
sendAssessMagic = 0;
secsPerDamage = -1;
};

// Base FX
Instance GFA_TRAIL_VFX (GFA_CFx_Proto) {
emFXLifeSpan = 2.0;
};

// NPC is in focus
Instance GFA_TRAIL_VFX_KEY_INVEST_1 (C_ParticleFxEmitKey) { }; // Never reached. Do not remove!
instance GFA_TRAIL_VFX_KEY_INVEST_1(GFA_C_ParticleFxEmitKey) { }; // Never reached. Do not remove!

// Projectile is shot
Instance GFA_TRAIL_VFX_KEY_INVEST_2 (C_ParticleFxEmitKey) {
instance GFA_TRAIL_VFX_KEY_INVEST_2(GFA_C_ParticleFxEmitKey) {
visname_s = "GFA_TRAIL";
};

// Projectile collides
Instance GFA_TRAIL_VFX_KEY_INVEST_3 (C_ParticleFxEmitKey) {
instance GFA_TRAIL_VFX_KEY_INVEST_3(GFA_C_ParticleFxEmitKey) {
visname_s = ""; // Remove effect after collision
pfx_ppsIsLoopingChg = 1;
};

// Same but simplified for Wld_PlayEffect (used for Gothic 1)
Instance GFA_TRAIL_INST_VFX (GFA_CFx_Proto) {
instance GFA_TRAIL_INST_VFX(GFA_CFx_Base) {
visname_s = "GFA_TRAIL";
emTrjOriginNode = "BIP01";
emFXLifeSpan = 2.0;
// Basics
visAlpha = 1;
emTrjMode_S = "FIXED";
emTrjOriginNode = "ZS_RIGHTHAND";
emTrjTargetRange = 10;
emTrjNumKeys = 10;
emTrjLoopMode_S = "NONE";
emTrjEaseFunc_S = "LINEAR";
emTrjEaseVel = 100;
emTrjDynUpdateDelay = 2000000;
emFXLifeSpan = -1;
emSelfRotVel_S = "0 0 0";
secsPerDamage = -1;
};

// Breaking in impact
Instance GFA_DESTROY_VFX (GFA_CFx_Proto) {
instance GFA_DESTROY_VFX(GFA_CFx_Base) {
visname_s = "GFA_IMPACT";
emTrjOriginNode = "BIP01";
sfxid = "GFA_COLLISION_BREAK";
sfxisambient = 1;
// Basics
visAlpha = 1;
emTrjMode_S = "FIXED";
emTrjOriginNode = "ZS_RIGHTHAND";
emTrjTargetRange = 10;
emTrjNumKeys = 10;
emTrjLoopMode_S = "NONE";
emTrjEaseFunc_S = "LINEAR";
emTrjEaseVel = 100;
emTrjDynUpdateDelay = 2000000;
emFXLifeSpan = -1;
emSelfRotVel_S = "0 0 0";
secsPerDamage = -1;
};
3 changes: 3 additions & 0 deletions _work/data/Scripts/System/GFA/prototypes/Camera.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Ease the integration with missing class definitions

prototype GFA_CCamSys(CCamSys) {};
3 changes: 3 additions & 0 deletions _work/data/Scripts/System/GFA/prototypes/Menu.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Ease the integration with missing class definitions

prototype GFA_C_Menu_Item(C_Menu_Item) {};
3 changes: 3 additions & 0 deletions _work/data/Scripts/System/GFA/prototypes/ParticleFX.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Ease the integration with missing/renamed class definitions

prototype GFA_C_ParticleFX(C_ParticleFX) {};
4 changes: 4 additions & 0 deletions _work/data/Scripts/System/GFA/prototypes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This directory contains intermediate prototype definitions.

This allows to change only these files in case of missing or renamed classes and leave the files in the Instances sub-directory untouched.
That eases the maintenance of the scripts and also allows using submodules/symlinks for the Instances sub-directory, see README.md in the root directory.
3 changes: 3 additions & 0 deletions _work/data/Scripts/System/GFA/prototypes/SFX.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Ease the integration with missing class definitions

prototype GFA_C_SFX(C_SFX) {};
4 changes: 4 additions & 0 deletions _work/data/Scripts/System/GFA/prototypes/VisualFX.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Ease the integration with missing class definitions

prototype GFA_CFx_Base(CFx_Base) {};
prototype GFA_C_ParticleFxEmitKey(C_ParticleFxEmitKey) {};

0 comments on commit f15b6a2

Please sign in to comment.