60 trans(0, 0) = array[0].getInt() / 1000.0f;
61 trans(0, 1) = array[1].getInt() / 1000.0f;
62 trans(0, 2) = array[2].getInt() / 1000.0f;
63 trans(0, 3) = array[3].getInt() / 1000.0f;
64 trans(1, 0) = array[4].getInt() / 1000.0f;
65 trans(1, 1) = array[5].getInt() / 1000.0f;
66 trans(1, 2) = array[6].getInt() / 1000.0f;
67 trans(1, 3) = array[7].getInt() / 1000.0f;
68 trans(2, 0) = array[8].getInt() / 1000.0f;
69 trans(2, 1) = array[9].getInt() / 1000.0f;
70 trans(2, 2) = array[10].getInt() / 1000.0f;
71 trans(2, 3) = array[11].getInt() / 1000.0f;
81 static void FnSetSolidMask(
C4Object *Obj,
long iX,
long iY,
long iWdt,
long iHgt,
long iTX,
long iTY)
86 static void FnSetHalfVehicleSolidMask(
C4Object *Obj,
bool set)
91 static void FnDeathAnnounce(
C4Object *Obj)
93 const long MaxDeathMsg=7;
105 char idDeathMsg[128+1];
113 if (!from || Obj == from)
151 static void FnFling(
C4Object *Obj,
long iXDir,
long iYDir,
long iPrec,
bool fAddSpeed)
170 return !!Obj->
Enter(pTarget,
true,
true,
nullptr);
173 static bool FnExit(
C4Object *Obj,
long tx,
long ty,
long tr,
long txdir,
long tydir,
long trdir)
178 return !!Obj->
Exit(tx,
202 static void FnRemoveObject(
C4Object *Obj,
bool fEjectContents)
207 static void FnSetPosition(
C4Object *Obj,
long iX,
long iY,
bool fCheckBounds,
long iPrec)
225 static void FnDoCon(
C4Object *Obj,
long iChange,
long iPrec,
bool bGrowFromCenter)
234 static long FnGetCon(
C4Object *Obj,
long iPrec)
243 static bool FnSetName(
C4PropList * _this,
C4String *pNewName,
bool fSetInInfo,
bool fMakeValidIfExists)
256 _this->
SetName(FnStringPar(pNewName));
270 const char *szName = pNewName->
GetCStr();
272 if (!szName || !*szName)
296 if (pInfoList && pInfoList->
NameExists(szName))
298 if (!fMakeValidIfExists)
328 const char *strDataName = FnStringPar(DataName);
373 const char *strDataName = FnStringPar(DataName);
397 if (iEngType.
IsNil())
401 if (iCausedBy.
IsNil())
405 Obj->
DoEnergy(iChange, fExact, iEngType, iCausedBy);
408 static void FnDoBreath(
C4Object *Obj,
long iChange)
415 if (iDmgType.
IsNil())
419 if (iCausedBy.
IsNil())
423 Obj->
DoDamage(iChange, iCausedBy, iDmgType);
426 static void FnSetEntrance(
C4Object *Obj,
bool e_status)
432 static void FnSetXDir(
C4Object *Obj,
long nxdir,
long iPrec)
444 static void FnSetRDir(
C4Object *Obj,
long nrdir,
long iPrec)
456 static void FnSetYDir(
C4Object *Obj,
long nydir,
long iPrec)
468 static void FnSetR(
C4Object *Obj,
long nr)
480 return !!Obj->
SetActionByName(FnStringPar(szAction), pTarget, pTarget2,
484 static bool FnSetActionData(
C4Object *Obj,
long iData)
504 static void FnSetComDir(
C4Object *Obj,
long ncomdir)
509 static void FnSetDir(
C4Object *Obj,
long ndir)
514 static void FnSetCategory(
C4Object *Obj,
long iCategory)
519 static void FnSetAlive(
C4Object *Obj,
bool nalv)
524 static bool FnSetOwner(
C4Object *Obj,
long iOwner)
530 static bool FnSetPhase(
C4Object *Obj,
long iVal)
535 static bool FnExecuteCommand(
C4Object *Obj)
542 const C4Value & Data,
int iRetries)
563 Obj->
SetCommand(iCommand, pTarget, Tx, iTy, pTarget2,
false, Data, iRetries, szText);
570 int iUpdateInterval,
const C4Value & Data,
int iRetries,
int iBaseMode)
589 return Obj->
AddCommand(iCommand,pTarget,Tx,iTy,iUpdateInterval,pTarget2,
true,Data,
false,iRetries,szText,iBaseMode);
594 int iUpdateInterval,
const C4Value & Data,
int iRetries,
int iBaseMode)
613 return Obj->
AddCommand(iCommand,pTarget,Tx,iTy,iUpdateInterval,pTarget2,
true,Data,
true,iRetries,szText,iBaseMode);
616 static C4Value FnGetCommand(
C4Object *Obj,
int iElement,
int iCommandNum)
620 while (Command && iCommandNum--)
622 Command = Command->
Next;
649 static bool FnFinishCommand(
C4Object *Obj,
bool fSuccess,
long iCommandNum)
653 while (Command && iCommandNum--)
655 Command = Command->
Next;
702 static bool FnGetEntrance(
C4Object *Obj)
707 static long FnGetPhase(
C4Object *Obj)
712 static long FnGetEnergy(
C4Object *Obj,
bool fExact)
724 static long FnGetBreath(
C4Object *Obj)
733 if (!_this || !_this->
GetDef())
748 static long FnGetRDir(
C4Object *Obj,
long iPrec)
757 static long FnGetXDir(
C4Object *Obj,
long iPrec)
766 static long FnGetYDir(
C4Object *Obj,
long iPrec)
778 long iR = Obj->
GetR();
790 static long FnGetComDir(
C4Object *Obj)
795 static long FnGetVertexNum(
C4Object *Obj)
840 assert(!
"FnGetVertex: unreachable code reached");
844 static bool FnSetVertex(
C4Object *Obj,
long iIndex,
long iValueToSet,
long iValue,
long iOwnVertexMode)
876 DebugLogF(
"SetVertex: Unknown vertex attribute: %ld", iValueToSet);
887 static bool FnAddVertex(
C4Object *Obj,
long iX,
long iY)
892 static bool FnInsertVertex(
C4Object *Obj,
long iIndex,
long iX,
long iY)
897 static bool FnRemoveVertex(
C4Object *Obj,
long iIndex)
902 static void FnSetContactDensity(
C4Object *Obj,
long iDensity)
907 static bool FnGetAlive(
C4Object *Obj)
912 static long FnGetOwner(
C4Object *Obj)
917 static long FnGetController(
C4Object *Obj)
922 static bool FnSetController(
C4Object *Obj,
long iNewController)
934 static long FnGetKiller(
C4Object *Obj)
939 static bool FnSetKiller(
C4Object *Obj,
long iNewKiller)
955 if (!_this || !_this->
GetDef())
975 static long FnGetDamage(
C4Object *Obj)
984 if (!_this || !_this->
GetDef())
999 static long FnGetRank(
C4Object *Obj)
1008 static long FnGetActTime(
C4Object *Obj)
1029 long iExtra,
C4String *szCaption,
long iExtraData,
1030 long iStyle,
bool fPermanent,
C4ID idMenuID)
1033 if (pCommandObj && !pCommandObj->
Status)
1044 pDef->
Draw(fctSymbol);
1060 Obj->
Menu->
Init(fctSymbol, FnStringPar(szCaption), pCommandObj, iExtra, iExtraData, (idMenuID ? idMenuID : pDef ? pDef->
id :
C4ID::None).GetHandle(), iStyle,
true);
1081 #define _snprintf snprintf
1091 char caption[256+1];
1092 char parameter[256+1];
1094 char command[512+1];
1095 char command2[512+1];
1104 const char *
s = FnStringPar(szCaption);
1105 const char * sep = strstr(
s,
"%s");
1108 strncpy(caption,
s, std::min<intptr_t>(sep -
s,256));
1109 caption[std::min<intptr_t>(sep -
s,256)] = 0;
1110 strncat(caption, pDef->
GetName(), 256);
1111 strncat(caption, sep + 2, 256);
1115 strncpy(caption,
s, 256);
1131 SCopy(Parameter.
getBool() ?
"true" :
"false", parameter);
1154 SCopy(
"nil", parameter);
1164 bool fOwnValue =
false;
1174 for (; i <
SLen(FnStringPar(szCommand)); i++)
1181 if (i <
SLen(FnStringPar(szCommand)))
1184 SCopy(FnStringPar(szCommand), dummy, 256);
1185 auto* pFound =
const_cast<char*
>(
SSearch(dummy,
"%d"));
1186 if (pFound !=
nullptr)
1188 *(pFound - 1) =
's';
1191 sprintf(command, dummy, parameter, 0);
1193 sprintf(command2, dummy, parameter, 1);
1199 const char *szScriptCom = FnStringPar(szCommand);
1200 if (szScriptCom && *szScriptCom)
1205 sprintf(command,
"%s(%s,%s,0,%ld)", szScriptCom, pDef ? pDef->
id.
ToString() :
"nil", parameter, iValue);
1206 sprintf(command2,
"%s(%s,%s,1,%ld)", szScriptCom, pDef ? pDef->
id.
ToString() :
"nil", parameter, iValue);
1211 sprintf(command,
"%s(%s,%s)", szScriptCom, pDef ? pDef->
id.
ToString() :
"nil", parameter);
1212 sprintf(command2,
"%s(%s,%s,1)", szScriptCom, pDef ? pDef->
id.
ToString() :
"nil", parameter);
1218 *command = *command2 =
'\0';
1247 fctSymbol.
Create(iSymbolSize,iSymbolSize);
1250 pDef->
Draw(fctSymbol,
false, 0,
nullptr, XPar.
getInt());
1261 if (pGfxObj && pGfxObj->
Status)
1281 pGfxObj->
Def->
Draw(fctSymbol,
false, pGfxObj->
Color, pGfxObj);
1283 fctRank = fctSymbol;
1290 fctSymbol.
Create(iSymbolSize,iSymbolSize);
1291 pGfxObj->
Def->
Draw(fctSymbol,
false, pGfxObj->
Color, pGfxObj);
1293 fctRank = fctSymbol;
1294 fctRank.
X = fctRank.
Wdt - pRankRes->
Wdt;
1295 fctRank.
Wdt = pRankRes->
Wdt;
1296 fctRank.
Hgt = pRankRes->
Hgt;
1302 fctSymbol.
Set(fctRank);
1304 fctSymbol.
Set(fctBackup);
1329 fctSymbol.
Create(iSymbolSize,iSymbolSize);
1330 uint32_t dwClr = XPar.
getInt();
1341 fctSymbol.
Create(iSymbolSize,iSymbolSize);
1349 fctSymbol.
Create(iSymbolSize,iSymbolSize);
1358 fctSymbol.
Create(iSymbolSize,iSymbolSize);
1359 pDef->
Draw(fctSymbol);
1372 bool fIsSelectable = !!*command;
1376 Obj->
Menu->
Add(caption,pGfxObj,command,iCount,
nullptr,infocaption,pDef ? pDef->
id :
C4ID::None,command2,fOwnValue,iValue,fIsSelectable);
1378 Obj->
Menu->
Add(caption,pGfx,command,iCount,
nullptr,infocaption,pDef ? pDef->
id :
C4ID::None,command2,fOwnValue,iValue,fIsSelectable);
1380 Obj->
Menu->
Add(caption,fctSymbol,command,iCount,
nullptr,infocaption,pDef ? pDef->
id :
C4ID::None,command2,fOwnValue,iValue,fIsSelectable);
1385 static bool FnSelectMenuItem(
C4Object *Obj,
long iItem)
1394 static bool FnSetMenuDecoration(
C4Object *Obj,
C4ID idNewDeco)
1401 if (!pNewDeco->
SetByDef(idNewDeco))
1410 static bool FnSetMenuTextProgress(
C4Object *Obj,
long iNewProgress)
1443 static bool FnShiftContents(
C4Object *Obj,
bool fShiftBack,
C4Def * idTarget,
bool fDoCalls)
1489 static bool FnActIdle(
C4Object *Obj)
1494 static bool FnStuck(
C4Object *Obj,
long off_x,
long off_y)
1499 static bool FnInLiquid(
C4Object *Obj)
1504 static bool FnOnFire(
C4Object *Obj)
1527 while (iCount-- > 0)
1536 static bool FnMakeCrewMember(
C4Object *Obj,
long iPlayer)
1556 static bool FnSetCrewStatus(
C4Object *Obj,
long iPlr,
bool fInCrew)
1568 static long FnSetTransferZone(
C4Object *Obj,
long iX,
long iY,
long iWdt,
long iHgt)
1581 if (!pObj || !pObj2)
1588 static long FnObjectNumber(
C4Object *Obj)
1607 static void FnSetMass(
C4Object *Obj,
long iValue)
1613 static long FnGetColor(
C4Object *Obj)
1618 static void FnSetColor(
C4Object *Obj,
long iValue)
1620 Obj->
Color = iValue;
1627 if (iFadeoutRange.
IsNil())
1635 iFadeoutRange = C4FOW_DefLightFadeoutRangeX;
1642 static long FnGetLightColor(
C4Object *Obj)
1648 static void FnSetLightColor(
C4Object *Obj,
long iValue)
1653 static void FnSetPicture(
C4Object *Obj,
long iX,
long iY,
long iWdt,
long iHgt)
1671 static bool FnCheckVisibility(
C4Object *Obj,
int plr)
1678 uint32_t clr = 0xffffffff;
1690 DebugLogF(
"SetClrModulation: Overlay %d not defined for object %d (%s)", (
int) iOverlayID, (
int) Obj->
Number, Obj->
GetName());
1718 DebugLogF(
"GetClrModulation: Overlay %d not defined for object %d (%s)", (
int) iOverlayID, (
int) Obj->
Number, Obj->
GetName());
1730 static bool FnCloseMenu(
C4Object *Obj)
1747 if (!Obj->
Status || !pObj)
1768 Log(
"SetGraphics: Background overlays not implemented!");
1775 if (!pOverlayObject)
1786 pGrp = pSrcDef->
Graphics.
Get(FnStringPar(pGfxName));
1794 switch (iOverlayMode)
1801 pOverlay->
SetAsAction(pGrp, FnStringPar(pAction), dwBlitMode);
1813 if (pOverlayObject && !pOverlayObject->
Status) pOverlayObject =
nullptr;
1814 pOverlay->
SetAsObject(pOverlayObject, dwBlitMode);
1822 if (pOverlayObject && !pOverlayObject->
Status) pOverlayObject =
nullptr;
1823 pOverlay->
SetAsRank(dwBlitMode, pOverlayObject);
1827 if (pOverlayObject && !pOverlayObject->
Status) pOverlayObject =
nullptr;
1832 DebugLog(
"SetGraphics: Invalid overlay mode");
1847 return Obj->
SetGraphics(FnStringPar(pGfxName), pSrcDef);
1850 static long FnGetDefBottom(
C4PropList * _this)
1852 if (!_this || !_this->
GetDef())
1859 assert(!obj || obj->
Def == def);
1875 static bool FnSetMenuSize(
C4Object *Obj,
long iCols,
long iRows)
1883 pMnu->
SetSize(Clamp<long>(iCols, 0, 50), Clamp<long>(iRows, 0, 50));
1887 static bool FnGetCrewEnabled(
C4Object *Obj)
1893 static void FnSetCrewEnabled(
C4Object *Obj,
bool fEnabled)
1895 bool change = (Obj->
CrewDisabled == fEnabled) ?
true :
false;
1932 static void FnDoCrewExp(
C4Object *Obj,
long iChange)
1938 static bool FnClearMenuItems(
C4Object *Obj)
1960 Obj->
Layer = pNewLayer;
1964 if (contentObj && contentObj->
Status)
1966 contentObj->
Layer = pNewLayer;
1971 static void FnSetShape(
C4Object *Obj,
long iX,
long iY,
long iWdt,
long iHgt)
1982 static bool FnSetObjDrawTransform(
C4Object *Obj,
long iA,
long iB,
long iC,
long iD,
long iE,
long iF,
long iOverlayID)
2001 if (!iB && !iC && !iD && !iF && iA==iE && (!iA || iA==1000))
2017 pTransform->
Set(1,0,0,0,1,0,0,0,1);
2027 pTransform->
Set((
float) iA/1000, (
float) iB/1000, (
float) iC/1000, (
float) iD/1000, (
float) iE/1000, (
float) iF/1000, 0, 0, 1);
2032 static bool FnSetObjDrawTransform2(
C4Object *Obj,
long iA,
long iB,
long iC,
long iD,
long iE,
long iF,
long iG,
long iH,
long iI,
long iOverlayID)
2059 #define L2F(l) ((float)l/1000)
2062 *pTransform *= matrix;
2068 static bool FnSetObjectStatus(
C4Object *Obj,
long iNewStatus,
bool fClearPointers)
2076 if (Obj->
Status == iNewStatus)
2092 static long FnGetObjectStatus(
C4Object *Obj)
2097 static bool FnAdjustWalkRotation(
C4Object *Obj,
long iRangeX,
long iRangeY,
long iSpeed)
2108 static long FnGetContact(
C4Object *Obj,
long iVertex,
long dwCheck)
2121 if (!Inside<long>(iVertex, 0, Obj->
Shape.
VtxNum-1))
2128 static long FnSetObjectBlitMode(
C4Object *Obj,
long dwNewBlitMode,
long iOverlayID)
2136 DebugLogF(
"SetObjectBlitMode: Overlay %d not defined for object %d (%s)", (
int) iOverlayID, (
int) Obj->
Number, Obj->
GetName());
2167 DebugLogF(
"SetObjectBlitMode: Overlay %d not defined for object %d (%s)", (
int) iOverlayID, (
int) Obj->
Number, Obj->
GetName());
2176 static long FnGetUnusedOverlayID(
C4Object *Obj,
long iBaseIndex)
2184 int iSearchDir = (iBaseIndex < 0) ? -1 : 1;
2187 iBaseIndex += iSearchDir;
2206 if (!PositionProvider)
2211 bool stop_previous_animations = WeightProvider.
IsNil();
2213 if (!iSibling.
IsNil() && stop_previous_animations)
2219 if (!iAttachNumber.
IsNil())
2223 if (!Attached || !Attached->
OwnChild)
2227 Instance = Attached->
Child;
2231 if (!iSibling.
IsNil())
2234 if (!s_node || s_node->
GetSlot() != iSlot)
2248 if (stop_previous_animations)
2256 if (!p_provider || !w_provider)
2286 if (!Transformation)
2290 if (!WeightProvider)
2296 if (!iAttachNumber.
IsNil())
2300 if (!Attached || !Attached->
OwnChild)
2304 Instance = Attached->
Child;
2308 if (!iSibling.
IsNil())
2311 if (!s_node || s_node->
GetSlot() != iSlot)
2332 throw C4AulExecError(
"TransformBone: Transformation is not a valid 3x4 matrix");
2364 if (iAnimationNumber.
IsNil())
2370 if (!iAttachNumber.
IsNil())
2374 if (!Attached || !Attached->
OwnChild)
2378 Instance = Attached->
Child;
2383 if (!node || node->
GetSlot() == 0)
2403 if (!iAttachNumber.
IsNil())
2407 if (!Attached || !Attached->
OwnChild)
2411 Instance = Attached->
Child;
2428 if (!_this || !_this->
GetDef())
2438 skeleton = &def->
Graphics.Mesh->GetSkeleton();
2452 if (!iAttachNumber.
IsNil())
2456 if (!Attached || !Attached->
OwnChild)
2460 Instance = Attached->
Child;
2466 const std::vector<const StdMeshAnimation*> animations = skeleton->
GetAnimations();
2469 for(
unsigned int i = 0; i < animations.size(); ++i)
2471 (*retval)[i] =
C4VString(animations[i]->Name);
2488 if (!iAttachNumber.
IsNil())
2492 if (!Attached || !Attached->
OwnChild)
2496 Instance = Attached->
Child;
2517 if (iAnimationNumber.
IsNil())
2523 if (!iAttachNumber.
IsNil())
2527 if (!Attached || !Attached->
OwnChild)
2531 Instance = Attached->
Child;
2552 if (iAnimationNumber.
IsNil())
2558 if (!iAttachNumber.
IsNil())
2562 if (!Attached || !Attached->
OwnChild)
2566 Instance = Attached->
Child;
2587 if (iAnimationNumber.
IsNil())
2593 if (!iAttachNumber.
IsNil())
2597 if (!Attached || !Attached->
OwnChild)
2601 Instance = Attached->
Child;
2622 if (iAnimationNumber.
IsNil())
2628 if (!iAttachNumber.
IsNil())
2632 if (!Attached || !Attached->
OwnChild)
2636 Instance = Attached->
Child;
2664 if (iAnimationNumber.
IsNil())
2670 if (!iAttachNumber.
IsNil())
2674 if (!Attached || !Attached->
OwnChild)
2678 Instance = Attached->
Child;
2691 throw C4AulExecError(
"TransformBone: Transformation is not a valid 3x4 matrix");
2710 if (iAnimationNumber.
IsNil())
2716 if (!iAttachNumber.
IsNil())
2720 if (!Attached || !Attached->
OwnChild)
2724 Instance = Attached->
Child;
2756 throw C4AulExecError(
"AttachMesh: Transformation is not a valid 3x4 matrix");
2794 static bool FnDetachMesh(
C4Object *Obj,
long iAttachNumber)
2815 if (!szParentBone.
IsNil())
2817 C4String* ParentBone = szParentBone;
2824 if (!szChildBone.
IsNil())
2836 static bool FnSetAttachTransform(
C4Object *Obj,
long iAttachNumber,
C4ValueArray* Transformation)
2842 if (!Transformation)
2855 throw C4AulExecError(
"SetAttachTransform: Transformation is not a valid 3x4 matrix");
2865 auto fnMakeC4ValueArray = [](
const size_t len,
const std::function<
C4Value(
size_t i)> iterable) ->
C4ValueArray* {
2867 for (
size_t i = 0; i < len; ++i) {
2868 retval->
SetItem(i, iterable(i));
2875 if (!_this || !_this->
GetDef())
2887 return fnMakeC4ValueArray(skeleton.
GetNumBones(), fnGetBoneName);
2898 return fnMakeC4ValueArray(skeleton.
GetNumBones(), fnGetBoneName);;
2908 if (!_this || !_this->
GetDef())
2918 if (iSubMesh < 0 || (
unsigned int)iSubMesh >= def->
Graphics.Mesh->GetNumSubMeshes())
2941 static bool FnSetMeshMaterial(
C4Object *Obj,
C4String* Material,
int iSubMesh)
3001 throw C4AulExecError(
"CreateParticleAtBone: Pos is not a three-vector");
3003 x.
x = (*Pos).GetItem(0).getInt();
3004 x.
y = (*Pos).GetItem(1).getInt();
3005 x.
z = (*Pos).GetItem(2).getInt();
3009 x.
x = x.
y = x.
z = 0.0f;
3016 throw C4AulExecError(
"CreateParticleAtBone: Dir is not a three-vector");
3018 dir.
x = (*Dir).GetItem(0).getInt() / 10.0f;
3019 dir.
y = (*Dir).GetItem(1).getInt() / 10.0f;
3020 dir.
z = (*Dir).GetItem(2).getInt() / 10.0f;
3024 dir.
x = dir.
y = dir.
z = 0.0f;
3031 transformed_x.
x += transform(0,3);
3032 transformed_x.
y += transform(1,3);
3033 transformed_x.
z += transform(2,3);
3035 dir = transform * dir;
3044 x = MeshTransform * x;
3045 dir = MeshTransform * dir;
3046 x.x += MeshTransform(0,3);
3047 x.y += MeshTransform(1,3);
3048 x.z += MeshTransform(2,3);
3066 const float rx = -std::min(v1.
x,v2.
x) / fabs(v2.
x - v1.
x);
3067 const float ry = -std::min(v1.
y,v2.
y) / fabs(v2.
y - v1.
y);
3068 const float dx = tx + rx*twdt;
3069 const float dy = ty + ry*thgt;
3090 DrawTransform(0, 0) = draw_transform.
mat[0];
3091 DrawTransform(0, 1) = draw_transform.
mat[1];
3092 DrawTransform(0, 2) = 0.0f;
3093 DrawTransform(0, 3) = draw_transform.
mat[2];
3094 DrawTransform(1, 0) = draw_transform.
mat[3];
3095 DrawTransform(1, 1) = draw_transform.
mat[4];
3096 DrawTransform(1, 2) = 0.0f;
3097 DrawTransform(1, 3) = draw_transform.
mat[5];
3098 DrawTransform(2, 0) = 0.0f;
3099 DrawTransform(2, 1) = 0.0f;
3100 DrawTransform(2, 2) = 1.0f;
3101 DrawTransform(2, 3) = 0.0f;
3103 x = DrawTransform * x;
3104 dir = DrawTransform * dir;
3105 x.x += DrawTransform(0,3);
3106 x.y += DrawTransform(1,3);
3107 x.z += DrawTransform(2,3);
3113 valueSpeedX.
Set(dir.x);
3114 valueSpeedY.
Set(dir.y);
3115 valueLifetime.
Set(lifetime);
3122 ::Particles.
Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, Obj);
3265 {
"GFXOV_Clothing" ,
C4V_Int, 1000},
3266 {
"GFXOV_Tools" ,
C4V_Int, 2000},
3267 {
"GFXOV_ProcessTarget" ,
C4V_Int, 3000},
3268 {
"GFXOV_Misc" ,
C4V_Int, 5000},
3347 assert(pCDef->ValType ==
C4V_Int);
3351 #define F(f) ::AddFunc(p, #f, Fn##f)
3377 ::AddFunc(p,
"SetContactDensity", FnSetContactDensity,
false);
3417 ::AddFunc(p,
"FindContents", FnFindContents,
false);
3418 ::AddFunc(p,
"FindOtherContents", FnFindOtherContents,
false);
3421 F(SetActionTargets);
3422 ::AddFunc(p,
"SetCrewStatus", FnSetCrewStatus,
false);
3427 F(SetMenuDecoration);
3428 F(SetMenuTextProgress);
3441 F(CanConcatPictureWith);
3446 F(SetClrModulation);
3449 F(GetMenuSelection);
3459 F(SetObjDrawTransform);
3460 ::AddFunc(p,
"SetObjDrawTransform2", FnSetObjDrawTransform2,
false);
3461 ::AddFunc(p,
"SetObjectStatus", FnSetObjectStatus,
false);
3462 ::AddFunc(p,
"GetObjectStatus", FnGetObjectStatus,
false);
3463 ::AddFunc(p,
"AdjustWalkRotation", FnAdjustWalkRotation,
false);
3465 F(SetObjectBlitMode);
3466 F(GetObjectBlitMode);
3467 ::AddFunc(p,
"GetUnusedOverlayID", FnGetUnusedOverlayID,
false);
3473 F(GetRootAnimation);
3474 F(GetAnimationList);
3475 F(GetAnimationLength);
3476 F(GetAnimationName);
3477 F(GetAnimationPosition);
3478 F(GetAnimationWeight);
3479 F(SetAnimationPosition);
3480 F(SetAnimationBoneTransform);
3481 F(SetAnimationWeight);
3485 F(SetAttachTransform);
3489 F(CreateParticleAtBone);
3499 F(SetHalfVehicleSolidMask);
3507 F(SetCrewExtraData);
3508 F(GetCrewExtraData);
C4Object * Object(C4PropList *_this)
C4String * String(const char *str)
void AddFunc(C4PropListStatic *Parent, const char *Name, RType(*pFunc)(ThisType *, ParTypes...), bool Public=true)
int32_t CommandByName(const char *szCommand)
const char * CommandName(int32_t iCommand)
const int32_t C4CMD_MoveTo_NoPosAdjust
const int32_t C4CMD_Mode_SilentBase
const int32_t C4CMD_MoveTo_PushTarget
const int32_t C4CMD_Mode_Base
const int32_t C4CMD_Enter_PushTarget
const int32_t C4CMD_Mode_Sub
const int32_t C4CMD_Mode_SilentSub
bool AddMenuItem(C4ConsoleGUI *console, HMENU hMenu, DWORD dwID, const char *szString, bool fEnabled)
const uint32_t OCF_Carryable
const uint32_t OCF_Inflammable
const uint32_t OCF_Construct
const uint32_t OCF_InFree
const uint32_t OCF_HitSpeed1
const uint32_t OCF_Collection
const uint32_t OCF_HitSpeed4
const uint32_t OCF_OnFire
const uint32_t OCF_Entrance
const uint32_t OCF_Container
const uint32_t OCF_Available
const uint32_t OCF_Exclusive
const uint32_t OCF_Rotate
const uint32_t OCF_HitSpeed3
const BYTE CNAT_NoCollision
const BYTE CNAT_PhaseHalfVehicle
const uint32_t OCF_InSolid
const uint32_t OCF_FullCon
const uint32_t OCF_NotContained
const BYTE CNAT_MultiAttach
const uint32_t OCF_HitSpeed2
const uint32_t OCF_CrewMember
const uint32_t OCF_InLiquid
const int32_t C4D_Foreground
const int32_t C4D_IgnoreFoW
const int32_t C4D_MouseSelect
const int32_t C4D_Border_Bottom
const int32_t C4D_Background
const int32_t C4D_Structure
const int32_t C4D_MouseIgnore
const int32_t C4D_Grab_Put
const int32_t C4D_StaticBack
const int32_t C4D_Border_Layer
const int32_t C4D_Grab_Get
const int32_t C4D_Border_Top
const int32_t C4D_Environment
const int32_t C4D_Parallax
const int32_t C4D_Vehicle
const int32_t C4D_Border_Sides
C4Def * C4Id2Def(C4ID id)
#define C4FxCall_EngScript
#define C4FxCall_DmgScript
void GameMsgObject(const char *szText, C4Object *pTarget)
C4GraphicsResource GraphicsResource
const int32_t C4MaxPhysical
const char * LoadResStr(const char *id)
bool Log(const char *szMessage)
bool DebugLog(const char *strMessage)
bool DebugLogF(const char *strMessage ...)
StdMeshInstance::ValueProvider * CreateValueProviderFromArray(C4Object *pForObj, C4ValueArray &Data, const StdMeshAnimation *pos_for_animation)
bool ObjectComPunch(C4Object *cObj, C4Object *pTarget, int32_t punch)
bool ObjectComCancelAttach(C4Object *cObj)
bool ObjectComJump(C4Object *cObj)
const int C4MN_Add_ImgRank
const int C4MN_Add_ForceNoDesc
const int C4MN_Add_ImgIndexed
const int C4MN_Add_ImgTextSpec
const int C4MN_Add_ImgColor
const int C4MN_Add_ImgPropListSpec
const int C4MN_Add_PassValue
const int C4MN_Add_ImgObjRank
const int C4MN_Add_MaxImage
bool C4ValueToMatrix(C4Value &value, StdMeshMatrix *matrix)
const int C4MN_Add_ForceCount
C4ScriptConstDef C4ScriptObjectConstMap[]
void InitObjectFunctionMap(C4AulScriptEngine *pEngine)
const int C4MN_Add_ImgObject
C4ParticleSystem Particles
const int32_t C4PVM_Cursor
const int32_t C4PVM_Target
int32_t ValidPlr(int32_t plr)
uint32_t UnsyncedRandom()
float fixtof(const C4Fixed &x)
C4Fixed itofix(int32_t x)
int fixtoi(const C4Fixed &x)
#define C4GFXBLIT_WIREFRAME
#define C4GFXBLIT_CLRSFC_OWNCLR
#define C4GFXBLIT_ADDITIVE
#define C4GFXBLIT_CLRSFC_MOD2
const char * GetC4VName(const C4V_Type Type)
C4Value C4VObj(C4Object *pObj)
C4Value C4VInt(int32_t i)
C4Value C4VString(C4String *pStr)
const char * SSearch(const char *szString, const char *szIndex)
bool IsIdentifier(char cChar)
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
int32_t Distance(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2)
void SAppendChar(char cChar, char *szStr)
bool SEqual(const char *szStr1, const char *szStr2)
size_t SLen(const char *sptr)
StdStrBuf FormatString(const char *szFmt,...)
DWORD GetClrModulation(DWORD dwSrcClr, DWORD dwDstClr, DWORD &dwBack)
StdMeshMatManager MeshMaterialManager
C4PropListStatic * GetPropList()
void RegisterGlobalConstant(const char *szName, const C4Value &rValue)
C4DefGraphics * Get(const char *szGrpName)
C4FacetSurface * pRankSymbols
void Draw(C4Facet &cgo, bool fSelected=false, DWORD iColor=0, C4Object *pObj=nullptr, int32_t iPhaseX=0, int32_t iPhaseY=0, C4DrawTransform *trans=nullptr, const char *graphicsName=nullptr)
int32_t GetValue(C4Object *pInBase, int32_t iBuyPlayer)
C4Effect * Get(const char *szName, int32_t iIndex=0, int32_t iMaxPriority=0)
bool Create(int iWdt, int iHgt, int iWdt2=C4FCT_Full, int iHgt2=C4FCT_Full)
void Set(const C4Facet &cpy)
void SetFrameDeco(FrameDecoration *pNewDeco)
bool SetByDef(C4Def *pSrcDef)
C4TransferZones TransferZones
bool DrawPropListSpecImage(C4Facet &target, C4PropList *spec)
bool DrawTextSpecImage(C4Facet &target, const char *spec, class C4DrawTransform *transform, uint32_t color=0xff)
uint32_t GetClrModulation() const
bool IsValid(const C4Object *pForObj) const
void SetAsObject(C4Object *pOverlayObj, DWORD dwBMode)
void SetBlitMode(uint32_t dwToMode)
void SetAsExtraGraphics(C4DefGraphics *pGfx, DWORD dwBMode)
void SetAsPicture(C4DefGraphics *pBaseGfx, DWORD dwBMode)
uint32_t GetBlitMode() const
void SetAsRank(DWORD dwBMode, C4Object *rank_obj)
void SetAsIngamePicture(C4DefGraphics *pBaseGfx, DWORD dwBMode)
C4DrawTransform * GetTransform()
void SetAsAction(C4DefGraphics *pBaseGfx, const char *szAction, DWORD dwBMode)
void SetAsObjectPicture(C4Object *pOverlayObj, DWORD dwBMode)
void SetClrModulation(uint32_t dwToMod)
void SetAsBase(C4DefGraphics *pBaseGfx, DWORD dwBMode)
const char * ToString() const
bool Enter(C4Object *pTarget, bool fCalls=true, bool fCopyMotion=true, bool *pfRejectCollect=nullptr)
bool SetGraphics(const char *szGraphicsName=nullptr, C4Def *pSourceDef=nullptr)
bool ShiftContents(bool fShiftBack, bool fDoCalls)
void SetHalfVehicleSolidMask(bool set)
C4PropList * GetAction() const
void UpdatLastEnergyLossCause(int32_t iNewCausePlr)
bool AddCommand(int32_t iCommand, C4Object *pTarget, C4Value iTx, int32_t iTy=0, int32_t iUpdateInterval=0, C4Object *pTarget2=nullptr, bool fInitEvaluation=true, C4Value iData=C4VNull, bool fAppend=false, int32_t iRetries=0, C4String *szText=nullptr, int32_t iBaseMode=0)
void DoExperience(int32_t change)
void UpdateFace(bool bUpdateShape, bool fTemp=false)
bool GrabInfo(C4Object *pFrom)
int32_t GetValue(C4Object *pInBase, int32_t iForPlayer)
void SetCommand(int32_t iCommand, C4Object *pTarget, C4Value iTx, int32_t iTy=0, C4Object *pTarget2=nullptr, bool fControl=false, C4Value iData=C4VNull, int32_t iRetries=0, C4String *szText=nullptr)
bool AdjustWalkRotation(int32_t iRangeX, int32_t iRangeY, int32_t iSpeed)
bool SetActionByName(C4String *ActName, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls=SAC_StartCall|SAC_AbortCall, bool fForce=false)
int32_t GetProcedure() const
C4Object * CreateContents(C4PropList *)
C4DrawTransform * pDrawTransform
void SetName(const char *NewName=nullptr) override
bool ActivateMenu(int32_t iMenu, int32_t iMenuSelect=0, int32_t iMenuData=0, int32_t iMenuPosition=0, C4Object *pTarget=nullptr)
void SetAlive(bool Alive)
bool IsVisible(int32_t iForPlr, bool fAsOverlay) const
class C4ObjectMenu * Menu
void SetCategory(int32_t Category)
void SetDir(int32_t tdir)
void Fling(C4Real txdir, C4Real tydir, bool fAddSpeed)
void ForcePosition(C4Real target_x, C4Real target_y)
bool SetLightRange(int32_t iToRange, int32_t iToFadeoutRange)
void DirectComContents(C4Object *pTarget, bool fDoCalls)
bool SetLightColor(uint32_t iValue)
bool CloseMenu(bool fForce)
bool RemoveGraphicsOverlay(int32_t iOverlayID)
StdMeshInstance * pMeshInstance
void AssignDeath(bool fForced)
void DoCon(int32_t iChange, bool grow_from_center)
void BoundsCheck(C4Real &target_x, C4Real &target_y)
int32_t LastEnergyLossCausePlayer
void AssignRemoval(bool exit_contents=false)
bool Collect(C4Object *pObj)
C4NotifyingObjectList Contents
bool Exit(int32_t iX=0, int32_t iY=0, int32_t iR=0, C4Real iXDir=Fix0, C4Real iYDir=Fix0, C4Real iRDir=Fix0, bool fCalls=true)
bool StatusDeactivate(bool fClearPointers)
void GrabContents(C4Object *pFrom)
bool ChangeDef(C4ID idNew)
uint32_t GetLightColor() const
void DoDamage(int32_t iLevel, int32_t iCausedByPlr, int32_t iCause)
bool CanConcatPictureWith(C4Object *pOtherObject) const
void SetSolidMask(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iTX, int32_t iTY)
void UpdateShape(bool bUpdateVertices=true)
bool SetPhase(int32_t iPhase)
void SetRotation(int32_t nr)
bool SetOwner(int32_t iOwner)
class C4GraphicsOverlay * GetGraphicsOverlay(int32_t iForID) const
void UpdateGraphics(bool fGraphicsChanged, bool fTemp=false)
void DoBreath(int32_t iChange)
void DoEnergy(int32_t iChange, bool fExact, int32_t iCause, int32_t iCausedByPlr)
char DeathMessage[C4MaxDeathMsg+1]
void MakeValidName(char *sName)
bool NameExists(const char *szName)
virtual bool Add(C4Object *new_obj, SortType sort_type, C4ObjectList *sorted_list=nullptr)
C4Object * Find(C4Def *def, int owner=ANY_OWNER, DWORD dwOCF=OCF_All)
virtual bool Remove(C4Object *obj)
int ObjectCount(C4ID id=C4ID::None) const
C4Object * FindOther(C4ID id, int owner=ANY_OWNER)
C4Object * GetObject(int index=0) const
C4ParticleDef * GetDef(const char *name, C4ParticleDef *exclude=nullptr)
C4ParticleSystemDefinitionList definitions
void Create(C4ParticleDef *of_def, C4ParticleValueProvider &x, C4ParticleValueProvider &y, C4ParticleValueProvider &speedX, C4ParticleValueProvider &speedY, C4ParticleValueProvider &lifetime, C4PropList *properties, int amount=1, C4Object *object=nullptr)
void Set(const C4Value &value)
C4ObjectInfoList CrewInfoList
void AdjustCursorCommand()
void SetViewMode(int32_t iMode, C4Object *pTarget=nullptr, bool immediate_position=false)
bool MakeCrewMember(C4Object *pObj, bool fForceInfo=true, bool fDoCalls=true)
bool SetObjectCrewStatus(C4Object *pCrew, bool fNewStatus)
C4Player * Get(int iPlayer) const
virtual void SetName(const char *NewName=nullptr)
virtual C4Object * GetObject()
virtual const char * GetName() const
C4PropertyName GetPropertyP(C4PropertyName k) const
C4PropList * GetPrototype() const
C4String * GetPropertyStr(C4PropertyName k) const
virtual C4Def const * GetDef() const
C4Value Call(C4PropertyName k, C4AulParSet *pPars=nullptr, bool fPassErrors=false)
bool GetProperty(C4PropertyName k, C4Value *pResult) const
const char * GetName() const override
static bool DrawRankSymbol(C4FacetSurface *fctSymbol, int32_t iRank, C4Facet *pfctRankSymbols, int32_t iRankSymbolCount, bool fOwnSurface, int32_t iXOff=0, C4Facet *cgoDrawDirect=nullptr)
void Set(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
bool AddVertex(int32_t iX, int32_t iY)
bool InsertVertex(int32_t iPos, int32_t tx, int32_t ty)
bool CheckContact(int32_t cx, int32_t cy)
void CreateOwnOriginalCopy(C4Shape &rFrom)
int32_t VtxCNAT[C4D_MaxVertex]
int32_t VtxFriction[C4D_MaxVertex]
bool RemoveVertex(int32_t iPos)
int32_t GetVertexContact(int32_t iVtx, DWORD dwCheckMask, int32_t tx, int32_t ty, const C4DensityProvider &rDensityProvider=DefaultDensityProvider)
int32_t VtxY[C4D_MaxVertex]
int32_t VtxX[C4D_MaxVertex]
StdStrBuf GetData() const
const char * GetCStr() const
bool Set(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, C4Object *pObj)
void SetItem(int32_t iElemNr, const C4Value &Value)
C4ValueArray * getArray() const
ALWAYS_INLINE bool CheckConversion(C4V_Type vtToType) const
C4Object * getObj() const
C4String * getStr() const
C4PropList * getPropList() const
const char * GetTypeName() const
C4ValueMapNames * CreateTempNameList()
int32_t AddName(const char *pnName)
int32_t GetItemNr(const char *strName) const
StdMeshTransformation Transformation
const StdMeshBox & GetBoundingBox() const
const StdMeshSkeleton & GetSkeleton() const
bool SetChildBone(const StdStrBuf &bone)
void SetAttachTransformation(const StdMeshMatrix &transformation)
bool SetParentBone(const StdStrBuf &bone)
C4Real GetPosition() const
@ LinearInterpolationNode
unsigned int GetNumber() const
const StdMeshAnimation * GetAnimation() const
void SetMaterial(size_t i, const StdMeshMaterial &material)
bool DetachMesh(unsigned int number)
AnimationNode * GetRootAnimationForSlot(int slot)
bool UpdateBoneTransforms()
AnimationNode * PlayAnimation(const StdStrBuf &animation_name, int slot, AnimationNode *sibling, ValueProvider *position, ValueProvider *weight, bool stop_previous_animation)
void SetFaceOrderingForClrModulation(uint32_t clrmod)
void StopAnimation(AnimationNode *node)
AttachedMesh * GetAttachedMeshByNumber(unsigned int number) const
const StdMesh & GetMesh() const
void SetAnimationPosition(AnimationNode *node, ValueProvider *position)
AnimationNode * GetAnimationNodeByNumber(unsigned int number)
StdSubMeshInstance & GetSubMesh(size_t i)
void SetAnimationBoneTransform(AnimationNode *node, const StdMeshTransformation &trans)
AttachedMesh * AttachMesh(const StdMesh &mesh, AttachedMesh::Denumerator *denumerator, const StdStrBuf &parent_bone, const StdStrBuf &child_bone, const StdMeshMatrix &transformation=StdMeshMatrix::Identity(), uint32_t flags=AM_None, unsigned int attach_number=0)
size_t GetNumSubMeshes() const
const StdMeshMatrix & GetBoneTransform(size_t i) const
void SetAnimationWeight(AnimationNode *node, ValueProvider *weight)
const StdMeshMaterial * GetMaterial(const char *material_name) const
static StdMeshMatrix Identity()
StdMeshTransformation Decompose() const
static StdMeshMatrix Transform(const StdMeshTransformation &transform)
const StdMeshBone * GetBoneByName(const StdStrBuf &name) const
std::vector< const StdMeshAnimation * > GetAnimations() const
const StdMeshBone & GetBone(size_t i) const
const StdMeshAnimation * GetAnimationByName(const StdStrBuf &name) const
size_t GetNumBones() const
const char * getData() const
const StdMeshMaterial & GetMaterial() const
const StdMeshMaterial & GetMaterial() const