Skip to content

Commit 9e84c97

Browse files
committed
Create ScriptObject class to allow scripting with objects
Create a "master list" of all objects that ever exist in a level, and serialize this list Enable objects to be named Add some basic scripting functionality
1 parent a81f414 commit 9e84c97

26 files changed

+616
-3
lines changed

TheForceEngine/TFE_Asset/dfKeywords.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ static const char* c_keywords[] =
227227
"M_TRIGGER",
228228
// TFE
229229
"SCRIPTCALL:",
230+
"NAME:"
230231
};
231232

232233
#define KEYWORD_COUNT TFE_ARRAYSIZE(c_keywords)

TheForceEngine/TFE_Asset/dfKeywords.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ enum KEYWORD
234234
KW_M_TRIGGER, // INF
235235
// TFE ADDED
236236
KW_SCRIPTCALL,
237+
KW_NAME,
237238
KW_COUNT
238239
};
239240

TheForceEngine/TFE_DarkForces/Actor/actor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,8 @@ namespace TFE_DarkForces
658658
corpse->worldWidth = 0;
659659
corpse->entityFlags |= ETFLAG_CORPSE;
660660
sector_addObject(obj->sector, corpse);
661+
662+
obj_addToRefList(corpse, ObjRefType_Corpse); // scripting
661663
}
662664
}
663665
actor_kill();

TheForceEngine/TFE_DarkForces/Actor/bobaFett.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ namespace TFE_DarkForces
626626
corpse->worldHeight = 0;
627627
corpse->entityFlags |= (ETFLAG_CORPSE | ETFLAG_KEEP_CORPSE);
628628
sector_addObject(local(obj)->sector, corpse);
629+
obj_addToRefList(corpse, ObjRefType_Corpse); // scripting
629630

630631
local(physicsActor)->alive = JFALSE;
631632
actor_handleBossDeath(local(physicsActor));

TheForceEngine/TFE_DarkForces/Actor/dragon.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,8 @@ namespace TFE_DarkForces
780780
corpse->worldHeight = 0;
781781
corpse->entityFlags |= (ETFLAG_CORPSE | ETFLAG_KEEP_CORPSE);
782782
sector_addObject(sector, corpse);
783+
784+
obj_addToRefList(corpse, ObjRefType_Corpse); // scripting
783785
}
784786
local(physicsActor)->alive = JFALSE;
785787
actor_handleBossDeath(local(physicsActor));

TheForceEngine/TFE_DarkForces/Actor/mousebot.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ namespace TFE_DarkForces
253253
newObj->worldWidth = 0;
254254
newObj->worldHeight = 0;
255255
sector_addObject(local(sector), newObj);
256+
257+
obj_addToRefList(newObj, ObjRefType_Corpse); // scripting
256258
}
257259

258260
// Spawn a battery.

TheForceEngine/TFE_DarkForces/Actor/phaseOne.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,8 @@ namespace TFE_DarkForces
628628
corpse->worldHeight = 0;
629629
corpse->entityFlags |= (ETFLAG_CORPSE | ETFLAG_KEEP_CORPSE);
630630
sector_addObject(sector, corpse);
631+
632+
obj_addToRefList(corpse, ObjRefType_Corpse); // scripting
631633
}
632634
local(physicsActor)->alive = JFALSE;
633635
actor_handleBossDeath(local(physicsActor));

TheForceEngine/TFE_DarkForces/Actor/phaseThree.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,8 @@ namespace TFE_DarkForces
724724
corpse->worldHeight = 0;
725725
corpse->entityFlags |= (ETFLAG_CORPSE | ETFLAG_KEEP_CORPSE);
726726
sector_addObject(sector, corpse);
727+
728+
obj_addToRefList(corpse, ObjRefType_Corpse); // scripting
727729
}
728730
local(physicsActor)->alive = JFALSE;
729731
actor_handleBossDeath(local(physicsActor));

TheForceEngine/TFE_DarkForces/Actor/phaseTwo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ namespace TFE_DarkForces
716716
corpse->worldHeight = 0;
717717
corpse->entityFlags |= (ETFLAG_CORPSE | ETFLAG_KEEP_CORPSE);
718718
sector_addObject(sector, corpse);
719+
obj_addToRefList(corpse, ObjRefType_Corpse); // scripting
719720

720721
// Create Plasma pickup
721722
SecObject* item = item_create(ITEM_PLASMA);

TheForceEngine/TFE_DarkForces/Actor/scenery.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace TFE_DarkForces
3333
newObj->worldWidth = obj->worldWidth;
3434

3535
sector_addObject(obj->sector, newObj);
36+
obj_addToRefList(newObj, ObjRefType_Corpse); // scripting
3637
actor_kill();
3738
return 0;
3839
}

0 commit comments

Comments
 (0)