Script Editor: fixed an exception when a script configuration contained identical keyword and constant.

ZDoom_DECORATE.cfg: added a bunch of actor properties.
This commit is contained in:
MaxED 2015-01-19 19:53:58 +00:00
parent 7c0711f21e
commit 40a35d399e
2 changed files with 268 additions and 40 deletions

View file

@ -5,7 +5,7 @@
// Editor settings
description = "ZDoom DECORATE";
codepage = 0;
extensions = "txt";
extensions = "txt,dec";
casesensitive = false;
insertcase = 0; // 0=Normal, 1=Lowercase, 2=Uppercase
lexer = 35;
@ -258,6 +258,7 @@ keywords
ACS_NamedLockedExecuteDoor = "bool ACS_NamedLockedExecuteDoor(string script, int map, int arg1, int arg2, int lock)";
ACS_NamedExecuteWithResult = "int ACS_NamedExecuteWithResult(string script, int arg1, int arg2, int arg3, int arg4)";
ACS_NamedExecuteAlways = "bool ACS_NamedExecuteAlways(string script, int map, int arg1, int arg2, int arg3)";
CallACS = "int CallACS(string script, int arg1, int arg2, int arg3, int arg4)";
//Original Doom/Strife monster attacks
A_PosAttack = "A_PosAttack";
A_SPosAttack = "A_SPosAttack";
@ -324,7 +325,7 @@ keywords
frandom = "frandom[identifier](min, max)\nReturns a random floating point value between min and max.";
randompick = "randompick[identifier](int, ...)\nPicks a number from the numbers placed in it.\nThis can take an unlimited amount of parameters.";
//State keywords
Bright = "Bright";
//Bright = "Bright";
CanRaise = "CanRaise";
Fast = "Fast";
Light = "Light(string lightname)";
@ -340,6 +341,7 @@ constants
{
Actor;
//states:
States;
Spawn:;
Idle:;
See:;
@ -354,6 +356,7 @@ constants
Raise:;
Heal:;
Crash:;
Crash.Extreme:;
Crush:;
Wound:;
Greetings:;
@ -367,53 +370,240 @@ constants
Bounce.Wall:;
Bounce.Actor:;
Bounce.Actor.Creature:;
//State keywords
//Bright;
CanRaise;
Fast;
NoDelay;
Slow;
//flow control
loop;
stop;
wait;
fail;
goto;
////////////////////
//ACTOR PROPERTIES
////////////////////
//Map editing control
Game;
SpawnID;
ConversationID;
Tag;
//Behavior
Health;
GibHealth;
WoundHealth;
ReactionTime;
PainChance;
PainThreshold;
DamageFactor;
Damage;
PoisonDamage;
PoisonDamageType;
RadiusDamageFactor;
DesignatedTeam;
Speed;
VSpeed;
FastSpeed;
FloatSpeed;
Species;
Accuracy;
Stamina;
Activation;
TeleFogSourceType;
TeleFogDestType;
//Collision and 'Physics'
Radius;
Height;
DeathHeight;
BurnHeight;
ProjectilePassHeight;
CameraHeight;
Gravity;
Mass;
MaxStepHeight;
MaxDropOffHeight;
BounceType;
BounceFactor;
WallBounceFactor;
BounceCount;
ProjectileKickBack;
PushFactor;
WeaveIndexXY;
WeaveIndexZ;
//Sound
ActiveSound;
AttackSound;
BounceSound;
CrushPainSound;
DeathSound;
HowlSound;
PainSound;
SeeSound;
WallBounceSound;
//Rendering
RenderStyle;
Alpha;
DefaultAlpha;
XScale;
YScale;
Scale;
Translation;
BloodColor;
BloodType;
Decal;
StencilColor;
FloatBobPhase;
//Obituaries
HitObituary;
Obituary;
//Attacks
MinMissileChance;
DamageType;
DeathType;
MeleeThreshold;
MeleeRange;
MaxTargetRange;
PainType;
//Special
Args[0];
Args[1];
Args[2];
Args[3];
Args[4];
ClearFlags;
DropItem;
Skip_Super;
VisibleToTeam;
VisibleToPlayerClass;
//Inventory
Inventory.Amount;
Inventory.DefMaxAmount;
Inventory.MaxAmount;
Inventory.InterHubAmount;
Inventory.Icon;
Inventory.PickupMessage;
Inventory.PickupSound;
Inventory.PickupFlash;
Inventory.UseSound;
Inventory.RespawnTics;
Inventory.GiveQuest;
Inventory.ForbiddenTo;
Inventory.RestrictedTo;
//FakeInventory
FakeInventory.Respawns;
//BasicArmorPickup
Armor.SaveAmount;
Armor.SavePercent;
Armor.MaxFullAbsorb;
Armor.MaxAbsorb;
//BasicArmorBonus
Armor.SavePercent;
Armor.MaxSaveAmount;
Armor.SaveAmount;
Armor.MaxBonus;
Armor.MaxBonusMax;
//Weapons
Weapon.AmmoGive;
Weapon.AmmoGive1;
Weapon.AmmoGive2;
Weapon.AmmoType;
Weapon.AmmoType1;
Weapon.AmmoType2;
Weapon.AmmoUse;
Weapon.AmmoUse1;
Weapon.AmmoUse2;
Weapon.MinSelectionAmmo1;
Weapon.MinSelectionAmmo2;
Weapon.BobRangeX;
Weapon.BobRangeY;
Weapon.BobSpeed;
Weapon.BobStyle;
Weapon.KickBack;
Weapon.ReadySound;
Weapon.SelectionOrder;
Weapon.SisterWeapon;
Weapon.SlotNumber;
Weapon.SlotPriority;
Weapon.UpSound;
Weapon.YAdjust;
//Ammo
Ammo.BackpackAmount;
Ammo.BackpackMaxAmount;
Ammo.DropAmount;
//Weapon Pieces
WeaponPiece.Number;
WeaponPiece.Weapon;
//Health
Health.LowMessage;
//Puzzle Items
PuzzleItem.Number;
PuzzleItem.FailMessage;
//Player
Player.AirCapacity;
Player.AttackZOffset;
Player.ColorRange;
Player.ColorSet;
Player.ColorSetFile;
Player.ClearColorSet;
Player.CrouchSprite;
Player.DamageScreenColor;
Player.DisplayName;
Player.Face;
Player.FallingScreamSpeed;
Player.FlechetteType;
Player.ForwardMove;
Player.GruntSpeed;
Player.HealRadiusType;
Player.HexenArmor;
Player.InvulnerabilityMode;
Player.JumpZ;
Player.MaxHealth;
Player.RunHealth;
Player.Portrait;
Player.ScoreIcon;
Player.SideMove;
Player.SoundClass;
Player.SpawnClass;
Player.StartItem;
Player.UseRange;
Player.WeaponSlot;
Player.ViewHeight;
Player.MorphWeapon;
Player.MugShotMaxHealth;
//Powerup
Powerup.Color;
Powerup.Colormap;
Powerup.Duration;
Powerup.Mode;
Powerup.Strength;
//Powerup Giver
Powerup.Type;
//Health Pickup
HealthPickup.AutoUse;
//Morph Projectile
MorphProjectile.PlayerClass;
MorphProjectile.MonsterClass;
MorphProjectile.Duration;
MorphProjectile.MorphStyle;
MorphProjectile.MorphFlash;
MorphProjectile.UnMorphFlash;
//Actor position and movement
x;
y;
z;
angle;
ceilingz;
floorz;
pitch;
velx;
vely;
velz;
Angle;
CeilingZ;
FloorZ;
Pitch;
VelX;
VelY;
VelZ;
//Actor properties
accuracy;
alpha;
args[0];
args[1];
args[2];
args[3];
args[4];
damage;
health;
height;
mass;
meleerange;
radius;
reactiontime;
scaleX;
scaleY;
score;
special;
speed;
stamina;
tid;
tidtohate;
waterlevel;
ScaleX;
ScaleY;
Score;
Special;
Stamina;
////////
//FLAGS
////////
//pointers
AAPTR_DEFAULT;
AAPTR_NULL;
@ -639,6 +829,9 @@ constants
ADDITIVEPOISONDAMAGE;
ADDITIVEPOISONDURATION;
NOFORWARDFALL;
HITTARGET;
HITMASTER;
HITTRACER;
//Bouncing
BOUNCEONWALLS;
BOUNCEONFLOORS;
@ -714,7 +907,7 @@ constants
INVENTORY.NOSCREENFLASH;
INVENTORY.TOSSED;
INVENTORY.ALWAYSRESPAWN;
//Weapons
//Weapons
WEAPON.NOAUTOFIRE;
WEAPON.READYSNDHALF;
WEAPON.DONTBOB;
@ -906,4 +1099,33 @@ constants
WARPF_WARPINTERPOLATION;
XF_HURTSOURCE;
XF_NOTMISSILE;
//////////////////////////
//Property-specific flags
//////////////////////////
//Activation flags
THINGSPEC_Default;
THINGSPEC_ThingActs;
THINGSPEC_TriggerActs;
THINGSPEC_ThingTargets;
THINGSPEC_TriggerTargets;
THINGSPEC_MonsterTrigger;
THINGSPEC_MissileTrigger;
THINGSPEC_ClearSpecial;
THINGSPEC_NoDeathSpecial;
THINGSPEC_Activate;
THINGSPEC_Deactivate;
THINGSPEC_Switch;
//MorphProjectile.MorphStyle flags
MRF_ADDSTAMINA;
MRF_FULLHEALTH;
MRF_UNDOBYTOMEOFPOWER;
MRF_UNDOBYCHAOSDEVICE;
MRF_FAILNOTELEFRAG;
MRF_FAILNOLAUGH;
MRF_WHENINVULNERABLE;
MRF_LOSEACTUALWEAPON;
MRF_NEWTIDBEHAVIOUR;
MRF_UNDOBYDEATH;
MRF_UNDOBYDEATHFORCED;
MRF_UNDOBYDEATHSAVES;
}

View file

@ -122,7 +122,7 @@ namespace CodeImp.DoomBuilder.Controls
scriptedit.IsBufferedDraw = true;
scriptedit.IsCaretLineVisible = false;
scriptedit.IsHScrollBar = true;
scriptedit.IndentationGuides = (int)ScriptIdentGuides.None;
scriptedit.IndentationGuides = (int)ScriptIdentGuides.Real;
scriptedit.IsMouseDownCaptures = true;
scriptedit.IsTabIndents = true;
scriptedit.IsUndoCollection = true;
@ -377,6 +377,12 @@ namespace CodeImp.DoomBuilder.Controls
StringBuilder constantslist = new StringBuilder("");
foreach(string c in scriptconfig.Constants)
{
if(autocompletelist.ContainsKey(c.ToUpperInvariant())) //mxd. This happens when there's a keyword and a constant with the same name...
{
General.ErrorLogger.Add(ErrorType.Error, "Constant '" + c + "' is double-defined in '" + scriptconfig.Description + "' script configuration!");
continue;
}
if(constantslist.Length > 0) constantslist.Append(" ");
constantslist.Append(c);
autocompletelist.Add(c.ToUpperInvariant(), c + "?" + imageindex);