0 Members and 1 Guest are viewing this topic.
Bots naturally don't talk during combat.
Not while trying to attack.
str classes [3] = {"Megaman", "Protoman", "Bass"};Script 701 (void){if(CheckActorClass(0,"classes[0,2]")); { Print(s:"cfPlease select your weapons"); delay(35*2); Terminate; }else { Print(s:"cgYou do not need these weapons!"); DamageThing(999); }}
if(CheckActorClass(0,classes[0,2]));
if(CheckActorClass(0,classes[0]) || CheckActorClass(0,classes[1]) || CheckActorClass(0,classes[2]))
#DEFINE MAX_CLASSES 3 // maximum number of classes that can use weapons.str classes [MAX_CLASSES] = {"Megaman", "Protoman", "Bass"};Script 701 (void){bool canUseWeapons = false;// This structure iterates through all of the code within it MAX_CLASSES times.// It also keeps track of a number that can be plugged into the array safely.// This is a loop that's functionally equivalent to// "while i is less than max classes and a class that can use weapons has not been found, do the following"for(int i = 0; i < MAX_CLASSES && !canUseWeapons; i++){ if(CheckActorClass(0,classes[i])) { canUseWeapons = true; }}if(canUseWeapons){ Print(s:"cfPlease select your weapons"); delay(35*2); terminate;}else{ Print(s:"cgYou do not need these weapons!"); DamageThing(999);}}
A string array in that stance can only take in one value and will give you one value.classes[0] refers to "Megaman", classes[1] refers to "Protoman", and classes[3] refers to "Bass".As a result, classes[0, 2] doesn't really specify anythingchange the following lineCode: [Select]if(CheckActorClass(0,classes[0,2]));toCode: [Select]if(CheckActorClass(0,classes[0]) || CheckActorClass(0,classes[1]) || CheckActorClass(0,classes[2]))A more extendable version of this script can be made though:Code: [Select]#DEFINE MAX_CLASSES 3 // maximum number of classes that can use weapons.str classes [MAX_CLASSES] = {"Megaman", "Protoman", "Bass"};Script 701 (void){bool canUseWeapons = false;// This structure iterates through all of the code within it MAX_CLASSES times.// It also keeps track of a number that can be plugged into the array safely.// This is a loop that's functionally equivalent to// "while i is less than max classes and a class that can use weapons has not been found, do the following"for(int i = 0; i < MAX_CLASSES && !canUseWeapons; i++){ if(CheckActorClass(0,classes[i])) { canUseWeapons = true; }}if(canUseWeapons){ Print(s:"cfPlease select your weapons"); delay(35*2); terminate;}else{ Print(s:"cgYou do not need these weapons!"); DamageThing(999);}}To add more classes that can use weapons, you'd simply add one to MAX_CLASSES and add their name to the list of classes.Hope this helps, sorry for getting carried away.
I'm trying to make a map that utilizes 3D floors that can fade away and reveal new textures behind them, like a 3D floor representing a pile of leaves fading away to reveal a snow texture beneath it.Is it possible to change the "Alpha" arguement of a 3D Floor LineDef with the use of a script?