Download scripts/2_GameLib/DayZ/entities/ScriptModel.c from FelonieZ/DayZ_Scripts: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/2_GameLib/DayZ/entities/ScriptModel.c
- Command line
-
hf download hf://datasets/FelonieZ/DayZ_Scripts/scripts/2_GameLib/DayZ/entities/ScriptModel.c
-
curl -L -o ScriptModel.c https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/2_GameLib/DayZ/entities/ScriptModel.c
1.46 kB
| [EditorAttribute("box", "GameLib/Scripted", "Script model", "-0.25 -0.25 -0.25", "0.25 0.25 0.25", "255 0 0 255", "0 0 0 0", true, true, true)] | |
| class ScriptModelClass | |
| { | |
| } | |
| ScriptModelClass ScriptModelSource; | |
| class ScriptModel: GenericEntity | |
| { | |
| [Attribute("", "resourceNamePicker", "Model", "xob")] | |
| string Model; | |
| [Attribute("1", "combobox", "Physics", "", { ParamEnum("None", "2"), ParamEnum("Static", "1"), ParamEnum("Dynamic", "0") } )] | |
| int Type; | |
| void ScriptModel(IEntitySource src, IEntity parent) | |
| { | |
| if (Model== "") | |
| return; | |
| SetFlags(EntityFlags.ACTIVE | EntityFlags.SOLID | EntityFlags.VISIBLE, false); | |
| vobject vobj = GetObject(Model); | |
| SetObject(vobj, ""); | |
| ReleaseObject(vobj, false); | |
| if (Type == 1) | |
| { | |
| dBodyCreateStatic(this, 0xffffffff); // todo - defines for layer mask | |
| } | |
| else if (Type == 0) | |
| { | |
| if(!dBodyCreateDynamic(this, 1.0, 0xffffffff)) | |
| { | |
| //create implicit box | |
| vector mins, maxs; | |
| GetBounds(mins, maxs); | |
| vector center = (mins + maxs) * 0.5; | |
| vector size = maxs - mins; | |
| PhysicsGeomDef geoms[] = {PhysicsGeomDef("", dGeomCreateBox(size), "material/default", 0xffffffff)}; | |
| dBodyCreateDynamicEx(this, center, 1, geoms); | |
| } | |
| if(dBodyIsSet(this)) | |
| { | |
| dBodySetMass(this, 1.0); | |
| dBodyActive(this, ActiveState.ACTIVE); | |
| dBodyDynamic(this, true); | |
| } | |
| } | |
| } | |
| void ~ScriptModel() | |
| { | |
| if(dBodyIsSet(this)) | |
| dBodyDestroy(this); | |
| } | |
| } | |