I'm including something like this already, based on some work that MoscowModder did, that changes the 'levels' of enemies, based on the player level, or other game attributes. It works via an FFC, that can be customised to fit the needs of the game.EDIT: Also, options for enemy level scaling (and equivalent stat distribution) with the player's level would be a nice touch. I hate getting into games and outleveling enemies to the point that they can't damage me. It takes a lot away from quests and tasks, and general exploration of underleveled areas.
This would be what TeamUDF calls 'Digivolved' enemies, which may or may not make logical sense. I plan to do this based on Triggered Events, rather than on Player Level, but it's easy to set the trigger for the change, and the enemies to change.
I would like to make the FFC easier to use though, so that you don;t need multiple instances of it on a screen to handle different enemy types. I think that my current version will do this, but it's one of the features I plan to test in either the next, or the second-next build of TGC.
The present build is testing the scripts that I made in February, through early April. There are many components of those scripts that are int he game, but aren't in use yet, that I need to set up; and test, before I can test the newest components. I try not to add too much to test at a time, to keep myself from needing to determine if there are any conflicts.
The less you test at a time, the easier it is to pinpoint the source of a problem. I learnt this the hard way, when I tried to completely re-write my global script, and half of the game broke,because isolating components into individual functions changed something critical to their functionality. :/
Here is the present work on DigiVolving Enemies. It is untested, and a WIP:
(Note: Requires stdArguments.zh v6.9.7)
/////////////////////////////////////
/// Enemy Vulnerabilities ///
/// Modified from: the Gibdo Burn ///
/// Script by Avataro ///
/// and MoscowModder ///
/// Combined with the FFC Trigger ///
/// Script by: grayswandir ///
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
/// Place on screen with an enemy, so that if it is killed by a specific type of weapon ///
/// it spawms a different enemy. or produces a different effect. ///
/// D0: Enemy Number of SOurce Enemy to Affect. ///
/// D1: Enemy to Replace D0 with on Contact with Trigger. ///
/// D2: Trigger - Positive Number for Specific Item Number; Negative Number of LW Type. ///
/////////////////////////////////////////////////////////////////////////////////////////////
/// Place one FFC of this script on the screen for each enemy to affect by it. ///
/// You can cascade this by setting the replacement enemy type as a source type in ///
/// a second instance of this FFC. ///
/// THis can be especially useful for spells: You can have enemies that are outwardly ///
/// invincible, but are changed once affected by a spell or item. You can use the same ///
/// sprite, or a variation of itl to reflect the change int he state of the enemy, or to ///
/// make the change invisible to the player. ///
/////////////////////////////////////////////////////////////////////////////////////////////
//Trigger is a specific item (item number in editor).
//Vulnerability is an item class (LW Type).
ffc script specialEnemyVulnerability{
void run (int enemy0, int enemy1, int enemy2, int enemy3, int enemy4, int enemy5, int trigger_vulnerability, int switches){
int enemy0old = GetValue4High(enemy0); //max 255
int enemy0new = GetHighArgument(enemy0); //max 0255
//D0: (999).(x999)
int enemy1old = GetValue4High(enemy1); //max 255
int enemy1new = GetHighArgument(enemy1); //max 0255
//D1: (999).(x999)
int enemy2old = GetValue4High(enemy2); //max 255
int enemy2new = GetHighArgument(enemy2); //max 0255
//D2: (999).(x999)
int enemy3old = GetValue4High(enemy3); //max 255
int enemy3new = GetHighArgument(enemy3); //max 0255
//D3: (999).(x999)
int enemy4old = GetValue4High(enemy4); //max 255
int enemy4new = GetHighArgument(enemy4); //max 0255
//D4: (999).(x999)
int enemy5old = GetValue4High(enemy5); //max 255
int enemy5new = GetHighArgument(enemy5); //max 0255
//D5: (999).(x999)
int trigger = GetValue4High(trigger_vulnerability); //max 999
int vulnerability = GetHighArgument(trigger_vulnerability); //max 0999
//D6: (999).(x999)
int switch0 = GetDigit(switches, 4);
int switch1 = GetDigit(switches, 3);
int switch2 = GetDigit(switches, 2);
int switch3 = GetDigit(switches, 1);
int switch4 = GetDigit(switches, 0);
int switch5 = GetDigit(switches, -1);
int switch6 = GetDigit(switches, -2);
int switch7 = GetDigit(switches, -3);
int switch8 = GetDigit(switches, -4);
//
// Switch: Decimal Place: Value Range:
// 0 #xxxx.xxxx (Ten-Thousands) 0-to-2
// 1 x#xxx.xxxx (Thousands) 0-to-9
// 2 xx#xx.xxxx (Hundreds) 0-to-9
// 3 xxx#x.xxxx (Tens) 0-to-9
// 4 xxxx#.xxxx (Ones) 0-to-9
// 5 xxxxx.#xxx (Tenths) 0-to-9
// 6 xxxxx.x#xx (Hundredths) 0-to-9
// 7 xxxxx.xx#x (Thousandths) 0-to-9
// 8 xxxxx.xxx# (Ten-Thousandths) 0-to-9
int haveitem;
int haveTFpiece;
int triggerAndVulnerability;
int triggerAndLevel;
int vulnerabilityAndLevel;
int triggerAndLevelAndVulnerability;
int none;
bool levelRequired = false;
bool TF_Required = false;
bool itemRequired = false;
bool triggerBool = false;
bool vulnerabilityBool = false;
bool haveTF = false;
bool isLevel = false;
bool hasItem = false;
bool changeCause = false;
if ( switch8 == 0) {
triggerBool = false;
vulnerabilityBool = false;
}
if ( switch8 == 1) {
triggerBool = true;
vulnerabilityBool = false;
}
if ( switch8 == 2) {
triggerBool = false;
vulnerabilityBool = true;
}
if ( switch8 == 3) {
triggerBool = true;
vulnerabilityBool = true;
}
if ( switch8 == 4 ) {
cause = none;
}
if ( switch8 == 5 ) {
cause = trigger;
}
if ( switch8 == 6 ) {
cause = vulnerability;
}
//Sets the main operator, whether it is or is not level dependant:
//if the enemy should always be changed, set this to none.
// xxxxx.xxx0
////////////////////////////////////////////////////////////////
/// Switch 7: Set flag for item, level, and TF requirements. ///
////////////////////////////////////////////////////////////////
/// FLAG TFORCE LEVEL ITEM ///
/// 0 : FALSE FALSE FALSE ///
/// 1 : TRUE FALSE FALSE ///
/// 2 : FALSE TRUE FALSE ///
/// 3 : TRUE TRUE FALSE ///
/// 4 : FALSE FALSE TRUE ///
/// 5 : TRUE FALSE TRUE ///
/// 6 : FALSE TRUE TRUE ///
/// 7 : TRUE TRUE TRUE ///
/////////////////////////////////////////
if ( switch7 == 0) {
itemRequired = false;
levelRequired = false;
TF_Required = false;
}
if ( switch7 == 1 ) {
itemRequired = true;
levelRequired = false;
TF_Required = false;
}
if ( switch7 == 2) {
itemRequired = false;
levelRequired = true;
TF_Required = false;
}
if ( switch7 == 3 ) {
itemRequired = true;
levelRequired = true;
TF_Required = false;
}
if ( switch7 == 4 ) {
itemRequired = false;
levelRequired = false;
TF_Required = true;
}
if ( switch7 == 5 ) {
itemRequired = true;
levelRequired = false;
TF_Required = true;
}
if ( switch7 == 6 ) {
itemRequired = false;
levelRequired = true;
TF_Required = true;
}
if ( switch7 == 6 ) {
itemRequired = true;
levelRequired = true;
TF_Required = true;
}
// xxxxx.xx0x
int TFLevel = switch6; // Set the level of the TF piece, 1 to , if it is required.
bool TFLevelRequired = Game->LItem[TFLevel];
// if ( Game->LItem[TFLevel]&LI_TRIFORCE == LI_TRIFORCE ) {
// if ( TFLevelRequired == true )
// xxxxx.x#xx value 0 (for none) or 1 to 8.
//Switches 4-through-6: Sets the item number for the required item (if any),
//either as an item is true, as a trigger, or as a vulnerability
int requireThisItem = GetValue3Lower567(switches);
// xxxx#.##xx Value 000 to 999
//Switches 2-and-3: Sets the minimum character level for the change to occur (if any)
int requireTheLevel = GetValue223(switches);
// xx##x.xxxx Value 00 - 99
// Switch 1: Sets additional, conditional effect (from list, or user defined).
int effect = switch1;
//Continue HP. If set to 1, the replacement enemy will have the same hP as the enemy that it replaces
//If set to 2, the enemy will have 2x the HP of the enemy it replaces.
// x#xxx.xxxx
// Switch 0: Sets additional, conditional cause (user defined).
int cause = switch0;
// #xxxx.xxxx
// if ( trigger == true && vulnerability == true ){
// }
if ( switch 7 == 0 ) {
cause = haveitem;
}
if (switch 7 == 0 ) {
cause = haveTFPiece;
}
while(true){
if ( Link->Item[trigger] == true ) {
haveItem = true;
}
if ( Game->LItem[TFLevel]&LI_TRIFORCE == LI_TRIFORCE ) {
haveTF = true;
}
if ( Game->Counter[LEVEL] =< requireTheLevel ) {
isLevel= true;
}
if (itemRequired == false && levelRequired == false && TF_Required == false ){
changeCause == true;
}
if ( itemRequired == true && haveItem == true ){
changeCause == true;
}
if ( levelRequired == true && isLevel == true ){
changeCause == true;
}
if ( TF_Required == true && haveTF == true ) {
changeCause == true;
}
for(int i = 1; i < Screen->NumNPCs(); i++){ //Check every enemy
npc enem = Screen->LoadNPC(i);
///Enemy 0
if(enem->ID == enemy0old){ //If it's a the enemeny editor number of enemy0
for(int j = 1; j < Screen->NumLWeapons(); j++){ //Check every weapon
lweapon weap = Screen->LoadLWeapon(j);
if (weap->CollDetection && Collision(enem, weap)) { //if the LW touches the enemy,
if (IsFromItem(weap, trigger)) { // If LW is from right item type.
npc e0new = CreateNPCAt(enemy0new, enem->X, enem->Y); //Create the replacement enemy
if ( effect == 1 ) {
e0new->HP = enem->HP; //Set its HP to the same as the original enemy (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if (IsFromItemClass(weap, vulnerability)) {
npc e0new = CreateNPCAt(enemy0new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e0new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if ( changeCause == true ) {
npc e0new = CreateNPCAt(enemy0new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e0new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
}
}
} // end main if for enemy check (enemy 0).
///Enemy 1
if(enem->ID == enemy1old){ //If it's a the enemeny editor number of enemy1
for(int j = 1; j < Screen->NumLWeapons(); j++){ //Check every weapon
lweapon weap = Screen->LoadLWeapon(j);
if (weap->CollDetection && Collision(enem, weap)) { //if the LW touches the enemy,
if (IsFromItem(weap, trigger)) { // If LW is from right item type.
npc e1new = CreateNPCAt(enemy1new, enem->X, enem->Y); //Create the replacement enemy
if ( effect == 1 ) {
e1new->HP = enem->HP; //Set its HP to the same as the original enemy (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if (IsFromItemClass(weap, vulnerability)) {
npc e1new = CreateNPCAt(enemy1new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e1new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if ( changeCause == true ) {
npc e1new = CreateNPCAt(enemy1new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e1new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
}
}
} // end main if for enemy check (enemy 1).
///Enemy 2
if(enem->ID == enemy2old){ //If it's a the enemeny editor number of enemy2
for(int j = 1; j < Screen->NumLWeapons(); j++){ //Check every weapon
lweapon weap = Screen->LoadLWeapon(j);
if (weap->CollDetection && Collision(enem, weap)) { //if the LW touches the enemy,
if (IsFromItem(weap, trigger)) { // If LW is from right item type.
npc e2new = CreateNPCAt(enemy2new, enem->X, enem->Y); //Create the replacement enemy
if ( effect == 1 ) {
e2new->HP = enem->HP; //Set its HP to the same as the original enemy (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if (IsFromItemClass(weap, vulnerability)) {
npc e2new = CreateNPCAt(enemy2new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e2new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if ( changeCause == true ) {
npc e2new = CreateNPCAt(enemy2new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e2new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
}
}
} // end main if for enemy check (enemy 2).
/// Enemy 3
if(enem->ID == enemy3old){ //If it's a the enemeny editor number of enemy3
for(int j = 1; j < Screen->NumLWeapons(); j++){ //Check every weapon
lweapon weap = Screen->LoadLWeapon(j);
if (weap->CollDetection && Collision(enem, weap)) { //if the LW touches the enemy,
if (IsFromItem(weap, trigger)) { // If LW is from right item type.
npc e3new = CreateNPCAt(enemy3new, enem->X, enem->Y); //Create the replacement enemy
if ( effect == 1 ) {
e3new->HP = enem->HP; //Set its HP to the same as the original enemy (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if (IsFromItemClass(weap, vulnerability)) {
npc e3new = CreateNPCAt(enemy3new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e3new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if ( changeCause == true ) {
npc e3new = CreateNPCAt(enemy3new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e3new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
}
}
} // end main if for enemy check (enemy 3).
///Enemy 4
if(enem->ID == enemy4old){ //If it's a the enemeny editor number of enemy4
for(int j = 1; j < Screen->NumLWeapons(); j++){ //Check every weapon
lweapon weap = Screen->LoadLWeapon(j);
if (weap->CollDetection && Collision(enem, weap)) { //if the LW touches the enemy,
if (IsFromItem(weap, trigger)) { // If LW is from right item type.
npc e4new = CreateNPCAt(enemy4new, enem->X, enem->Y); //Create the replacement enemy
if ( effect == 1 ) {
e4new->HP = enem->HP; //Set its HP to the same as the original enemy (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if (IsFromItemClass(weap, vulnerability)) {
npc e4new = CreateNPCAt(enemy4new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e4new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if ( changeCause == true ) {
npc e4new = CreateNPCAt(enemy4new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e4new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
}
}
} // end main if for enemy check (enemy 4).
/// Enemy 5
if(enem->ID == enemy5old){ //If it's a the enemeny editor number of enemy5
for(int j = 1; j < Screen->NumLWeapons(); j++){ //Check every weapon
lweapon weap = Screen->LoadLWeapon(j);
if (weap->CollDetection && Collision(enem, weap)) { //if the LW touches the enemy,
if (IsFromItem(weap, trigger)) { // If LW is from right item type.
npc e5new = CreateNPCAt(enemy5new, enem->X, enem->Y); //Create the replacement enemy
if ( effect == 1 ) {
e5new->HP = enem->HP; //Set its HP to the same as the original enemy (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if (IsFromItemClass(weap, vulnerability)) {
npc e5new = CreateNPCAt(enemy5new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e5new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
else if ( changeCause == true ) {
npc e5new = CreateNPCAt(enemy5new, enem->X, enem->Y); //Create the replacement enemy.
if ( effect == 1 ) {
e5new->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this)
}
Remove(enem); //Remove original enemy.
}
}
}
} // end main if for enemy check (enemy 5).
Waitframe();
}
}
}
}
/////////////////////////
/// GLobal Components ///
/////////////////////////
const int DIGIVOLVE = 0; //Set this to the item required to DigiVolve enemies.
const int DIGIVOLVE_TF = 8; //Set this to the TF {iece required to DigiVolve enemies.
//Best to use DIGIVOLVE above and attach that item to a TF piece.
global script active{
void run() {
while(true){
advanceEnemieLevels();
Waitframe();
}
}
}
void replaceEnemies() {
for(int i = 1; i < Screen->NumNPCs(); i++){ //Check every enemy on the screen.
npc enemy1 = Screen->LoadNPC(i); //Set variable to all enemies.
if(enemy1->ID == enemyOriginal){ //If an enemy is the enemeny editor number of enemyOriginal
if ( Game->LItem[2]&LI_TRIFORCE == LI_TRIFORCE ) { //If the player has ther L2 TF Piece
npc enemy2 = CreateNPCAt(enemyReplace, enem->X, enem->Y); //Create enemyReplace at their position.
Remove(enemy1); //Remove enemyOriginal
}
}
}
}
void advanceEnemieLevels() {
for(int i = 1; i < Screen->NumNPCs(); i++){ //Check every enemy on the screen.
npc enemy1 = Screen->LoadNPC(i); //Set variable to all enemies.
//Need to real all enemy editor numbers, and store them.
//Need to change all enemies on a screen to +1 enemy editor number.
int enemy1number = ( enemy->ID );
int enemy2number = ( enemynumber + 1 );
if ( Link->Item[DIGIVOLVE] == true ){
npc enemy2 = CreateNPCAt(enemy2number, enem->X, enem->Y); //Create enemyReplace at their position.
Remove(enemy1); //Remove enemyOriginal
}
else if ( Game->LItem[DIGIVOLVE_TF]&LI_TRIFORCE == LI_TRIFORCE ){
npc enemy2 = CreateNPCAt(enemy2number, enem->X, enem->Y); //Create enemyReplace at their position.
Remove(enemy1); //Remove enemyOriginal
}
//if(enemy1->ID == enemy1number){ //If an enemy is the enemeny editor number of enemyOriginal
// npc enemy2 = CreateNPCAt(enemy2number, enem->X, enem->Y); //Create enemyReplace at their position.
// Remove(enemy1); //Remove enemyOriginal
// }
}
Quit();
}
Edited by ZoriaRPG, 19 April 2014 - 08:08 AM.

