Game Development Community

Disabling the instant group on objects

by Peter Simard · 08/23/2007 (4:39 pm) · 1 comments

This resource will allow you to designate certain classes as "No Instant Group". This is useful for preventing a flood of dynamic objects being added to your mission while it is being edited.

By flagging a class as "No Instant Group" it will not be added to your mission automatically when created. If you create a lot of objects in the background of your program, this will save you some frustration.

Code:

Modify console/compiledEval.cc
if(!placeAtRoot || !currentNewObject->getGroup())
[i]To:[/i]
            if((!placeAtRoot || !currentNewObject->getGroup()) && !currentNewObject->mDisableInstantGroup)

Add this line to console/simBase.h inside the SimObject public block:
bool mDisableInstantGroup;

Add this line to console/simBase.cc at the top of the SimObject::SimObject() block:
mDisableInstantGroup = false;

Usage:
Now you can go through your classes you do not want to be added to your mission files and add
mDisableInstantGroup = false;
to their constructor.

#1
08/24/2007 (3:55 pm)
Nice workaround.
Or you can use
MissionCleanup.add(%obj);
when creating/(adding to mission) the object you don't need to save within a .mis file, as it used in stock starter kit.