diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index 7bd463f72..69eabde90 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -1035,7 +1035,7 @@ void GuiTreeViewCtrl::_destroyTree() { Item *pFreeItem = mItems[ i ]; if( pFreeItem != NULL ) - delete pFreeItem; + _destroyItem(pFreeItem); } mItems.clear(); @@ -3145,328 +3145,7 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event) // Reparent the items. - for (S32 i = 0; i mState.clear(Item::MouseOverBmp | Item::MouseOverText ); - - // move the selected item to the newItem - Item* oldParent = item->mParent; - // Snag the current parent set if any for future reference - SimSet *parentSet = NULL; - - if(oldParent->isInspectorData()) - parentSet = dynamic_cast(oldParent->getObject()); - else - { - // parent is probably script data so we search up the tree for a - // set to put our object in - Item * temp = oldParent; - while (temp) - { - if (temp->isInspectorData()) - break; - temp = temp->mParent; - } - // found an ancestor who is an inspectorData - if (temp) - { - if (temp->isInspectorData()) - parentSet = dynamic_cast(temp->getObject()); - } - } - - // unlink from the current position in the list - unlinkItem(item); - - // update the parent's children - - // check if we an only child - if (item->mParent->mChild == item) - { - if (item->mNext) - item->mParent->mChild = item->mNext; - else - item->mParent->mChild = NULL; - } - - if (mDragMidPoint != NomDragMidPoint) - { - - //if it is below an expanded tree, place as last item in the tree - //if it is below a parent who isn't expanded put below it - - // position the item above or below another item - if (mDragMidPoint == AbovemDragMidPoint) - { - // easier to treat everything as "Below the mDragMidPoint" so make some adjustments - if (mDebug) Con::printf("adding item above mDragMidPoint"); - - // above the mid point of an item, so grab either the parent - // or the previous sibling - - // does the item have a previous sibling? - if (newItem->mPrevious) - { - newItem = newItem->mPrevious; - - if (mDebug) Con::printf("treating as if below an item that isn't expanded"); - - // otherwise add below that item as a sibling - item->mParent = newItem->mParent; - item->mPrevious = newItem; - item->mNext = newItem->mNext; - if (newItem->mNext) - newItem->mNext->mPrevious = item; - newItem->mNext = item; - } - else - { - if (mDebug) Con::printf("treating as if adding below the parent of the item"); - - // instead we add as the first item below the newItem's parent - item->mParent = newItem->mParent; - item->mNext = newItem; - item->mPrevious = NULL; - newItem->mPrevious = item; - item->mParent->mChild = item; - } - } - else if (mDragMidPoint == BelowmDragMidPoint) - { - if ((newItem->isParent())&&(newItem->isExpanded())) - { - if (mDebug) Con::printf("adding item to an expanded parent below the mDragMidPoint"); - - item->mParent = newItem; - - // then add the new item as a child - item->mNext = newItem->mChild; - if (newItem->mChild) - newItem->mChild->mPrevious = item; - item->mParent->mChild = item; - item->mPrevious = NULL; - } - else if ((!newItem->mNext)&&(newItem->mParent)&&(newItem->mParent->mParent)) - { - // add below it's parent. - if (mDebug) Con::printf("adding below a tree"); - - item->mParent = newItem->mParent->mParent; - item->mNext = newItem->mParent->mNext; - item->mPrevious = newItem->mParent; - - if (newItem->mParent->mNext) - newItem->mParent->mNext->mPrevious = item; - - newItem->mParent->mNext = item; - } - else - { - // adding below item not as a child - if (mDebug) Con::printf("adding item below the mDragMidPoint of an item"); - - item->mParent = newItem->mParent; - // otherwise the item is a sibling - if (newItem->mNext) - newItem->mNext->mPrevious = item; - item->mNext = newItem->mNext; - item->mPrevious = newItem; - newItem->mNext = item; - } - } - } - // if we're not allowed to add to items, then try to add to the parent of the hit item. - // if we are, just add to the item we hit. - else - { - if (mDebug) - { - if (item->isInspectorData() && item->getObject()) - Con::printf("Item: %i",item->getObject()->getId()); - if (newItem->isInspectorData() && newItem->getObject()) - Con::printf("Parent: %i",newItem->getObject()->getId()); - Con::printf("dragged onto an item"); - } - - // If the hit item is not a valid drag target, - // then try to add to the parent. - - if( !isValidDragTarget( newItem ) ) - { - // add to the item's parent. - if(!newItem->mParent || !newItem->mParent->isParent()) - { - if(mDebug) - Con::printf("could not find the parent of that item. dragging to an item is not allowed, kicking out."); - mDragMidPoint = NomDragMidPoint; - continue; - } - newItem = newItem->mParent; - } - - // new parent is the item in the current cell - item->mParent = newItem; - - // adjust children if any - if (newItem->mChild) - { - if (mDebug) Con::printf("not the first child"); - - // put it at the top of the list (easier to find if there are many children) - if (newItem->mChild) - newItem->mChild->mPrevious = item; - item->mNext = newItem->mChild; - newItem->mChild = item; - item->mPrevious = NULL; - } - else - { - if (mDebug) Con::printf("first child"); - - // only child - newItem->mChild = item; - item->mNext = NULL; - item->mPrevious = NULL; - } - } - - // expand the item we added to, if it isn't expanded already - if( !item->mParent->mState.test( Item::Expanded ) ) - setItemExpanded( item->mParent->mId, true ); - - //---------------------------------------------------------------- - // handle objects - - // Get our active SimObject if any - SimObject *simObj = NULL; - if(item->isInspectorData()) - { - simObj = item->getObject(); - } - - // Remove from the old parentset - if((simObj && parentSet)&&(oldParent != item->mParent)) - { - if (mDebug) Con::printf("removing item from old parentset"); - - // hack to get around the way removeObject takes the last item of the set - // and moves it into the place of the object we removed - if (parentSet->size()>0) - { - SimObject *lastObject = parentSet->last(); - parentSet->removeObject(simObj); - parentSet->reOrder(lastObject); - } - else - { - parentSet->removeObject(simObj); - } - } - - // Snag the newparent set if any... - SimSet *newParentSet = NULL; - - if(item->mParent->isInspectorData()) - { - if (mDebug) Con::printf("getting a new parent set"); - - SimObject * tmpObj = item->mParent->getObject(); - newParentSet = dynamic_cast(tmpObj); - } - else - { - // parent is probably script data so we search up the tree for a - // set to put our object in - if (mDebug) Con::printf("oh nos my parent is script!"); - - Item * temp = item->mParent; - while (temp) - { - if (temp->isInspectorData()) - break; - temp = temp->mParent; - } - - // found a ancestor who is an inspectorData - if (temp) - { - if (temp->isInspectorData()) - newParentSet = dynamic_cast(temp->getObject()); - } - else - { - newParentSet = NULL; - } - } - - if(simObj && newParentSet) - { - if (mDebug) Con::printf("simobj and new ParentSet"); - - if (oldParent != item->mParent) - newParentSet->addObject(simObj); - - //order the objects in the simset according to their - //order in the tree view control - if(!item->mNext) - { - if( item->mPrevious ) - { - //bring to the end of the set - SimObject *prevObject = item->mPrevious->getObject(); - if (prevObject && item->getObject()) - { - newParentSet->reOrder(item->getObject(), prevObject); - } - } - } - else - { - //reorder within the set - SimObject *nextObject = item->mNext->getObject(); - if(nextObject && item->getObject()) - { - newParentSet->reOrder(item->getObject(), nextObject); - } - } - } - else if (!simObj&&newParentSet) - { - // our current item is script data. but it may have children who - // is inspector data who need an updated set - if (mDebug) Con::printf("no simobj but new parentSet"); - if (item->mChild) - inspectorSearch(item->mChild, item, parentSet, newParentSet); - - } - else if (simObj&&!newParentSet) - { - if (mDebug) Con::printf("simobject and no new parent set"); - } - else - if (mDebug) Con::printf("no simobject and no new parent set"); - - // Notify script. - - if( item->isInspectorData() ) - onReparent_callback( - item->getObject()->getId(), - oldParent->getObject()->getId(), - item->mParent->getObject()->getId() - ); - else - onReparent_callback( - item->mId, - oldParent->mId, - item->mParent->mId - ); - } + reparentItems(mSelectedItems, newItem2); onEndReparenting_callback(); @@ -4798,6 +4477,362 @@ void GuiTreeViewCtrl::setItemFilterException(U32 item, bool isExempted) } } +void GuiTreeViewCtrl::reparentItems(Vector selectedItems, Item* newParent) +{ + for (S32 i = 0; i < selectedItems.size(); i++) + { + Item* item = selectedItems[i]; + + if (mDebug) + Con::printf("----------------------------"); + + // clear old highlighting of the item + item->mState.clear(Item::MouseOverBmp | Item::MouseOverText); + + // move the selected item to the newParent + Item * oldParent = item->mParent; + // Snag the current parent set if any for future reference + SimSet * parentSet = NULL; + + if (oldParent != nullptr && oldParent->isInspectorData()) + { + parentSet = dynamic_cast(oldParent->getObject()); + } + else + { + // parent is probably script data so we search up the tree for a + // set to put our object in + Item* temp = oldParent; + while (temp) + { + if (temp->isInspectorData()) + break; + temp = temp->mParent; + } + // found an ancestor who is an inspectorData + if (temp) + { + if (temp->isInspectorData()) + parentSet = dynamic_cast(temp->getObject()); + } + } + + // unlink from the current position in the list + unlinkItem(item); + + // update the parent's children + + // check if we an only child + if (item->mParent->mChild == item) + { + if (item->mNext) + item->mParent->mChild = item->mNext; + else + item->mParent->mChild = NULL; + } + + if (mDragMidPoint != NomDragMidPoint) + { + + //if it is below an expanded tree, place as last item in the tree + //if it is below a parent who isn't expanded put below it + + // position the item above or below another item + if (mDragMidPoint == AbovemDragMidPoint) + { + // easier to treat everything as "Below the mDragMidPoint" so make some adjustments + if (mDebug) + Con::printf("adding item above mDragMidPoint"); + + // above the mid point of an item, so grab either the parent + // or the previous sibling + + // does the item have a previous sibling? + if (newParent->mPrevious) + { + newParent = newParent->mPrevious; + + if (mDebug) + Con::printf("treating as if below an item that isn't expanded"); + + // otherwise add below that item as a sibling + item->mParent = newParent->mParent; + item->mPrevious = newParent; + item->mNext = newParent->mNext; + if (newParent->mNext) + newParent->mNext->mPrevious = item; + newParent->mNext = item; + } + else + { + if (mDebug) + Con::printf("treating as if adding below the parent of the item"); + + // instead we add as the first item below the newParent's parent + item->mParent = newParent->mParent; + item->mNext = newParent; + item->mPrevious = NULL; + newParent->mPrevious = item; + item->mParent->mChild = item; + } + } + else if (mDragMidPoint == BelowmDragMidPoint) + { + if ((newParent->isParent()) && (newParent->isExpanded())) + { + if (mDebug) + Con::printf("adding item to an expanded parent below the mDragMidPoint"); + + item->mParent = newParent; + + // then add the new item as a child + item->mNext = newParent->mChild; + if (newParent->mChild) + newParent->mChild->mPrevious = item; + item->mParent->mChild = item; + item->mPrevious = NULL; + } + else if ((!newParent->mNext) && (newParent->mParent) && (newParent->mParent->mParent)) + { + // add below it's parent. + if (mDebug) + Con::printf("adding below a tree"); + + item->mParent = newParent->mParent->mParent; + item->mNext = newParent->mParent->mNext; + item->mPrevious = newParent->mParent; + + if (newParent->mParent->mNext) + newParent->mParent->mNext->mPrevious = item; + + newParent->mParent->mNext = item; + } + else + { + // adding below item not as a child + if (mDebug) + Con::printf("adding item below the mDragMidPoint of an item"); + + item->mParent = newParent->mParent; + // otherwise the item is a sibling + if (newParent->mNext) + newParent->mNext->mPrevious = item; + item->mNext = newParent->mNext; + item->mPrevious = newParent; + newParent->mNext = item; + } + } + } + // if we're not allowed to add to items, then try to add to the parent of the hit item. + // if we are, just add to the item we hit. + else + { + if (mDebug) + { + if (item->isInspectorData() && item->getObject()) + Con::printf("Item: %i", item->getObject()->getId()); + if (newParent->isInspectorData() && newParent->getObject()) + Con::printf("Parent: %i", newParent->getObject()->getId()); + Con::printf("dragged onto an item"); + } + + // If the hit item is not a valid drag target, + // then try to add to the parent. + + if (!isValidDragTarget(newParent)) + { + // add to the item's parent. + if (!newParent->mParent || !newParent->mParent->isParent()) + { + if (mDebug) + Con::printf("could not find the parent of that item. dragging to an item is not allowed, kicking out."); + mDragMidPoint = NomDragMidPoint; + continue; + } + newParent = newParent->mParent; + } + + // new parent is the item in the current cell + item->mParent = newParent; + + // adjust children if any + if (newParent->mChild) + { + if (mDebug) Con::printf("not the first child"); + + // put it at the top of the list (easier to find if there are many children) + if (newParent->mChild) + newParent->mChild->mPrevious = item; + item->mNext = newParent->mChild; + newParent->mChild = item; + item->mPrevious = NULL; + } + else + { + if (mDebug) Con::printf("first child"); + + // only child + newParent->mChild = item; + item->mNext = NULL; + item->mPrevious = NULL; + } + } + + // expand the item we added to, if it isn't expanded already + if (!item->mParent->mState.test(Item::Expanded)) + setItemExpanded(item->mParent->mId, true); + + //---------------------------------------------------------------- + // handle objects + + // Get our active SimObject if any + SimObject* simObj = NULL; + if (item->isInspectorData()) + { + simObj = item->getObject(); + } + + // Remove from the old parentset + if ((simObj && parentSet) && (oldParent != item->mParent)) + { + if (mDebug) + Con::printf("removing item from old parentset"); + + // hack to get around the way removeObject takes the last item of the set + // and moves it into the place of the object we removed + if (parentSet->size() > 0) + { + SimObject* lastObject = parentSet->last(); + parentSet->removeObject(simObj); + parentSet->reOrder(lastObject); + } + else + { + parentSet->removeObject(simObj); + } + } + + // Snag the newparent set if any... + SimSet* newParentSet = NULL; + + if (item->mParent->isInspectorData()) + { + if (mDebug) + Con::printf("getting a new parent set"); + + SimObject* tmpObj = item->mParent->getObject(); + newParentSet = dynamic_cast(tmpObj); + } + else + { + // parent is probably script data so we search up the tree for a + // set to put our object in + if (mDebug) + Con::printf("oh nos my parent is script!"); + + Item* temp = item->mParent; + while (temp) + { + if (temp->isInspectorData()) + break; + temp = temp->mParent; + } + + // found a ancestor who is an inspectorData + if (temp) + { + if (temp->isInspectorData()) + newParentSet = dynamic_cast(temp->getObject()); + } + else + { + newParentSet = NULL; + } + } + + if (simObj && newParentSet) + { + if (mDebug) + Con::printf("simobj and new ParentSet"); + + if (oldParent != item->mParent) + newParentSet->addObject(simObj); + + //order the objects in the simset according to their + //order in the tree view control + if (!item->mNext) + { + if (item->mPrevious) + { + //bring to the end of the set + SimObject* prevObject = item->mPrevious->getObject(); + if (prevObject && item->getObject()) + { + newParentSet->reOrder(item->getObject(), prevObject); + } + } + } + else + { + //reorder within the set + SimObject* nextObject = item->mNext->getObject(); + if (nextObject && item->getObject()) + { + newParentSet->reOrder(item->getObject(), nextObject); + } + } + } + else if (!simObj && newParentSet) + { + // our current item is script data. but it may have children who + // is inspector data who need an updated set + if (mDebug) + Con::printf("no simobj but new parentSet"); + if (item->mChild) + inspectorSearch(item->mChild, item, parentSet, newParentSet); + + } + else if (simObj && !newParentSet) + { + if (mDebug) + Con::printf("simobject and no new parent set"); + } + else + if (mDebug) + Con::printf("no simobject and no new parent set"); + + // Notify script. + + if (item->isInspectorData()) + { + if (item->getObject() && oldParent->getObject() && item->mParent->getObject()) + onReparent_callback( + item->getObject()->getId(), + oldParent->getObject()->getId(), + item->mParent->getObject()->getId() + ); + } + else + { + onReparent_callback( + item->mId, + oldParent->mId, + item->mParent->mId + ); + } + } +} + +S32 GuiTreeViewCtrl::getTabLevel(S32 itemId) +{ + Item* item = getItem(itemId); + if (item != nullptr) + { + return item->mTabLevel; + } + + return 0; +} //============================================================================= // Console Methods. //============================================================================= @@ -5633,3 +5668,42 @@ DefineEngineMethod(GuiTreeViewCtrl, getItemAtPosition, S32, (Point2I position), { return object->getItemAtPosition(position); } + +DefineEngineMethod(GuiTreeViewCtrl, reparentItem, void, (S32 itemId, S32 parentId), (0, 0), + "Check whether the given item is currently selected in the tree.\n\n" + "@param id Item/object ID.\n" + "@return True if the given item/object is currently selected in the tree.") +{ + if (itemId == parentId || itemId < 0 || parentId < 0) + return; + + const Vector< GuiTreeViewCtrl::Item* > & selectedItems = object->getItems(); + Vector items; + GuiTreeViewCtrl::Item * parent = nullptr; + + for (S32 i = 0; i < selectedItems.size(); ++i) + { + if (selectedItems[i]->mId == itemId) + { + items.push_back(selectedItems[i]); + } + + if (selectedItems[i]->mId == parentId) + { + parent = selectedItems[i]; + } + } + + if (!items.empty() && parent != nullptr) + { + object->reparentItems(items, parent); + } +} + +DefineEngineMethod(GuiTreeViewCtrl, getTabLevel, S32, (S32 itemId), (0), + "Get the tree item at the passed in position.\n\n" + "@param position The position to check for what item is below it.\n" + "@return The id of the item under the position.") +{ + return object->getTabLevel(itemId); +} diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.h b/Engine/source/gui/controls/guiTreeViewCtrl.h index 123118db7..23de96b27 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.h +++ b/Engine/source/gui/controls/guiTreeViewCtrl.h @@ -485,6 +485,8 @@ class GuiTreeViewCtrl : public GuiArrayCtrl const Vector< Item* >& getSelectedItems() const { return mSelectedItems; } const Vector< S32 >& getSelected() const { return mSelected; } + const Vector< Item* >& getItems() const { return mItems; } + bool isSelected(S32 itemId) { return isSelected( getItem( itemId ) ); @@ -580,6 +582,10 @@ class GuiTreeViewCtrl : public GuiArrayCtrl /// Clear the current item filtering pattern. void clearFilterText() { setFilterText( String::EmptyString ); } + void reparentItems(Vector selectedItems, Item* newParent); + + S32 getTabLevel(S32 itemId); + /// @} // GuiControl diff --git a/Templates/BaseGame/game/data/StaticShapeTest/Shapes/materials.cs b/Templates/BaseGame/game/data/StaticShapeTest/Shapes/materials.cs index a0d4bf684..553b67c8d 100644 --- a/Templates/BaseGame/game/data/StaticShapeTest/Shapes/materials.cs +++ b/Templates/BaseGame/game/data/StaticShapeTest/Shapes/materials.cs @@ -16,4 +16,9 @@ singleton Material(Grid_512_Orange) specularPower0 = "0.25"; emissive[0] = "1"; translucent = "1"; + normalMap[0] = "data/pbr/images/FloorEbony_normal.png"; + invertSmoothness[0] = "1"; + roughMap[0] = "data/pbr/images/FloorEbony_rough.png"; + aoMap[0] = "data/pbr/images/FloorEbony_ao.png"; + metalMap[0] = "data/pbr/images/FloorEbony_metal.png"; }; diff --git a/Templates/BaseGame/game/data/pbr/images/base_material_ball_ALBEDO.asset.taml b/Templates/BaseGame/game/data/pbr/images/base_material_ball_ALBEDO.asset.taml new file mode 100644 index 000000000..dc831f31d --- /dev/null +++ b/Templates/BaseGame/game/data/pbr/images/base_material_ball_ALBEDO.asset.taml @@ -0,0 +1,9 @@ + diff --git a/Templates/BaseGame/game/data/pbr/levels/PbrMatTest.mis b/Templates/BaseGame/game/data/pbr/levels/PbrMatTest.mis index 7e7d7910e..c20a1e2b0 100644 --- a/Templates/BaseGame/game/data/pbr/levels/PbrMatTest.mis +++ b/Templates/BaseGame/game/data/pbr/levels/PbrMatTest.mis @@ -86,7 +86,7 @@ new Scene(PbrMatTestLevel) { surfaceTexture = "Floor_Material"; surface = "0 0 0 1 0 0 0.5 1 0 0 1 1 0 1 1"; surface = "0 1 0 0 0 0 -0.5 1 0 0 1 1 0 1 1"; - surface = "0.707107 0 0 0.707107 0 4 0 1 0 0 1 1 0 1 1"; + surface = "0.707107 0 0 0.707106 0 4 0 1 0 0 1 1 0 1 1"; surface = "0 0.707107 -0.707107 0 0 -4 -2.27374e-13 1 0 0 1 1 0 1 1"; surface = "0.5 0.5 -0.5 0.5 -4 0 -1.49012e-08 1 0 0 1 1 0 1 1"; surface = "0.5 -0.5 0.5 0.5 4 0 -1.49012e-08 1 0 0 1 1 0 1 1"; @@ -256,5 +256,20 @@ new Scene(PbrMatTestLevel) { canSave = "1"; canSaveDynamicFields = "1"; }; + /*new ConvexShape() { + Material = "Grid_512_Orange"; + position = "1.69488 -1.65352 0.772905"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + canSave = "1"; + canSaveDynamicFields = "1"; + + surface = "0 0 0 1 0 0 0.272904 0 0 0 1 1 0 0 0"; + surface = "0 1 0 0 0 0 -0.272904 0 0 0 1 1 0 0 0"; + surface = "0.707107 0 0 0.707107 0 0.05 0 0 0 0 1 1 0 0 0"; + surface = "0 0.707107 -0.707107 0 0 -0.05 0 0 0 0 1 1 0 0 0"; + surface = "0.5 0.5 -0.5 0.5 -0.370958 0 0 0 0 0 1 1 0 0 0"; + surface = "0.5 -0.5 0.5 0.5 0.370958 0 0 0 0 0 1 1 0 0 0"; + };*/ }; //--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/pbr/materials/base_material_ball.asset.taml b/Templates/BaseGame/game/data/pbr/materials/base_material_ball.asset.taml new file mode 100644 index 000000000..17f5c8331 --- /dev/null +++ b/Templates/BaseGame/game/data/pbr/materials/base_material_ball.asset.taml @@ -0,0 +1,10 @@ + diff --git a/Templates/BaseGame/game/data/pbr/materials/base_material_ball.cs b/Templates/BaseGame/game/data/pbr/materials/base_material_ball.cs new file mode 100644 index 000000000..038e49748 --- /dev/null +++ b/Templates/BaseGame/game/data/pbr/materials/base_material_ball.cs @@ -0,0 +1,7 @@ +//--- OBJECT WRITE BEGIN --- +singleton Material(base_material_ball) { + mapTo = "base_material_ball"; + DiffuseMap[0] = "data/pbr/Images/base_material_ball"; + DiffuseMapAsset[0] = "pbr:base_material_ball_ALBEDO"; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/pbr/shapes/material_ball.asset.taml b/Templates/BaseGame/game/data/pbr/shapes/material_ball.asset.taml new file mode 100644 index 000000000..abebf52f4 --- /dev/null +++ b/Templates/BaseGame/game/data/pbr/shapes/material_ball.asset.taml @@ -0,0 +1,9 @@ + diff --git a/Templates/BaseGame/game/data/pbr/shapes/material_ball.cs b/Templates/BaseGame/game/data/pbr/shapes/material_ball.cs new file mode 100644 index 000000000..ee6c40883 --- /dev/null +++ b/Templates/BaseGame/game/data/pbr/shapes/material_ball.cs @@ -0,0 +1,5 @@ + +singleton TSShapeConstructor(Material_ballDae) +{ + baseShape = "./material_ball.dae"; +}; diff --git a/Templates/BaseGame/game/data/shaderCache/.gitignore b/Templates/BaseGame/game/data/shaderCache/.gitignore index e69de29bb..170ee52c3 100644 --- a/Templates/BaseGame/game/data/shaderCache/.gitignore +++ b/Templates/BaseGame/game/data/shaderCache/.gitignore @@ -0,0 +1,3 @@ +*.hlsl +*.glsl +*.h \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.cs b/Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.cs new file mode 100644 index 000000000..a17e22786 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.cs @@ -0,0 +1,69 @@ + +// The general flow of a gane - server's creation, loading and hosting clients, and then destruction is as follows: + +// First, a client will always create a server in the event that they want to host a single player +// game. Torque3D treats even single player connections as a soft multiplayer game, with some stuff +// in the networking short-circuited to sidestep around lag and packet transmission times. + +// initServer() is called, loading the default server scripts. +// After that, if this is a dedicated server session, initDedicated() is called, otherwise initClient is called +// to prep a playable client session. + +// When a local game is started - a listen server - via calling StartGame() a server is created and then the client is +// connected to it via createAndConnectToLocalServer(). + +function SpectatorGameplay::create( %this ) +{ + //server scripts + exec("./scripts/server/camera.cs"); + exec("./scripts/server/DefaultGame.cs"); + exec("./scripts/server/VolumetricFog.cs"); + + //add DBs + if(isObject(DatablockFilesList)) + { + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/camera.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/defaultParticle.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/lights.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedDatablocks.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedDecalData.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedForestItemData.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedParticleData.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedParticleEmitterData.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/markers.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/ribbons.cs" ); + DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/sounds.cs" ); + } + + if(isObject(LevelFilesList)) + { + for( %file = findFirstFile( "data/spectatorGameplay/levels/*.mis" ); + %file !$= ""; + %file = findNextFile( "data/spectatorGameplay/levels/*.mis" )) + { + LevelFilesList.add(%file); + } + } + + if (!$Server::Dedicated) + { + //client scripts + $KeybindPath = "data/spectatorGameplay/scripts/client/default.keybinds.cs"; + exec($KeybindPath); + + %prefPath = getPrefpath(); + if(isFile(%prefPath @ "/keybinds.cs")) + exec(%prefPath @ "/keybinds.cs"); + + exec("data/spectatorGameplay/scripts/client/inputCommands.cs"); + + //guis + exec("./scripts/gui/playGui.gui"); + exec("./scripts/gui/playGui.cs"); + } +} + +function SpectatorGameplay::destroy( %this ) +{ + +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.module b/Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.module new file mode 100644 index 000000000..1ba127c2d --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.module @@ -0,0 +1,15 @@ + + + \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_heavy.dds b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_heavy.dds new file mode 100644 index 000000000..197dd4332 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_heavy.dds differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_light.dds b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_light.dds new file mode 100644 index 000000000..d726795fa Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_light.dds differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_med.dds b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_med.dds new file mode 100644 index 000000000..2b25d3263 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_med.dds differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.DAE b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.DAE new file mode 100644 index 000000000..34cad9f48 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.DAE @@ -0,0 +1,177 @@ + + + + + Richard + OpenCOLLADA for 3ds Max; Version: 1.4.1; Revision: exported; Platform: x64; Configuration: Release_Max2011_static + file:///G:/Documents%20and%20Settings/Richard/Mijn%20documenten/3dsmax/scenes/FogVolumes.max + + 2014-08-16T10:10:23 + 2014-08-16T10:10:23 + + Z_UP + + + + + + + + 0 0 0 1 + + + 0.588 0.588 0.588 1 + + + 0.588 0.588 0.588 1 + + + 0.9 0.9 0.9 1 + + + 0 + + + 0 0 0 1 + + + 1 1 1 1 + + + 1 + + + + + + + + 0 + 0 + 0 + 1.5 + 0 + 3 + 1 + 0 + + + 1 + 1 + 0 + 0.1 + 0 + + + + + + + + + + + + + + + -0.85 -1 -0.85 0.85 -0.85 -1 -1 0.85 -0.85 0.85 0.85 -1 -0.85 -1 0.85 1 -0.85 0.85 -1 0.85 0.85 0.85 1 0.85 -1 -0.85 -0.85 -0.85 -0.85 -1 1 -0.85 -0.85 0.85 -1 -0.85 -0.85 1 -0.85 -0.85 0.85 -1 0.85 1 -0.85 1 0.85 -0.85 -0.85 -0.85 1 -1 -0.85 0.85 0.85 -0.85 1 0.85 -1 0.85 -0.85 0.85 1 -0.85 1 0.85 0.85 0.85 1 1 0.85 0.85 + + + + + + + + + + -0.341586 -0.341586 -0.8755786 -0.341586 0.341586 -0.8755788 0.341586 0.341586 -0.8755788 0.341586 -0.341586 -0.8755788 -0.341586 -0.341586 0.8755786 0.341586 -0.341586 0.8755788 0.341586 0.341586 0.8755788 -0.341586 0.341586 0.8755788 -0.341586 -0.8755786 -0.341586 0.341586 -0.8755788 -0.341586 0.341586 -0.8755786 0.341586 -0.341586 -0.8755788 0.341586 0.8755786 -0.341586 -0.341586 0.8755788 0.341586 -0.341586 0.8755786 0.341586 0.341586 0.8755788 -0.341586 0.341586 0.341586 0.8755786 -0.341586 -0.341586 0.8755788 -0.341586 -0.341586 0.8755786 0.341586 0.341586 0.8755788 0.341586 -0.8755786 0.341586 -0.341586 -0.8755788 -0.341586 -0.341586 -0.8755786 -0.341586 0.341586 -0.8755788 0.341586 0.341586 + + + + + + + + + + 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0.07542458 0.07542461 4.99755e-4 0.07542479 0.07542461 4.99547e-4 0.07542455 0.07542461 4.99755e-4 0.07542461 0.9245752 4.99547e-4 0.07542458 0.9245754 4.99755e-4 0.07542458 0.9245754 0.9995003 0.07542455 0.9245754 4.99755e-4 0.07542455 0.9245754 0.9995003 0.9245752 0.07542461 4.99576e-4 0.9245754 0.07542479 4.99547e-4 0.07542458 0.07542461 0.9995003 0.9245752 0.07542461 4.99576e-4 0.9245752 0.07542461 0.9995004 0.9245752 0.9245754 4.99547e-4 0.07542455 0.07542461 0.9995003 0.9245752 0.07542461 0.9995004 0.07542461 0.07542479 0.9995005 0.9245752 0.9245754 4.99576e-4 0.9245752 0.07542461 0.9995005 0.9245752 0.9245754 4.99576e-4 0.07542479 0.9245754 0.9995005 0.9245752 0.9245754 0.9995004 0.9245754 0.9245752 0.9995005 0.9245752 0.9245754 0.9995004 0.9995003 0.07542461 0.07542458 0.9245752 4.99547e-4 0.07542461 0.9245752 4.99547e-4 0.07542461 0.9995003 0.07542461 0.07542458 0.9995003 0.07542461 0.9245754 0.9245752 4.99547e-4 0.9245754 0.9245752 4.99547e-4 0.9245754 0.9995003 0.07542461 0.9245754 0.9995003 0.9245754 0.07542458 0.9245752 0.9995005 0.07542461 0.9995003 0.9245754 0.07542458 0.9245752 0.9995005 0.07542461 0.9995003 0.9245754 0.9245754 0.9245752 0.9995005 0.9245754 0.9995003 0.9245754 0.9245754 0.9245752 0.9995005 0.9245754 0.9995004 0.07542482 0.07542461 0.9995003 0.9245754 0.07542461 0.9245752 0.9995004 0.07542461 0.07542455 0.9995003 0.07542461 4.99606e-4 0.9245752 0.07542461 4.99725e-4 0.07542458 0.07542461 0.07542479 4.99576e-4 0.07542461 0.9245754 4.99755e-4 0.07542461 0.07542458 4.99755e-4 0.9245754 0.9245752 4.99576e-4 0.9245754 0.9995003 0.07542458 0.9245754 0.9995004 0.9245752 0.9245754 0.9245754 0.9995003 0.9245754 0.07542482 0.9995004 0.9245754 4.99755e-4 0.9245754 0.9245754 4.99576e-4 0.07542482 0.9245754 0.9995003 0.07542461 0.07542458 0.9995003 0.9245754 0.07542458 0.9995003 0.9245754 0.07542458 0.9995003 0.07542461 0.07542458 0.9995003 0.07542461 0.9245754 0.9995003 0.9245754 0.9245754 0.9995003 0.07542461 0.9245754 0.9995003 0.9245754 0.9245754 + + + + + + + + + + -0.8644259 0.01841655 0.3300502 -0.8715108 -0.05526615 0.3184382 -0.8644259 0.01841664 -0.3300501 -0.8715108 -0.05526611 -0.3184382 0.8738725 -0.06754867 0.3145678 0.8597026 -0.006149054 -0.3377912 0.8738725 -0.06754874 -0.3145678 0.8597026 -0.006148929 0.3377911 0.883319 -0.2990854 -0.116681 0.8478944 0.3571441 -0.06756432 0.8597026 0.3377913 0.00614921 0.883319 -0.2990854 0.116681 0.2990854 0.883319 -0.116681 -0.3571441 0.8478944 -0.06756432 -0.3377913 0.8597026 0.00614921 0.2990854 0.883319 0.116681 -0.883319 0.2990854 -0.116681 -0.8478944 -0.3571441 -0.06756432 -0.8597026 -0.3377913 0.00614921 -0.883319 0.2990854 0.116681 -0.2990854 -0.883319 -0.116681 0.3571441 -0.8478944 -0.06756432 0.3377913 -0.8597026 0.00614921 -0.2990854 -0.883319 0.116681 0.8360862 -0.3764972 0.1289794 0.7071068 -0.7071068 0 0.7071068 0.7071068 0 0.3764972 0.8360862 0.1289794 -0.3764972 -0.8360862 0.1289794 -0.7071068 -0.7071068 0 -0.7071068 0.7071068 0 -0.8360862 0.3764972 0.1289794 0.8360862 -0.3764971 -0.1289794 0.7071068 -0.7071068 0 0.3764971 0.8360862 -0.1289794 0.7071068 0.7071068 0 -0.3764971 -0.8360862 -0.1289794 -0.7071068 -0.7071068 0 -0.8360862 0.3764971 -0.1289794 -0.7071068 0.7071068 0 -0.376497 0.1289792 0.8360862 -0.3764973 -0.1289798 0.8360861 -0.8833191 -0.2990855 0.1166808 -0.883319 0.2990853 -0.1166812 -0.3764971 0.1289794 -0.8360862 -0.3764972 -0.1289795 -0.8360862 -0.8833191 -0.2990855 -0.1166807 -0.883319 0.2990853 0.1166812 0.883319 -0.2990853 0.1166812 0.8833191 0.2990855 -0.1166807 0.3764971 0.1289797 -0.8360862 0.3764971 -0.1289793 -0.8360862 0.883319 -0.2990853 -0.1166811 0.8833191 0.2990855 0.1166808 0.3764972 0.1289799 0.8360861 0.3764971 -0.128979 0.8360862 0.3764972 0.8360862 0.1289794 0.3764971 0.8360862 -0.1289794 0.8360862 -0.3764971 -0.1289794 0.8360862 -0.3764972 0.1289794 -0.8360862 0.3764972 0.1289794 -0.8360862 0.3764971 -0.1289794 -0.3764972 -0.8360862 0.1289794 -0.3764971 -0.8360862 -0.1289794 + + + + + + + + + + 0.1043954 -0.9396398 0.3258505 -0.06496345 -0.9379679 -0.3405817 0.1043953 -0.9396398 -0.3258505 -0.06496349 -0.937968 0.3405817 0.05187585 -0.9370471 -0.3453283 -0.1307439 -0.939827 -0.3156443 0.05187577 -0.9370471 0.3453283 -0.1307438 -0.939827 0.3156443 0 0.3634471 -0.9316148 -0.196368 0.2889368 -0.9369926 0.1307441 -0.3156442 -0.939827 0 -0.3634471 -0.9316148 -0.3634471 0 -0.9316148 -0.2889368 -0.196368 -0.9369926 0.3156442 0.1307441 -0.939827 0.3634471 0 -0.9316148 0 -0.3634471 -0.9316148 0.196368 -0.2889368 -0.9369926 -0.1307441 0.3156442 -0.939827 0 0.3634471 -0.9316148 0.3634471 0 -0.9316148 0.2889368 0.196368 -0.9369926 -0.3156442 -0.1307441 -0.939827 -0.3634471 0 -0.9316148 0.2608475 0.2608475 -0.9294714 0.6191276 0.6191276 -0.4830755 -0.6191276 0.6191276 -0.4830755 -0.2608475 0.2608475 -0.9294714 0.2608475 -0.2608475 -0.9294714 0.6191276 -0.6191276 -0.4830755 -0.6191276 -0.6191276 -0.4830755 -0.2608475 -0.2608475 -0.9294714 -0.2608475 -0.2608475 -0.9294714 -0.6191276 -0.6191276 -0.4830755 0.2608475 -0.2608475 -0.9294714 0.6191276 -0.6191276 -0.4830755 -0.2608475 0.2608475 -0.9294714 -0.6191276 0.6191276 -0.4830755 0.2608475 0.2608475 -0.9294714 0.6191276 0.6191276 -0.4830755 0.2608476 -0.9294715 0.2608473 -0.2608474 -0.9294714 -0.2608479 1.81809e-7 -0.363447 -0.9316149 2.27262e-7 -0.3634472 -0.9316148 0.2608475 -0.9294714 -0.2608475 -0.2608475 -0.9294714 0.2608477 2.72714e-7 -0.363447 0.9316149 2.72714e-7 -0.3634472 0.9316148 2.72714e-7 -0.3634472 -0.9316148 2.72714e-7 -0.363447 -0.9316149 -0.2608474 -0.9294714 -0.2608478 0.2608476 -0.9294714 0.2608474 1.81809e-7 -0.3634472 0.9316148 2.27262e-7 -0.3634471 0.9316149 -0.2608473 -0.9294714 0.260848 0.2608477 -0.9294715 -0.2608472 -0.2608475 0.2608475 -0.9294714 0.2608475 -0.2608475 -0.9294714 -0.2608475 -0.2608475 -0.9294714 0.2608475 0.2608475 -0.9294714 -0.2608475 -0.2608475 -0.9294714 0.2608475 0.2608475 -0.9294714 0.2608475 -0.2608475 -0.9294714 -0.2608475 0.2608475 -0.9294714 + + + + + + + + + + + + + + + + + +

9 0 21 0 13 1 25 1 3 2 15 2 3 2 15 2 1 3 13 3 9 0 21 0 16 4 28 4 18 5 30 5 22 6 34 6 22 6 34 6 20 7 32 7 16 4 28 4 0 8 12 8 11 9 23 9 19 10 31 10 19 10 31 10 4 11 16 11 0 8 12 8 10 12 22 12 15 13 27 13 23 14 35 14 23 14 35 14 5 15 17 15 10 12 22 12 14 16 26 16 12 17 24 17 21 18 33 18 21 18 33 18 7 19 19 19 14 16 26 16 2 20 14 20 8 21 20 21 17 22 29 22 17 22 29 22 6 23 18 23 2 20 14 20 0 8 36 24 8 21 20 21 9 0 37 25 1 3 38 26 10 12 39 27 11 9 23 9 2 20 40 28 12 17 24 17 13 1 41 29 3 2 42 30 14 16 43 31 15 13 27 13 4 11 44 32 16 4 45 33 17 22 29 22 5 15 46 34 18 5 47 35 19 10 31 10 6 23 48 36 20 7 49 37 21 18 33 18 7 19 50 38 22 6 51 39 23 14 35 14 9 0 21 0 8 21 52 40 2 20 53 41 2 20 53 41 13 1 25 1 9 0 21 0 13 1 25 1 12 17 54 42 14 16 55 43 14 16 55 43 3 2 15 2 13 1 25 1 3 2 15 2 15 13 56 44 10 12 57 45 10 12 57 45 1 3 13 3 3 2 15 2 1 3 13 3 11 9 58 46 0 8 59 47 0 8 59 47 9 0 21 0 1 3 13 3 16 4 28 4 4 11 60 48 19 10 61 49 19 10 61 49 18 5 30 5 16 4 28 4 18 5 30 5 5 15 62 50 23 14 63 51 23 14 63 51 22 6 34 6 18 5 30 5 22 6 34 6 7 19 64 52 21 18 65 53 21 18 65 53 20 7 32 7 22 6 34 6 20 7 32 7 6 23 66 54 17 22 67 55 17 22 67 55 16 4 28 4 20 7 32 7 11 9 23 9 10 12 68 56 5 15 69 57 5 15 69 57 19 10 31 10 11 9 23 9 4 11 70 58 17 22 29 22 8 21 20 21 8 21 20 21 0 8 71 59 4 11 70 58 15 13 27 13 14 16 72 60 7 19 73 61 7 19 73 61 23 14 35 14 15 13 27 13 12 17 24 17 2 20 74 62 6 23 75 63 6 23 75 63 21 18 33 18 12 17 24 17

+
+
+
+
+ + + + + 0 0 0 + + + + + + + + + + + + + + + + + + + + 1 + 1 + 1 + 1 + + + + + + + + +
\ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.cs b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.cs new file mode 100644 index 000000000..3c686032c --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.cs @@ -0,0 +1,8 @@ + +singleton TSShapeConstructor(Fog_CubeDAE) +{ + baseShape = "./Fog_Cube.DAE"; + lodType = "TrailingNumber"; + neverImport = "env*"; + loadLights = "0"; +}; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/lights/corona.png b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/corona.png new file mode 100644 index 000000000..b325da06e Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/corona.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet0.png b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet0.png new file mode 100644 index 000000000..c043c08ec Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet0.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet1.png b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet1.png new file mode 100644 index 000000000..04abc05b3 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet1.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensflareSheet3.png b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensflareSheet3.png new file mode 100644 index 000000000..aa5f3ef47 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensflareSheet3.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/lights/materials.cs b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/materials.cs new file mode 100644 index 000000000..5371f3098 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/lights/materials.cs @@ -0,0 +1,30 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +singleton Material( Corona_Mat ) +{ + emissive = true; + translucent = true; + mapTo = "corona.png"; + diffuseMap[0] = "./corona.png"; + materialTag0 = "FX"; +}; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_black.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_black.png new file mode 100644 index 000000000..5e57c16c2 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_black.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_blue.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_blue.png new file mode 100644 index 000000000..2511284dd Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_blue.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen.png new file mode 100644 index 000000000..179831bea Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen_lines.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen_lines.png new file mode 100644 index 000000000..4a09fc4a1 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen_lines.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_green.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_green.png new file mode 100644 index 000000000..d2cbde68e Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_green.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey.png new file mode 100644 index 000000000..c4b574c76 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey_base.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey_base.png new file mode 100644 index 000000000..a1e440f29 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey_base.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange.png new file mode 100644 index 000000000..43c4953e8 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange_lines.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange_lines.png new file mode 100644 index 000000000..51813d98c Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange_lines.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_red.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_red.png new file mode 100644 index 000000000..a9f95638a Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_red.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/black.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/black.png new file mode 100644 index 000000000..f3d8a1d2a Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/black.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/fizz_noise.dds b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/fizz_noise.dds new file mode 100644 index 000000000..2cb6cee10 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/fizz_noise.dds differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/gray.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/gray.png new file mode 100644 index 000000000..566fd5e6c Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/gray.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/materials.cs b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/materials.cs new file mode 100644 index 000000000..65f0ae764 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/materials.cs @@ -0,0 +1,17 @@ +singleton Material(White) +{ + mapTo = "unmapped_mat"; + diffuseMap[0] = "data/spectatorGameplay/art/misc/white.png"; +}; + +singleton Material(Grid_512_Gray) +{ + mapTo = "unmapped_mat"; + diffuseMap[0] = "data/spectatorGameplay/art/misc/512_grey.png"; +}; + +singleton Material(Orange512_lines) +{ + mapTo = "unmapped_mat"; + diffuseMap[0] = "data/spectatorGameplay/art/misc/512_orange_lines.png"; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/splash.bmp b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/splash.bmp new file mode 100644 index 000000000..47cb47f97 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/splash.bmp differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/misc/white.png b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/white.png new file mode 100644 index 000000000..410223f25 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/misc/white.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/particles/defaultParticle.png b/Templates/BaseGame/game/data/spectatorGameplay/art/particles/defaultParticle.png new file mode 100644 index 000000000..cb899f84d Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/particles/defaultParticle.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/particles/ribbon/materials.cs b/Templates/BaseGame/game/data/spectatorGameplay/art/particles/ribbon/materials.cs new file mode 100644 index 000000000..fff6b6c4f --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/particles/ribbon/materials.cs @@ -0,0 +1,87 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +// This material should work fine for uniformly colored ribbons. + +//Basic ribbon shader///////////////////////////////////////////// + +new ShaderData( BasicRibbonShader ) +{ + DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderV.hlsl"; + DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderP.hlsl"; + + OGLVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/gl/basicRibbonShaderV.glsl"; + OGLPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/gl/basicRibbonShaderP.glsl"; + + samplerNames[0] = "$ribTex"; + + pixVersion = 2.0; +}; + +singleton CustomMaterial( BasicRibbonMat ) +{ + shader = BasicRibbonShader; + version = 2.0; + + emissive[0] = true; + + doubleSided = true; + translucent = true; + BlendOp = AddAlpha; + translucentBlendOp = AddAlpha; + + preload = true; +}; + +// This material can render a texture on top of a ribbon. + +//Texture ribbon shader///////////////////////////////////////////// + +new ShaderData( TexturedRibbonShader ) +{ + DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderV.hlsl"; + DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderP.hlsl"; + + OGLVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/gl/texRibbonShaderV.glsl"; + OGLPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/gl/texRibbonShaderP.glsl"; + + samplerNames[0] = "$ribTex"; + + pixVersion = 2.0; +}; + +singleton CustomMaterial( TexturedRibbonMat ) +{ + shader = TexturedRibbonShader; + version = 2.0; + + emissive[0] = true; + + doubleSided = true; + translucent = true; + BlendOp = AddAlpha; + translucentBlendOp = AddAlpha; + + sampler["ribTex"] = "data/spectatorGameplay/art/ribbons/ribTex.png"; + + preload = true; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureOther.png b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureOther.png new file mode 100644 index 000000000..a2f08fe6a Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureOther.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureTop.png b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureTop.png new file mode 100644 index 000000000..93ca1330b Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureTop.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath.png b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath.png new file mode 100644 index 000000000..2f08509c2 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath_normal.png b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath_normal.png new file mode 100644 index 000000000..3122dbe41 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath_normal.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/roads/materials.cs b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/materials.cs new file mode 100644 index 000000000..4ae5c03ec --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/roads/materials.cs @@ -0,0 +1,42 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +singleton Material(DefaultDecalRoadMaterial) +{ + diffuseMap[0] = "data/spectatorGameplay/art/roads/defaultRoadTextureTop.png"; + mapTo = "unmapped_mat"; + materialTag0 = "RoadAndPath"; +}; + +singleton Material(DefaultRoadMaterialTop) +{ + mapTo = "unmapped_mat"; + diffuseMap[0] = "data/spectatorGameplay/art/roads/defaultRoadTextureTop.png"; + materialTag0 = "RoadAndPath"; +}; + +singleton Material(DefaultRoadMaterialOther) +{ + mapTo = "unmapped_mat"; + diffuseMap[0] = "data/spectatorGameplay/art/roads/defaultRoadTextureOther.png"; + materialTag0 = "RoadAndPath"; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/.gitignore b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/.gitignore new file mode 100644 index 000000000..1bc0e838a --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/.gitignore @@ -0,0 +1 @@ +# Keep directory in git repo diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/blue.jpg b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/blue.jpg new file mode 100644 index 000000000..b6fcd4e66 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/blue.jpg differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.dts b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.dts new file mode 100644 index 000000000..fdd5dbbe0 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.dts differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.mb b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.mb new file mode 100644 index 000000000..641f1c1b6 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.mb differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.png b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.png new file mode 100644 index 000000000..4cde4fe67 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/green.jpg b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/green.jpg new file mode 100644 index 000000000..c95126226 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/green.jpg differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/materials.cs b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/materials.cs new file mode 100644 index 000000000..c3620b36d --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/materials.cs @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +singleton Material(OctahedronMat) +{ + mapTo = "green"; + + diffuseMap[0] = "camera"; + + translucent = "1"; + translucentBlendOp = "LerpAlpha"; + emissive = "0"; + castShadows = "0"; + + colorMultiply[0] = "0 1 0 1"; +}; + +singleton Material(SimpleConeMat) +{ + mapTo = "blue"; + + diffuseMap[0] = "blue"; + translucent = "0"; + emissive = "1"; + castShadows = "0"; +}; + +//--- camera.dts MATERIALS BEGIN --- +singleton Material(CameraMat) +{ + mapTo = "pasted__phongE1"; + + diffuseMap[0] = "camera"; + + diffuseColor[0] = "0 0.627451 1 1"; + specular[0] = "1 1 1 1"; + specularPower[0] = 211; + pixelSpecular[0] = 1; + emissive[0] = 1; + + doubleSided = 1; + translucent = true; + translucentBlendOp = "LerpAlpha"; + castShadows = false; + materialTag0 = "Miscellaneous"; +}; + +//--- camera.dts MATERIALS END --- diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.3ds b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.3ds new file mode 100644 index 000000000..e4004f283 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.3ds differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.dts b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.dts new file mode 100644 index 000000000..c10f96663 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.dts differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.3ds b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.3ds new file mode 100644 index 000000000..090cb5d93 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.3ds differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.dts b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.dts new file mode 100644 index 000000000..ed356132d Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.dts differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.mtl b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.mtl new file mode 100644 index 000000000..4e946ac63 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.mtl @@ -0,0 +1,10 @@ +newmtl simplecone +Ka 0 0 0 +Kd 0 0.501961 0.752941 +Ks 0 0 0 +Ni 1 +Ns 400 +Tf 1 1 1 +d 1 +map_Kd blue.jpg + diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/materials.cs b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/materials.cs new file mode 100644 index 000000000..493573f5b --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/materials.cs @@ -0,0 +1,19 @@ +//----------------------------------------------------------------------------- +// Torque +// Copyright GarageGames, LLC 2011 +//----------------------------------------------------------------------------- + +singleton CubemapData( BlankSkyCubemap ) +{ + cubeFace[0] = "./skybox_1"; + cubeFace[1] = "./skybox_2"; + cubeFace[2] = "./skybox_3"; + cubeFace[3] = "./skybox_4"; + cubeFace[4] = "./skybox_5"; + cubeFace[5] = "./skybox_6"; +}; + +singleton Material( BlankSkyMat ) +{ + cubemap = BlankSkyCubemap; +}; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_1.jpg b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_1.jpg new file mode 100644 index 000000000..871322e94 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_1.jpg differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_2.jpg b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_2.jpg new file mode 100644 index 000000000..3e2a810de Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_2.jpg differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_3.jpg b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_3.jpg new file mode 100644 index 000000000..757f99b33 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_3.jpg differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_4.jpg b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_4.jpg new file mode 100644 index 000000000..30eb1d2a3 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_4.jpg differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_5.jpg b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_5.jpg new file mode 100644 index 000000000..10a24db73 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_5.jpg differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_6.jpg b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_6.jpg new file mode 100644 index 000000000..3ec28d02e Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_6.jpg differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud1.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud1.png new file mode 100644 index 000000000..f13b63d5a Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud1.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud2.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud2.png new file mode 100644 index 000000000..a7ee34b6c Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud2.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud3.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud3.png new file mode 100644 index 000000000..5767f5486 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud3.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/clouds_normal_displacement.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/clouds_normal_displacement.png new file mode 100644 index 000000000..0419cdace Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/clouds_normal_displacement.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/materials.cs b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/materials.cs new file mode 100644 index 000000000..79cc050fc --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/materials.cs @@ -0,0 +1,53 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +singleton CubemapData( NightCubemap ) +{ + cubeFace[0] = "./skybox_1"; + cubeFace[1] = "./skybox_2"; + cubeFace[2] = "./skybox_3"; + cubeFace[3] = "./skybox_4"; + cubeFace[4] = "./skybox_5"; + cubeFace[5] = "./skybox_6"; +}; + +singleton Material( NightSkyMat ) +{ + cubemap = NightCubemap; + materialTag0 = "Skies"; +}; + +singleton Material( Moon_Glow_Mat ) +{ + baseTex = "./moon_wglow.png"; + emissive = true; + translucent = true; + vertColor[ 0 ] = true; +}; + +singleton Material( Moon_Mat ) +{ + baseTex = "./moon_noglow.png"; + emissive = true; + translucent = true; + vertColor[ 0 ] = true; +}; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_noglow.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_noglow.png new file mode 100644 index 000000000..973ddb6c2 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_noglow.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wcorona.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wcorona.png new file mode 100644 index 000000000..568f260ba Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wcorona.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wglow.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wglow.png new file mode 100644 index 000000000..e8fdf0647 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wglow.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_1.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_1.png new file mode 100644 index 000000000..aa9a94cc8 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_1.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_2.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_2.png new file mode 100644 index 000000000..c04d1648a Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_2.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_3.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_3.png new file mode 100644 index 000000000..00d03d634 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_3.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_4.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_4.png new file mode 100644 index 000000000..1ba8ba331 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_4.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_5.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_5.png new file mode 100644 index 000000000..c71140a0d Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_5.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_6.png b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_6.png new file mode 100644 index 000000000..6398ace05 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_6.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/water/depthcolor_ramp.png b/Templates/BaseGame/game/data/spectatorGameplay/art/water/depthcolor_ramp.png new file mode 100644 index 000000000..749cec437 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/water/depthcolor_ramp.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/water/foam.dds b/Templates/BaseGame/game/data/spectatorGameplay/art/water/foam.dds new file mode 100644 index 000000000..6469bdb9c Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/water/foam.dds differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/art/water/ripple.dds b/Templates/BaseGame/game/data/spectatorGameplay/art/water/ripple.dds new file mode 100644 index 000000000..aa9285883 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/art/water/ripple.dds differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.asset.taml b/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.asset.taml new file mode 100644 index 000000000..c3917fcd3 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.asset.taml @@ -0,0 +1,7 @@ + diff --git a/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.mis b/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.mis new file mode 100644 index 000000000..de98a2e7a --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.mis @@ -0,0 +1,109 @@ +//--- OBJECT WRITE BEGIN --- +new Scene(Empty_RoomLevel) { + canSave = "1"; + canSaveDynamicFields = "1"; + Enabled = "1"; + + new LevelInfo(TheLevelInfo) { + nearClip = "0.1"; + visibleDistance = "1000"; + visibleGhostDistance = "0"; + decalBias = "0.0015"; + fogColor = "0.6 0.6 0.7 1"; + fogDensity = "0"; + fogDensityOffset = "700"; + fogAtmosphereHeight = "0"; + canvasClearColor = "0 0 0 255"; + ambientLightBlendPhase = "1"; + ambientLightBlendCurve = "0 0 -1 -1"; + advancedLightmapSupport = "0"; + soundDistanceModel = "Linear"; + class = "DefaultGame"; + canSave = "1"; + canSaveDynamicFields = "1"; + desc0 = "An empty room ready to be populated with Torque objects."; + Enabled = "1"; + levelName = "Empty Room"; + }; + new SkyBox(theSky) { + Material = "BlankSkyMat"; + drawBottom = "1"; + fogBandHeight = "0"; + position = "0 0 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + canSave = "1"; + canSaveDynamicFields = "1"; + }; + new Sun(theSun) { + azimuth = "230.396"; + elevation = "45"; + color = "0.968628 0.901961 0.901961 1"; + ambient = "0.8 0.972549 0.996078 1"; + brightness = "1"; + castShadows = "1"; + staticRefreshFreq = "250"; + dynamicRefreshFreq = "8"; + coronaEnabled = "1"; + coronaScale = "0.5"; + coronaTint = "1 1 1 1"; + coronaUseLightColor = "1"; + flareScale = "1"; + attenuationRatio = "0 1 1"; + shadowType = "PSSM"; + texSize = "1024"; + overDarkFactor = "3000 2000 1000 250"; + shadowDistance = "400"; + shadowSoftness = "0.25"; + numSplits = "4"; + logWeight = "0.96"; + fadeStartDistance = "325"; + lastSplitTerrainOnly = "0"; + representedInLightmap = "0"; + shadowDarkenColor = "0 0 0 -1"; + includeLightmappedGeometryInShadow = "0"; + position = "0 0 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + canSave = "1"; + canSaveDynamicFields = "1"; + }; + new SimGroup(PlayerDropPoints) { + canSave = "1"; + canSaveDynamicFields = "1"; + Enabled = "1"; + + new SpawnSphere(DefaultCameraSpawnSphere) { + autoSpawn = "0"; + spawnTransform = "0"; + radius = "5"; + sphereWeight = "1"; + indoorWeight = "1"; + outdoorWeight = "1"; + isAIControlled = "0"; + dataBlock = "SpawnSphereMarker"; + position = "0 -23.8079 2"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + canSave = "1"; + canSaveDynamicFields = "1"; + Enabled = "1"; + homingCount = "0"; + lockCount = "0"; + }; + }; + new GroundPlane() { + squareSize = "128"; + scaleU = "12"; + scaleV = "12"; + Material = "Grid_512_Gray"; + canSave = "1"; + canSaveDynamicFields = "1"; + Enabled = "1"; + position = "0 0 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + }; +}; +//--- OBJECT WRITE END --- + diff --git a/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.postfxpreset.cs b/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.postfxpreset.cs new file mode 100644 index 000000000..a3fb25692 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.postfxpreset.cs @@ -0,0 +1,51 @@ +$PostFXManager::Settings::ColorCorrectionRamp = "data/postFX/art/null_color_ramp.png"; +$PostFXManager::Settings::DOF::BlurCurveFar = ""; +$PostFXManager::Settings::DOF::BlurCurveNear = ""; +$PostFXManager::Settings::DOF::BlurMax = ""; +$PostFXManager::Settings::DOF::BlurMin = ""; +$PostFXManager::Settings::DOF::EnableAutoFocus = "1"; +$PostFXManager::Settings::DOF::EnableDOF = ""; +$PostFXManager::Settings::DOF::FocusRangeMax = ""; +$PostFXManager::Settings::DOF::FocusRangeMin = ""; +$PostFXManager::Settings::EnableDOF = "1"; +$PostFXManager::Settings::EnableSSAO = "1"; +$PostFXManager::Settings::EnableHDR = "1"; +$PostFXManager::Settings::EnableLightRays = "0"; +$PostFXManager::Settings::EnablePostFX = "1"; +$PostFXManager::Settings::EnableVignette = "1"; +$PostFXManager::Settings::HDR::adaptRate = "2"; +$PostFXManager::Settings::HDR::blueShiftColor = "1.05 0.97 1.27"; +$PostFXManager::Settings::HDR::brightPassThreshold = "1"; +$PostFXManager::Settings::HDR::enableBloom = "1"; +$PostFXManager::Settings::HDR::enableBlueShift = "0"; +$PostFXManager::Settings::HDR::enableToneMapping = "0.346939"; +$PostFXManager::Settings::HDR::gaussMean = "0"; +$PostFXManager::Settings::HDR::gaussMultiplier = "0.3"; +$PostFXManager::Settings::HDR::gaussStdDev = "0.8"; +$PostFXManager::Settings::HDR::keyValue = "0.18"; +$PostFXManager::Settings::HDR::minLuminace = "0.001"; +$PostFXManager::Settings::HDR::whiteCutoff = "1"; +$PostFXManager::Settings::LightRays::brightScalar = "0.75"; +$PostFXManager::Settings::LightRays::decay = "1.0"; +$PostFXManager::Settings::LightRays::density = "0.94"; +$PostFXManager::Settings::LightRays::numSamples = "40"; +$PostFXManager::Settings::LightRays::weight = "5.65"; +$PostFXManager::Settings::SSAO::blurDepthTol = "0.001"; +$PostFXManager::Settings::SSAO::blurNormalTol = "0.95"; +$PostFXManager::Settings::SSAO::lDepthMax = "2"; +$PostFXManager::Settings::SSAO::lDepthMin = "0.2"; +$PostFXManager::Settings::SSAO::lDepthPow = "0.2"; +$PostFXManager::Settings::SSAO::lNormalPow = "2"; +$PostFXManager::Settings::SSAO::lNormalTol = "-0.5"; +$PostFXManager::Settings::SSAO::lRadius = "1"; +$PostFXManager::Settings::SSAO::lStrength = "10"; +$PostFXManager::Settings::SSAO::overallStrength = "2"; +$PostFXManager::Settings::SSAO::quality = "0"; +$PostFXManager::Settings::SSAO::sDepthMax = "1"; +$PostFXManager::Settings::SSAO::sDepthMin = "0.1"; +$PostFXManager::Settings::SSAO::sDepthPow = "1"; +$PostFXManager::Settings::SSAO::sNormalPow = "1"; +$PostFXManager::Settings::SSAO::sNormalTol = "0"; +$PostFXManager::Settings::SSAO::sRadius = "0.1"; +$PostFXManager::Settings::SSAO::sStrength = "6"; +$PostFXManager::Settings::Vignette::VMax = 1.04345; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room_preview.png b/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room_preview.png new file mode 100644 index 000000000..0cee49b84 Binary files /dev/null and b/Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room_preview.png differ diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/client/default.keybinds.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/client/default.keybinds.cs new file mode 100644 index 000000000..8636b5fc4 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/client/default.keybinds.cs @@ -0,0 +1,118 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +if ( isObject( moveMap ) ) + moveMap.delete(); + +new ActionMap(moveMap); + +//------------------------------------------------------------------------------ +// Non-remapable binds +//------------------------------------------------------------------------------ +moveMap.bindCmd(keyboard, "escape", "", "Canvas.pushDialog(PauseMenu);"); + +//------------------------------------------------------------------------------ +// Movement Keys +//------------------------------------------------------------------------------ +moveMap.bind( keyboard, a, moveleft ); +moveMap.bind( keyboard, d, moveright ); +moveMap.bind( keyboard, left, moveleft ); +moveMap.bind( keyboard, right, moveright ); + +moveMap.bind( keyboard, w, moveforward ); +moveMap.bind( keyboard, s, movebackward ); +moveMap.bind( keyboard, up, moveforward ); +moveMap.bind( keyboard, down, movebackward ); + +moveMap.bind( keyboard, e, moveup ); +moveMap.bind( keyboard, c, movedown ); + +moveMap.bind( keyboard, space, jump ); +moveMap.bind( mouse, xaxis, yaw ); +moveMap.bind( mouse, yaxis, pitch ); + +moveMap.bind( gamepad, thumbrx, "D", "-0.23 0.23", gamepadYaw ); +moveMap.bind( gamepad, thumbry, "D", "-0.23 0.23", gamepadPitch ); +moveMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamePadMoveX ); +moveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY ); + +moveMap.bind( gamepad, btn_a, jump ); +moveMap.bindCmd( gamepad, btn_back, "disconnect();", "" ); + +moveMap.bindCmd(gamepad, dpadl, "toggleLightColorViz();", ""); +moveMap.bindCmd(gamepad, dpadu, "toggleDepthViz();", ""); +moveMap.bindCmd(gamepad, dpadd, "toggleNormalsViz();", ""); +moveMap.bindCmd(gamepad, dpadr, "toggleLightSpecularViz();", ""); + + +//------------------------------------------------------------------------------ +// Mouse Trigger +//------------------------------------------------------------------------------ +moveMap.bind( mouse, button0, mouseFire ); +moveMap.bind( mouse, button1, altTrigger ); + +//------------------------------------------------------------------------------ +// Gamepad Trigger +//------------------------------------------------------------------------------ +moveMap.bind(gamepad, triggerr, gamepadFire); +moveMap.bind(gamepad, triggerl, gamepadAltTrigger); + +moveMap.bind(keyboard, f, setZoomFOV); +moveMap.bind(keyboard, r, toggleZoom); +moveMap.bind( gamepad, btn_b, toggleZoom ); + +//------------------------------------------------------------------------------ +// Camera & View functions +//------------------------------------------------------------------------------ +moveMap.bind( keyboard, z, toggleFreeLook ); +moveMap.bind(keyboard, tab, toggleFirstPerson ); +moveMap.bind(keyboard, "alt c", toggleCamera); + +moveMap.bind( gamepad, btn_back, toggleCamera ); + +//------------------------------------------------------------------------------ +// Demo recording functions +//------------------------------------------------------------------------------ +moveMap.bind( keyboard, F3, startRecordingDemo ); +moveMap.bind( keyboard, F4, stopRecordingDemo ); + + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ +moveMap.bind(keyboard, "F8", dropCameraAtPlayer); +moveMap.bind(keyboard, "F7", dropPlayerAtCamera); + +GlobalActionMap.bind(keyboard, "ctrl o", bringUpOptions); + +//------------------------------------------------------------------------------ +// Debugging Functions +//------------------------------------------------------------------------------ +GlobalActionMap.bind(keyboard, "ctrl F2", showMetrics); +GlobalActionMap.bind(keyboard, "ctrl F3", doProfile); + +//------------------------------------------------------------------------------ +// Misc. +//------------------------------------------------------------------------------ +GlobalActionMap.bind(keyboard, "tilde", toggleConsole); +GlobalActionMap.bindCmd(keyboard, "alt k", "cls();",""); +GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.attemptFullscreenToggle();"); diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/client/inputCommands.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/client/inputCommands.cs new file mode 100644 index 000000000..8463e66bb --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/client/inputCommands.cs @@ -0,0 +1,426 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +//------------------------------------------------------------------------------ +// Non-remapable binds +//------------------------------------------------------------------------------ +function escapeFromGame() +{ + /*if ( $Server::ServerType $= "SinglePlayer" ) + MessageBoxYesNo( "Exit", "Exit from this Mission?", "disconnect();", ""); + else + MessageBoxYesNo( "Disconnect", "Disconnect from the server?", "disconnect();", "");*/ + disconnect(); +} + +//------------------------------------------------------------------------------ +// Movement Keys +//------------------------------------------------------------------------------ +$movementSpeed = 1; // m/s + +function setSpeed(%speed) +{ + if(%speed) + $movementSpeed = %speed; +} + +function moveleft(%val) +{ + $mvLeftAction = %val * $movementSpeed; +} + +function moveright(%val) +{ + $mvRightAction = %val * $movementSpeed; +} + +function moveforward(%val) +{ + $mvForwardAction = %val * $movementSpeed; +} + +function movebackward(%val) +{ + $mvBackwardAction = %val * $movementSpeed; +} + +function moveup(%val) +{ + %object = ServerConnection.getControlObject(); + + if(%object.isInNamespaceHierarchy("Camera")) + $mvUpAction = %val * $movementSpeed; +} + +function movedown(%val) +{ + %object = ServerConnection.getControlObject(); + + if(%object.isInNamespaceHierarchy("Camera")) + $mvDownAction = %val * $movementSpeed; +} + +function turnLeft( %val ) +{ + $mvYawRightSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0; +} + +function turnRight( %val ) +{ + $mvYawLeftSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0; +} + +function panUp( %val ) +{ + $mvPitchDownSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0; +} + +function panDown( %val ) +{ + $mvPitchUpSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0; +} + +function getVerticalMouseAdjustAmount(%val) +{ + %sensitivity = $pref::Input::VertMouseSensitivity; + + // based on a default camera FOV of 90' + if(ServerConnection.zoomed) + %sensitivity = $pref::Input::ZoomVertMouseSensitivity; + + if($pref::Input::invertVerticalMouse) + %sensitivity *= -1; + + return(%val * ($cameraFov / 90) * 0.01) * %sensitivity; +} + +function getHorizontalMouseAdjustAmount(%val) +{ + %sensitivity = $pref::Input::HorzMouseSensitivity; + + // based on a default camera FOV of 90' + if(ServerConnection.zoomed) + %sensitivity = $pref::Input::ZoomHorzMouseSensitivity; + + return(%val * ($cameraFov / 90) * 0.01) * %sensitivity; +} + +function getRollMouseAdjustAmount(%val) +{ + return(%val * ($cameraFov / 90) * 0.01) * $pref::Input::RollMouseSensitivity; +} + +function getGamepadAdjustAmount(%val) +{ + // based on a default camera FOV of 90' + return(%val * ($cameraFov / 90) * 0.01) * 10.0; +} + +function yaw(%val) +{ + %yawAdj = getHorizontalMouseAdjustAmount(%val); + if(ServerConnection.isControlObjectRotDampedCamera()) + { + // Clamp and scale + %yawAdj = mClamp(%yawAdj, -m2Pi()+0.01, m2Pi()-0.01); + %yawAdj *= 0.5; + } + + $mvYaw += %yawAdj; +} + +function pitch(%val) +{ + %pitchAdj = getVerticalMouseAdjustAmount(%val); + if(ServerConnection.isControlObjectRotDampedCamera()) + { + // Clamp and scale + %pitchAdj = mClamp(%pitchAdj, -m2Pi()+0.01, m2Pi()-0.01); + %pitchAdj *= 0.5; + } + + $mvPitch += %pitchAdj; +} + +function jump(%val) +{ + $mvTriggerCount2++; +} + +function gamePadMoveX( %val ) +{ + $mvXAxis_L = %val; +} + +function gamePadMoveY( %val ) +{ + $mvYAxis_L = %val; +} + +function gamepadYaw(%val) +{ + %yawAdj = getGamepadAdjustAmount(%val); + if(ServerConnection.isControlObjectRotDampedCamera()) + { + // Clamp and scale + %yawAdj = mClamp(%yawAdj, -m2Pi()+0.01, m2Pi()-0.01); + %yawAdj *= 0.5; + } + + if(%yawAdj > 0) + { + $mvYawLeftSpeed = %yawAdj; + $mvYawRightSpeed = 0; + } + else + { + $mvYawLeftSpeed = 0; + $mvYawRightSpeed = -%yawAdj; + } +} + +function gamepadPitch(%val) +{ + %pitchAdj = getGamepadAdjustAmount(%val); + if(ServerConnection.isControlObjectRotDampedCamera()) + { + // Clamp and scale + %pitchAdj = mClamp(%pitchAdj, -m2Pi()+0.01, m2Pi()-0.01); + %pitchAdj *= 0.5; + } + + if(%pitchAdj > 0) + { + $mvPitchDownSpeed = %pitchAdj; + $mvPitchUpSpeed = 0; + } + else + { + $mvPitchDownSpeed = 0; + $mvPitchUpSpeed = -%pitchAdj; + } +} + +//------------------------------------------------------------------------------ +// Mouse Trigger +//------------------------------------------------------------------------------ +function mouseFire(%val) +{ + $mvTriggerCount0++; +} + +function altTrigger(%val) +{ + $mvTriggerCount1++; + + toggleZoom(%val); +} + +//------------------------------------------------------------------------------ +// Gamepad Trigger +//------------------------------------------------------------------------------ +function gamepadFire(%val) +{ + if(%val > 0.1 && !$gamepadFireTriggered) + { + $gamepadFireTriggered = true; + $mvTriggerCount0++; + } + else if(%val <= 0.1 && $gamepadFireTriggered) + { + $gamepadFireTriggered = false; + $mvTriggerCount0++; + } +} + +function gamepadAltTrigger(%val) +{ + if(%val > 0.1 && !$gamepadAltTriggerTriggered) + { + $gamepadAltTriggerTriggered = true; + $mvTriggerCount1++; + } + else if(%val <= 0.1 && $gamepadAltTriggerTriggered) + { + $gamepadAltTriggerTriggered = false; + $mvTriggerCount1++; + } +} + +//------------------------------------------------------------------------------ +// Zoom and FOV functions +//------------------------------------------------------------------------------ +if($Player::CurrentFOV $= "") + $Player::CurrentFOV = $pref::Player::DefaultFOV; + +// toggleZoomFOV() works by dividing the CurrentFOV by 2. Each time that this +// toggle is hit it simply divides the CurrentFOV by 2 once again. If the +// FOV is reduced below a certain threshold then it resets to equal half of the +// DefaultFOV value. This gives us 4 zoom levels to cycle through. + +function toggleZoomFOV() +{ + $Player::CurrentFOV = $Player::CurrentFOV / 2; + + if($Player::CurrentFOV < 5) + resetCurrentFOV(); + + if(ServerConnection.zoomed) + setFOV($Player::CurrentFOV); + else + { + setFov(ServerConnection.getControlCameraDefaultFov()); + } +} + +function resetCurrentFOV() +{ + $Player::CurrentFOV = ServerConnection.getControlCameraDefaultFov() / 2; +} + +function turnOffZoom() +{ + ServerConnection.zoomed = false; + setFov(ServerConnection.getControlCameraDefaultFov()); + + // Rather than just disable the DOF effect, we want to set it to the level's + // preset values. + //DOFPostEffect.disable(); + ppOptionsUpdateDOFSettings(); +} + +function setZoomFOV(%val) +{ + if(%val) + toggleZoomFOV(); +} + +function toggleZoom(%val) +{ + if (%val) + { + ServerConnection.zoomed = true; + setFov($Player::CurrentFOV); + + DOFPostEffect.setAutoFocus( true ); + DOFPostEffect.setFocusParams( 0.5, 0.5, 50, 500, -5, 5 ); + DOFPostEffect.enable(); + } + else + { + turnOffZoom(); + } +} + +//------------------------------------------------------------------------------ +// Camera & View functions +//------------------------------------------------------------------------------ +function toggleFreeLook( %val ) +{ + if ( %val ) + $mvFreeLook = true; + else + $mvFreeLook = false; +} + +function toggleFirstPerson(%val) +{ + if (%val) + { + ServerConnection.setFirstPerson(!ServerConnection.isFirstPerson()); + } +} + +function toggleCamera(%val) +{ + if (%val) + commandToServer('ToggleCamera'); +} + +//------------------------------------------------------------------------------ +// Demo recording functions +//------------------------------------------------------------------------------ +function startRecordingDemo( %val ) +{ + if ( %val ) + startDemoRecord(); +} + +function stopRecordingDemo( %val ) +{ + if ( %val ) + stopDemoRecord(); +} + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ +function dropCameraAtPlayer(%val) +{ + if (%val) + commandToServer('dropCameraAtPlayer'); +} + +function dropPlayerAtCamera(%val) +{ + if (%val) + commandToServer('DropPlayerAtCamera'); +} + +function bringUpOptions(%val) +{ + if (%val) + Canvas.pushDialog(OptionsDlg); +} + +//------------------------------------------------------------------------------ +// Debugging Functions +//------------------------------------------------------------------------------ +function showMetrics(%val) +{ + if(%val) + metrics("fps gfx shadow sfx terrain groundcover forest net"); +} + +//------------------------------------------------------------------------------ +// +// Start profiler by pressing ctrl f3 +// ctrl f3 - starts profile that will dump to console and file +// +function doProfile(%val) +{ + if (%val) + { + // key down -- start profile + echo("Starting profile session..."); + profilerReset(); + profilerEnable(true); + } + else + { + // key up -- finish off profile + echo("Ending profile session..."); + + profilerDumpToFile("profilerDumpToFile" @ getSimTime() @ ".txt"); + profilerEnable(false); + } +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/camera.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/camera.cs new file mode 100644 index 000000000..c7a87d0b2 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/camera.cs @@ -0,0 +1,4 @@ +datablock CameraData(Observer) +{ + mode = "Observer"; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/defaultParticle.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/defaultParticle.cs new file mode 100644 index 000000000..4035e7969 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/defaultParticle.cs @@ -0,0 +1,66 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +datablock ParticleData(DefaultParticle) +{ + textureName = "data/spectatorGameplay/art/particles/defaultParticle"; + dragCoefficient = 0.498534; + gravityCoefficient = 0; + inheritedVelFactor = 0.499022; + constantAcceleration = 0.0; + lifetimeMS = 1313; + lifetimeVarianceMS = 500; + useInvAlpha = true; + spinRandomMin = -360; + spinRandomMax = 360; + spinSpeed = 1; + + colors[0] = "0.992126 0.00787402 0.0314961 1"; + colors[1] = "1 0.834646 0 0.645669"; + colors[2] = "1 0.299213 0 0.330709"; + colors[3] = "0.732283 1 0 0"; + + sizes[0] = 0; + sizes[1] = 0.497467; + sizes[2] = 0.73857; + sizes[3] = 0.997986; + + times[0] = 0.0; + times[1] = 0.247059; + times[2] = 0.494118; + times[3] = 1; + + animTexName = "data/spectatorGameplay/art/particles/defaultParticle"; +}; + +datablock ParticleEmitterData(DefaultEmitter) +{ + ejectionPeriodMS = "50"; + ejectionVelocity = "1"; + velocityVariance = "0"; + ejectionOffset = "0.2"; + thetaMax = "40"; + particles = "DefaultParticle"; + blendStyle = "ADDITIVE"; + softParticles = "0"; + softnessDistance = "1"; +}; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/lights.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/lights.cs new file mode 100644 index 000000000..663f54720 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/lights.cs @@ -0,0 +1,608 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + + +//------------------------------------------------------------------------------ +// LightAnimData +//------------------------------------------------------------------------------ + +datablock LightAnimData( NullLightAnim ) +{ + animEnabled = false; +}; + +datablock LightAnimData( PulseLightAnim ) +{ + brightnessA = 0; + brightnessZ = 1; + brightnessPeriod = 1; + brightnessKeys = "aza"; + brightnessSmooth = true; +}; + +datablock LightAnimData( SubtlePulseLightAnim ) +{ + brightnessA = 0.5; + brightnessZ = 1; + brightnessPeriod = 1; + brightnessKeys = "aza"; + brightnessSmooth = true; +}; + +datablock LightAnimData( FlickerLightAnim ) +{ + brightnessA = 1; + brightnessZ = 0; + brightnessPeriod = 5; + brightnessKeys = "aaazaaaaaazaaazaaazaaaaazaaaazzaaaazaaaaaazaaaazaaaza"; + brightnessSmooth = false; +}; + +datablock LightAnimData( BlinkLightAnim ) +{ + brightnessA = 0; + brightnessZ = 1; + brightnessPeriod = 5; + brightnessKeys = "azaaaazazaaaaaazaaaazaaaazzaaaaaazaazaaazaaaaaaa"; + brightnessSmooth = false; +}; + +datablock LightAnimData( FireLightAnim ) +{ + brightnessA = 0.75; + brightnessZ = 1; + brightnessPeriod = 0.7; + brightnessKeys = "annzzznnnzzzaznzzzz"; + brightnessSmooth = 0; + offsetA[0] = "-0.05"; + offsetA[1] = "-0.05"; + offsetA[2] = "-0.05"; + offsetZ[0] = "0.05"; + offsetZ[1] = "0.05"; + offsetZ[2] = "0.05"; + offsetPeriod[0] = "1.25"; + offsetPeriod[1] = "1.25"; + offsetPeriod[2] = "1.25"; + offsetKeys[0] = "ahahaazahakayajza"; + offsetKeys[1] = "ahahaazahakayajza"; + offsetKeys[2] = "ahahaazahakayajza"; + rotKeys[0] = ""; + rotKeys[1] = ""; + rotKeys[2] = ""; + colorKeys[0] = ""; + colorKeys[1] = ""; + colorKeys[2] = ""; +}; + +datablock LightAnimData( SpinLightAnim ) +{ + rotA[2] = "0"; + rotZ[2] = "360"; + rotPeriod[2] = "1"; + rotKeys[2] = "az"; + rotSmooth[2] = true; +}; + + +//------------------------------------------------------------------------------ +// LightFlareData +//------------------------------------------------------------------------------ + +datablock LightFlareData( NullLightFlare ) +{ + flareEnabled = false; +}; + +datablock LightFlareData( SunFlareExample ) +{ + overallScale = 4.0; + flareEnabled = true; + renderReflectPass = false; + flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet0"; + + elementRect[0] = "512 0 512 512"; + elementDist[0] = 0.0; + elementScale[0] = 2.0; + elementTint[0] = "0.6 0.6 0.6"; + elementRotate[0] = true; + elementUseLightColor[0] = true; + + elementRect[1] = "1152 0 128 128"; + elementDist[1] = 0.3; + elementScale[1] = 0.7; + elementTint[1] = "1.0 1.0 1.0"; + elementRotate[1] = true; + elementUseLightColor[1] = true; + + elementRect[2] = "1024 0 128 128"; + elementDist[2] = 0.5; + elementScale[2] = 0.25; + elementTint[2] = "1.0 1.0 1.0"; + elementRotate[2] = true; + elementUseLightColor[2] = true; + + elementRect[3] = "1024 128 128 128"; + elementDist[3] = 0.8; + elementScale[3] = 0.7; + elementTint[3] = "1.0 1.0 1.0"; + elementRotate[3] = true; + elementUseLightColor[3] = true; + + elementRect[4] = "1024 0 128 128"; + elementDist[4] = 1.18; + elementScale[4] = 0.5; + elementTint[4] = "1.0 1.0 1.0"; + elementRotate[4] = true; + elementUseLightColor[4] = true; + + elementRect[5] = "1152 128 128 128"; + elementDist[5] = 1.25; + elementScale[5] = 0.25; + elementTint[5] = "1.0 1.0 1.0"; + elementRotate[5] = true; + elementUseLightColor[5] = true; + + elementRect[6] = "1024 0 128 128"; + elementDist[6] = 2.0; + elementScale[6] = 0.25; + elementTint[6] = "1.0 1.0 1.0"; + elementRotate[6] = true; + elementUseLightColor[6] = true; + occlusionRadius = "0.25"; +}; + +datablock LightFlareData( SunFlareExample2 ) +{ + overallScale = 2.0; + flareEnabled = true; + renderReflectPass = false; + flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet0"; + + elementRect[0] = "1024 0 128 128"; + elementDist[0] = 0.5; + elementScale[0] = 0.25; + elementTint[0] = "1.0 1.0 1.0"; + elementRotate[0] = true; + elementUseLightColor[0] = true; + + elementRect[1] = "1024 128 128 128"; + elementDist[1] = 0.8; + elementScale[1] = 0.7; + elementTint[1] = "1.0 1.0 1.0"; + elementRotate[1] = true; + elementUseLightColor[1] = true; + + elementRect[2] = "1024 0 128 128"; + elementDist[2] = 1.18; + elementScale[2] = 0.5; + elementTint[2] = "1.0 1.0 1.0"; + elementRotate[2] = true; + elementUseLightColor[2] = true; + + elementRect[3] = "1152 128 128 128"; + elementDist[3] = 1.25; + elementScale[3] = 0.25; + elementTint[3] = "1.0 1.0 1.0"; + elementRotate[3] = true; + elementUseLightColor[3] = true; + + elementRect[4] = "1024 0 128 128"; + elementDist[4] = 2.0; + elementScale[4] = 0.25; + elementTint[4] = "0.7 0.7 0.7"; + elementRotate[4] = true; + elementUseLightColor[4] = true; + occlusionRadius = "0.25"; +}; + +datablock LightFlareData(SunFlareExample3) +{ + overallScale = 2.0; + flareEnabled = true; + renderReflectPass = false; + flareTexture = "data/spectatorGameplay/art/lights/lensflareSheet3.png"; + + elementRect[0] = "0 256 256 256"; + elementDist[0] = "-0.6"; + elementScale[0] = "3.5"; + elementTint[0] = "0.537255 0.537255 0.537255 1"; + elementRotate[0] = true; + elementUseLightColor[0] = true; + + elementRect[1] = "128 128 128 128"; + elementDist[1] = "0.1"; + elementScale[1] = "1.5"; + elementTint[1] = "0.996078 0.976471 0.721569 1"; + elementRotate[1] = true; + elementUseLightColor[1] = true; + + elementRect[2] = "0 0 64 64"; + elementDist[2] = "0.4"; + elementScale[2] = "0.25"; + elementTint[2] = "0 0 1 1"; + elementRotate[2] = true; + elementUseLightColor[2] = true; + + elementRect[3] = "0 0 64 64"; + elementDist[3] = "0.45"; + elementScale[3] = 0.25; + elementTint[3] = "0 1 0 1"; + elementRotate[3] = true; + elementUseLightColor[3] = true; + + elementRect[4] = "0 0 64 64"; + elementDist[4] = "0.5"; + elementScale[4] = 0.25; + elementTint[4] = "1 0 0 1"; + elementRotate[4] = true; + elementUseLightColor[4] = true; + elementRect[9] = "256 0 256 256"; + elementDist[3] = "0.45"; + elementScale[3] = "0.25"; + elementScale[9] = "2"; + elementRect[4] = "0 0 64 64"; + elementRect[5] = "128 0 128 128"; + elementDist[4] = "0.5"; + elementDist[5] = "1.2"; + elementScale[1] = "1.5"; + elementScale[4] = "0.25"; + elementScale[5] = "0.5"; + elementTint[1] = "0.996078 0.976471 0.721569 1"; + elementTint[2] = "0 0 1 1"; + elementTint[5] = "0.721569 0 1 1"; + elementRotate[5] = "0"; + elementUseLightColor[5] = "1"; + elementRect[0] = "0 256 256 256"; + elementRect[1] = "128 128 128 128"; + elementRect[2] = "0 0 64 64"; + elementRect[3] = "0 0 64 64"; + elementDist[0] = "-0.6"; + elementDist[1] = "0.1"; + elementDist[2] = "0.4"; + elementScale[0] = "3.5"; + elementScale[2] = "0.25"; + elementTint[0] = "0.537255 0.537255 0.537255 1"; + elementTint[3] = "0 1 0 1"; + elementTint[4] = "1 0 0 1"; + elementRect[6] = "64 64 64 64"; + elementDist[6] = "0.9"; + elementScale[6] = "4"; + elementTint[6] = "0.00392157 0.721569 0.00392157 1"; + elementRotate[6] = "0"; + elementUseLightColor[6] = "1"; + elementRect[7] = "64 64 64 64"; + elementRect[8] = "64 64 64 64"; + elementDist[7] = "0.25"; + elementDist[8] = "0.18"; + elementDist[9] = "0"; + elementScale[7] = "2"; + elementScale[8] = "0.5"; + elementTint[7] = "0.6 0.0117647 0.741176 1"; + elementTint[8] = "0.027451 0.690196 0.0117647 1"; + elementTint[9] = "0.647059 0.647059 0.647059 1"; + elementRotate[9] = "0"; + elementUseLightColor[7] = "1"; + elementUseLightColor[8] = "1"; + elementRect[10] = "256 256 256 256"; + elementRect[11] = "0 64 64 64"; + elementRect[12] = "0 64 64 64"; + elementRect[13] = "64 0 64 64"; + elementDist[10] = "0"; + elementDist[11] = "-0.3"; + elementDist[12] = "-0.32"; + elementDist[13] = "1"; + elementScale[10] = "10"; + elementScale[11] = "2.5"; + elementScale[12] = "0.3"; + elementScale[13] = "0.4"; + elementTint[10] = "0.321569 0.321569 0.321569 1"; + elementTint[11] = "0.443137 0.0431373 0.00784314 1"; + elementTint[12] = "0.00784314 0.996078 0.0313726 1"; + elementTint[13] = "0.996078 0.94902 0.00784314 1"; + elementUseLightColor[10] = "1"; + elementUseLightColor[11] = "1"; + elementUseLightColor[13] = "1"; + elementRect[14] = "0 0 64 64"; + elementDist[14] = "0.15"; + elementScale[14] = "0.8"; + elementTint[14] = "0.505882 0.0470588 0.00784314 1"; + elementRotate[14] = "1"; + elementUseLightColor[9] = "1"; + elementUseLightColor[14] = "1"; + elementRect[15] = "64 64 64 64"; + elementRect[16] = "0 64 64 64"; + elementRect[17] = "0 0 64 64"; + elementRect[18] = "0 64 64 64"; + elementRect[19] = "256 0 256 256"; + elementDist[15] = "0.8"; + elementDist[16] = "0.7"; + elementDist[17] = "1.4"; + elementDist[18] = "-0.5"; + elementDist[19] = "-1.5"; + elementScale[15] = "3"; + elementScale[16] = "0.3"; + elementScale[17] = "0.2"; + elementScale[18] = "1"; + elementScale[19] = "35"; + elementTint[15] = "0.00784314 0.00784314 0.996078 1"; + elementTint[16] = "0.992157 0.992157 0.992157 1"; + elementTint[17] = "0.996078 0.603922 0.00784314 1"; + elementTint[18] = "0.2 0.00392157 0.47451 1"; + elementTint[19] = "0.607843 0.607843 0.607843 1"; + elementUseLightColor[15] = "1"; + elementUseLightColor[18] = "1"; + elementUseLightColor[19] = "1"; + occlusionRadius = "0.25"; +}; + + + +datablock LightFlareData(SunFlarePacificIsland) +{ + overallScale = 2.0; + flareEnabled = true; + renderReflectPass = false; + flareTexture = "data/spectatorGameplay/art/lights/lensflareSheet3.png"; + + elementRect[0] = "0 256 256 256"; + elementDist[0] = "-0.6"; + elementScale[0] = "3.5"; + elementTint[0] = "0.537255 0.537255 0.537255 1"; + elementRotate[0] = true; + elementUseLightColor[0] = true; + + elementRect[1] = "128 128 128 128"; + elementDist[1] = "0.1"; + elementScale[1] = "1.5"; + elementTint[1] = "0.996078 0.976471 0.721569 1"; + elementRotate[1] = true; + elementUseLightColor[1] = true; + + elementRect[2] = "0 0 64 64"; + elementDist[2] = "0.4"; + elementScale[2] = "0.25"; + elementTint[2] = "0 0 1 1"; + elementRotate[2] = true; + elementUseLightColor[2] = true; + + elementRect[3] = "0 0 64 64"; + elementDist[3] = "0.45"; + elementScale[3] = 0.25; + elementTint[3] = "0 1 0 1"; + elementRotate[3] = true; + elementUseLightColor[3] = true; + + elementRect[4] = "0 0 64 64"; + elementDist[4] = "0.5"; + elementScale[4] = 0.25; + elementTint[4] = "1 0 0 1"; + elementRotate[4] = true; + elementUseLightColor[4] = true; + elementRect[9] = "256 0 256 256"; + elementDist[3] = "0.45"; + elementScale[3] = "0.25"; + elementScale[9] = "2"; + elementRect[4] = "0 0 64 64"; + elementRect[5] = "128 0 128 128"; + elementDist[4] = "0.5"; + elementDist[5] = "1.2"; + elementScale[1] = "1.5"; + elementScale[4] = "0.25"; + elementScale[5] = "0.5"; + elementTint[1] = "0.996078 0.976471 0.721569 1"; + elementTint[2] = "0 0 1 1"; + elementTint[5] = "0.721569 0 1 1"; + elementRotate[5] = "0"; + elementUseLightColor[5] = "1"; + elementRect[0] = "0 256 256 256"; + elementRect[1] = "128 128 128 128"; + elementRect[2] = "0 0 64 64"; + elementRect[3] = "0 0 64 64"; + elementDist[0] = "-0.6"; + elementDist[1] = "0.1"; + elementDist[2] = "0.4"; + elementScale[0] = "3.5"; + elementScale[2] = "0.25"; + elementTint[0] = "0.537255 0.537255 0.537255 1"; + elementTint[3] = "0 1 0 1"; + elementTint[4] = "1 0 0 1"; + elementRect[6] = "64 64 64 64"; + elementDist[6] = "0.9"; + elementScale[6] = "4"; + elementTint[6] = "0.00392157 0.721569 0.00392157 1"; + elementRotate[6] = "0"; + elementUseLightColor[6] = "1"; + elementRect[7] = "64 64 64 64"; + elementRect[8] = "64 64 64 64"; + elementDist[7] = "0.25"; + elementDist[8] = "0.18"; + elementDist[9] = "0"; + elementScale[7] = "2"; + elementScale[8] = "0.5"; + elementTint[7] = "0.6 0.0117647 0.741176 1"; + elementTint[8] = "0.027451 0.690196 0.0117647 1"; + elementTint[9] = "0.647059 0.647059 0.647059 1"; + elementRotate[9] = "0"; + elementUseLightColor[7] = "1"; + elementUseLightColor[8] = "1"; + elementRect[10] = "256 256 256 256"; + elementRect[11] = "0 64 64 64"; + elementRect[12] = "0 64 64 64"; + elementRect[13] = "64 0 64 64"; + elementDist[10] = "0"; + elementDist[11] = "-0.3"; + elementDist[12] = "-0.32"; + elementDist[13] = "1"; + elementScale[10] = "10"; + elementScale[11] = "2.5"; + elementScale[12] = "0.3"; + elementScale[13] = "0.4"; + elementTint[10] = "0.321569 0.321569 0.321569 1"; + elementTint[11] = "0.443137 0.0431373 0.00784314 1"; + elementTint[12] = "0.00784314 0.996078 0.0313726 1"; + elementTint[13] = "0.996078 0.94902 0.00784314 1"; + elementUseLightColor[10] = "1"; + elementUseLightColor[11] = "1"; + elementUseLightColor[13] = "1"; + elementRect[14] = "0 0 64 64"; + elementDist[14] = "0.15"; + elementScale[14] = "0.8"; + elementTint[14] = "0.505882 0.0470588 0.00784314 1"; + elementRotate[14] = "1"; + elementUseLightColor[9] = "1"; + elementUseLightColor[14] = "1"; + elementRect[15] = "64 64 64 64"; + elementRect[16] = "0 64 64 64"; + elementRect[17] = "0 0 64 64"; + elementRect[18] = "0 64 64 64"; + elementRect[19] = "256 0 256 256"; + elementDist[15] = "0.8"; + elementDist[16] = "0.7"; + elementDist[17] = "1.4"; + elementDist[18] = "-0.5"; + elementDist[19] = "-1.5"; + elementScale[15] = "3"; + elementScale[16] = "0.3"; + elementScale[17] = "0.2"; + elementScale[18] = "1"; + elementScale[19] = "35"; + elementTint[15] = "0.00784314 0.00784314 0.996078 1"; + elementTint[16] = "0.992157 0.992157 0.992157 1"; + elementTint[17] = "0.996078 0.603922 0.00784314 1"; + elementTint[18] = "0.2 0.00392157 0.47451 1"; + elementTint[19] = "0.607843 0.607843 0.607843 1"; + elementUseLightColor[15] = "1"; + elementUseLightColor[18] = "1"; + elementUseLightColor[19] = "1"; +}; + + + +datablock LightFlareData( LightFlareExample0 ) +{ + overallScale = 2.0; + flareEnabled = true; + renderReflectPass = true; + flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet1"; + + elementRect[0] = "0 512 512 512"; + elementDist[0] = 0.0; + elementScale[0] = 0.5; + elementTint[0] = "1.0 1.0 1.0"; + elementRotate[0] = false; + elementUseLightColor[0] = false; + + elementRect[1] = "512 0 512 512"; + elementDist[1] = 0.0; + elementScale[1] = 2.0; + elementTint[1] = "0.5 0.5 0.5"; + elementRotate[1] = false; + elementUseLightColor[1] = false; + occlusionRadius = "0.25"; +}; + +datablock LightFlareData( LightFlareExample1 ) +{ + overallScale = 2.0; + flareEnabled = true; + renderReflectPass = true; + flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet1"; + + elementRect[0] = "512 512 512 512"; + elementDist[0] = 0.0; + elementScale[0] = 0.5; + elementTint[0] = "1.0 1.0 1.0"; + elementRotate[0] = false; + elementUseLightColor[0] = false; + + elementRect[1] = "512 0 512 512"; + elementDist[1] = 0.0; + elementScale[1] = 2.0; + elementTint[1] = "0.5 0.5 0.5"; + elementRotate[1] = false; + elementUseLightColor[1] = false; + occlusionRadius = "0.25"; +}; + +datablock LightFlareData( LightFlareExample2 ) +{ + overallScale = 2.0; + flareEnabled = true; + renderReflectPass = true; + flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet0"; + + elementRect[0] = "512 512 512 512"; + elementDist[0] = 0.0; + elementScale[0] = 0.5; + elementTint[0] = "1.0 1.0 1.0"; + elementRotate[0] = true; + elementUseLightColor[0] = true; + + elementRect[1] = "512 0 512 512"; + elementDist[1] = 0.0; + elementScale[1] = 2.0; + elementTint[1] = "0.7 0.7 0.7"; + elementRotate[1] = true; + elementUseLightColor[1] = true; + + elementRect[2] = "1152 0 128 128"; + elementDist[2] = 0.3; + elementScale[2] = 0.5; + elementTint[2] = "1.0 1.0 1.0"; + elementRotate[2] = true; + elementUseLightColor[2] = true; + + elementRect[3] = "1024 0 128 128"; + elementDist[3] = 0.5; + elementScale[3] = 0.25; + elementTint[3] = "1.0 1.0 1.0"; + elementRotate[3] = true; + elementUseLightColor[3] = true; + + elementRect[4] = "1024 128 128 128"; + elementDist[4] = 0.8; + elementScale[4] = 0.6; + elementTint[4] = "1.0 1.0 1.0"; + elementRotate[4] = true; + elementUseLightColor[4] = true; + + elementRect[5] = "1024 0 128 128"; + elementDist[5] = 1.18; + elementScale[5] = 0.5; + elementTint[5] = "0.7 0.7 0.7"; + elementRotate[5] = true; + elementUseLightColor[5] = true; + + elementRect[6] = "1152 128 128 128"; + elementDist[6] = 1.25; + elementScale[6] = 0.35; + elementTint[6] = "0.8 0.8 0.8"; + elementRotate[6] = true; + elementUseLightColor[6] = true; + + elementRect[7] = "1024 0 128 128"; + elementDist[7] = 2.0; + elementScale[7] = 0.25; + elementTint[7] = "1.0 1.0 1.0"; + elementRotate[7] = true; + elementUseLightColor[7] = true; +}; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDatablocks.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDatablocks.cs new file mode 100644 index 000000000..c935f068a --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDatablocks.cs @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +// This is the default save location for any Datablocks created in the +// Datablock Editor (this script is executed from onServerCreated()) \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDecalData.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDecalData.cs new file mode 100644 index 000000000..0f5501c61 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDecalData.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +// This is the default save location for any Decal datablocks created in the +// Decal Editor (this script is executed from onServerCreated()) + diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedForestItemData.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedForestItemData.cs new file mode 100644 index 000000000..509b0f0c0 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedForestItemData.cs @@ -0,0 +1,21 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleData.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleData.cs new file mode 100644 index 000000000..10ecb64a9 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleData.cs @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +// This is the default save location for any Particle datablocks created in the +// Particle Editor (this script is executed from onServerCreated()) diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleEmitterData.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleEmitterData.cs new file mode 100644 index 000000000..68ac4104a --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleEmitterData.cs @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +// This is the default save location for any Particle Emitter datablocks created in the +// Particle Editor (this script is executed from onServerCreated()) diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/markers.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/markers.cs new file mode 100644 index 000000000..a8d5a015b --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/markers.cs @@ -0,0 +1,39 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +datablock MissionMarkerData(WayPointMarker) +{ + category = "Misc"; + shapeFile = "data/spectatorGameplay/art/shapes/octahedron.dts"; +}; + +datablock MissionMarkerData(SpawnSphereMarker) +{ + category = "Misc"; + shapeFile = "data/spectatorGameplay/art/shapes/octahedron.dts"; +}; + +datablock MissionMarkerData(CameraBookmarkMarker) +{ + category = "Misc"; + shapeFile = "data/spectatorGameplay/art/shapes/camera.dts"; +}; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/ribbons.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/ribbons.cs new file mode 100644 index 000000000..fdf5bf865 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/ribbons.cs @@ -0,0 +1,46 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +datablock RibbonNodeData(DefaultRibbonNodeData) +{ + timeMultiple = 1.0; +}; + +//ribbon data//////////////////////////////////////// + +datablock RibbonData(BasicRibbon) +{ + size[0] = 0.5; + color[0] = "1.0 0.0 0.0 1.0"; + position[0] = 0.0; + + size[1] = 0.0; + color[1] = "1.0 0.0 0.0 0.0"; + position[1] = 1.0; + + RibbonLength = 40; + fadeAwayStep = 0.1; + UseFadeOut = true; + RibbonMaterial = BasicRibbonMat; + + category = "FX"; +}; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/sounds.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/sounds.cs new file mode 100644 index 000000000..e99d2e537 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/sounds.cs @@ -0,0 +1,22 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.cs new file mode 100644 index 000000000..48b77d195 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.cs @@ -0,0 +1,80 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// PlayGui is the main TSControl through which the game is viewed. +// The PlayGui also contains the hud controls. +//----------------------------------------------------------------------------- + +function PlayGui::onWake(%this) +{ + // Turn off any shell sounds... + // sfxStop( ... ); + + $enableDirectInput = "1"; + activateDirectInput(); + + // Message hud dialog + if ( isObject( MainChatHud ) ) + { + Canvas.pushDialog( MainChatHud ); + chatHud.attach(HudMessageVector); + } + + // just update the action map here + moveMap.push(); + + // hack city - these controls are floating around and need to be clamped + if ( isFunction( "refreshCenterTextCtrl" ) ) + schedule(0, 0, "refreshCenterTextCtrl"); + if ( isFunction( "refreshBottomTextCtrl" ) ) + schedule(0, 0, "refreshBottomTextCtrl"); +} + +function PlayGui::onSleep(%this) +{ + if ( isObject( MainChatHud ) ) + Canvas.popDialog( MainChatHud ); + + // pop the keymaps + moveMap.pop(); +} + +function PlayGui::clearHud( %this ) +{ + Canvas.popDialog( MainChatHud ); + + while ( %this.getCount() > 0 ) + %this.getObject( 0 ).delete(); +} + +//----------------------------------------------------------------------------- + +function refreshBottomTextCtrl() +{ + BottomPrintText.position = "0 0"; +} + +function refreshCenterTextCtrl() +{ + CenterPrintText.position = "0 0"; +} diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.gui b/Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.gui new file mode 100644 index 000000000..c61473764 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.gui @@ -0,0 +1,39 @@ +new GameTSCtrl(PlayGui) { + isContainer = "1"; + profile = "GuiContentProfile"; + horizSizing = "right"; + vertSizing = "bottom"; + position = "0 0"; + extent = "1024 768"; + minExtent = "8 8"; + canSave = "1"; + visible = "1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + cameraZRot = "0"; + forceFOV = "0"; + enabled = "1"; + helpTag = "0"; + noCursor = "1"; + + new GuiBitmapCtrl(LagIcon) { + bitmap = "data/ui/art/lagIcon.png"; + wrap = "0"; + isContainer = "0"; + Profile = "GuiDefaultProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "572 3"; + Extent = "32 32"; + MinExtent = "8 8"; + canSave = "1"; + Visible = "0"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; +}; diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/server/DefaultGame.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/server/DefaultGame.cs new file mode 100644 index 000000000..5dce15ca5 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/server/DefaultGame.cs @@ -0,0 +1,193 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// What kind of "player" is spawned is either controlled directly by the +// SpawnSphere or it defaults back to the values set here. This also controls +// which SimGroups to attempt to select the spawn sphere's from by walking down +// the list of SpawnGroups till it finds a valid spawn object. +// These override the values set in core/scripts/server/spawn.cs +//----------------------------------------------------------------------------- +function DefaultGame::initGameVars(%this) +{ + // Leave $Game::defaultPlayerClass and $Game::defaultPlayerDataBlock as empty strings ("") + // to spawn a the $Game::defaultCameraClass as the control object. + $Game::DefaultPlayerClass = ""; + $Game::DefaultPlayerDataBlock = ""; + $Game::DefaultPlayerSpawnGroups = "CameraSpawnPoints PlayerSpawnPoints PlayerDropPoints"; + + //----------------------------------------------------------------------------- + // What kind of "camera" is spawned is either controlled directly by the + // SpawnSphere or it defaults back to the values set here. This also controls + // which SimGroups to attempt to select the spawn sphere's from by walking down + // the list of SpawnGroups till it finds a valid spawn object. + // These override the values set in core/scripts/server/spawn.cs + //----------------------------------------------------------------------------- + $Game::DefaultCameraClass = "Camera"; + $Game::DefaultCameraDataBlock = "Observer"; + $Game::DefaultCameraSpawnGroups = "CameraSpawnPoints PlayerSpawnPoints PlayerDropPoints"; + + // Global movement speed that affects all Cameras + $Camera::MovementSpeed = 30; +} + +//----------------------------------------------------------------------------- +// DefaultGame manages the communication between the server's world and the +// client's simulation. These functions are responsible for maintaining the +// client's camera and player objects. +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// This is the main entry point for spawning a control object for the client. +// The control object is the actual game object that the client is responsible +// for controlling in the client and server simulations. We also spawn a +// convenient camera object for use as an alternate control object. We do not +// have to spawn this camera object in order to function in the simulation. +// +// Called for each client after it's finished downloading the mission and is +// ready to start playing. +//----------------------------------------------------------------------------- +function DefaultGame::onClientEnterGame(%this, %client) +{ + // This function currently relies on some helper functions defined in + // core/scripts/spawn.cs. For custom spawn behaviors one can either + // override the properties on the SpawnSphere's or directly override the + // functions themselves. + + // Find a spawn point for the camera + %cameraSpawnPoint = %this.pickCameraSpawnPoint($Game::DefaultCameraSpawnGroups); + + // Spawn a camera for this client using the found %spawnPoint + %this.spawnCamera(%cameraSpawnPoint, %client); +} + +//----------------------------------------------------------------------------- +// Clean up the client's control objects +//----------------------------------------------------------------------------- +function DefaultGame::onClientLeaveGame(%this, %client) +{ + // Cleanup the camera + if (isObject(%this.camera)) + %this.camera.delete(); +} + +//----------------------------------------------------------------------------- +// The server has started up so do some game start up +//----------------------------------------------------------------------------- +function DefaultGame::onMissionStart(%this) +{ + //set up the game and game variables + %this.initGameVars(); + + $Game::Duration = %this.duration; +} + +function DefaultGame::onMissionEnded(%this) +{ + cancel($Game::Schedule); + $Game::Running = false; + $Game::Cycling = false; +} + +function DefaultGame::onMissionReset(%this) +{ + // Called by resetMission(), after all the temporary mission objects + // have been deleted. + %this.initGameVars(); + + $Game::Duration = %this.duration; +} + +//----------------------------------------------------------------------------- +// Functions that implement game-play +// These are here for backwards compatibilty only, games and/or mods should +// really be overloading the server and mission functions listed ubove. +//----------------------------------------------------------------------------- +function DefaultGame::pickCameraSpawnPoint(%this, %spawnGroups) +{ + // Walk through the groups until we find a valid object + for (%i = 0; %i < getWordCount(%spawnGroups); %i++) + { + %group = getWord(%spawnGroups, %i); + + %count = getWordCount(%group); + + if (isObject(%group)) + %spawnPoint = %group.getRandom(); + + if (isObject(%spawnPoint)) + return %spawnPoint; + } + + // Didn't find a spawn point by looking for the groups + // so let's return the "default" SpawnSphere + // First create it if it doesn't already exist + if (!isObject(DefaultCameraSpawnSphere)) + { + %spawn = new SpawnSphere(DefaultCameraSpawnSphere) + { + dataBlock = "SpawnSphereMarker"; + spawnClass = $Game::DefaultCameraClass; + spawnDatablock = $Game::DefaultCameraDataBlock; + }; + + // Add it to the MissionCleanup group so that it + // doesn't get saved to the Mission (and gets cleaned + // up of course) + MissionCleanup.add(%spawn); + } + + return DefaultCameraSpawnSphere; +} + +function DefaultGame::spawnCamera(%this, %spawnPoint, %client) +{ + // Set the control object to the default camera + if (!isObject(%client.camera)) + { + %camObj = spawnObject(Camera, Observer); + %client.camera = %camObj; + } + + // If we have a camera then set up some properties + if (isObject(%client.camera)) + { + MissionCleanup.add( %client.camera ); + %client.camera.scopeToClient(%client); + + %client.setControlObject(%client.camera); + + if (isDefined("%spawnPoint")) + { + // Attempt to treat %spawnPoint as an object + if (getWordCount(%spawnPoint) == 1 && isObject(%spawnPoint)) + { + %client.camera.setTransform(%spawnPoint.getTransform()); + } + else + { + // Treat %spawnPoint as an AxisAngle transform + %client.camera.setTransform(%spawnPoint); + } + } + } +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/server/VolumetricFog.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/server/VolumetricFog.cs new file mode 100644 index 000000000..5a8159177 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/server/VolumetricFog.cs @@ -0,0 +1,106 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +function VolumetricFog::onEnterFog(%this,%obj) +{ + // This method is called whenever the control object (Camera or Player) + // %obj enters the fog area. + + // echo("Control Object " @ %obj @ " enters fog " @ %this); +} + +function VolumetricFog::onLeaveFog(%this,%obj) +{ + // This method is called whenever the control object (Camera or Player) + // %obj leaves the fog area. + + // echo("Control Object " @ %obj @ " left fog " @ %this); +} + +function VolumetricFog::Dissolve(%this,%speed,%delete) +{ + // This method dissolves the fog at speed milliseconds + %this.isBuilding = true; + if (%this.FogDensity > 0) + { + %this.setFogDensity(%this.FogDensity - 0.005); + %this.schedule(%speed,Dissolve,%speed,%delete); + } + else + { + %this.isBuilding = false; + %this.SetFogDensity(0.0); + if (%delete !$= "" && %delete !$="0" && %delete !$="false") + %this.schedule(250,delete); + } +} + +function VolumetricFog::Thicken(%this,%speed, %end_density) +{ + // This method thickens the fog at speed milliseconds to a density of %end_density + + %this.isBuilding = true; + if (%this.FogDensity + 0.005 < %end_density) + { + %this.setFogDensity(%this.FogDensity + 0.005); + %this.schedule(%speed,Thicken,%speed, %end_density); + } + else + { + %this.setFogDensity(%end_density); + %this.isBuilding = false; + } +} + +function GenerateFog(%pos,%scale,%color,%density) +{ + // This function can be used to generate some fog caused by massive gunfire etc. + // Change shape and modulation data to your likings. + + %fog=new VolumetricFog() { + shapeName = "data/FPSGameplay/art/environment/Fog_Sphere.dts"; + fogColor = %color; + fogDensity = "0.0"; + ignoreWater = "0"; + MinSize = "250"; + FadeSize = "750"; + texture = "data/FPSGameplay/art/environment/FogMod_heavy.dds"; + tiles = "1"; + modStrength = "0.2"; + PrimSpeed = "-0.01 0.04"; + SecSpeed = "0.02 0.02"; + position = %pos; + rotation = "0 0 1 20.354"; + scale = %scale; + canSave = "1"; + canSaveDynamicFields = "1"; + }; + + if (isObject(%fog)) + { + MissionCleanup.add(%fog); + + %fog.Thicken(500,%density); + } + + return %fog; +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/spectatorGameplay/scripts/server/camera.cs b/Templates/BaseGame/game/data/spectatorGameplay/scripts/server/camera.cs new file mode 100644 index 000000000..e0c597148 --- /dev/null +++ b/Templates/BaseGame/game/data/spectatorGameplay/scripts/server/camera.cs @@ -0,0 +1,85 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +// Global movement speed that affects all cameras. This should be moved +// into the camera datablock. +$Camera::movementSpeed = 30; + +function Observer::onTrigger(%this,%obj,%trigger,%state) +{ + // state = 0 means that a trigger key was released + if (%state == 0) + return; + + // Default player triggers: 0=fire 1=altFire 2=jump + %client = %obj.getControllingClient(); + switch$ (%obj.mode) + { + case "Observer": + // Do something interesting. + + case "Corpse": + // Viewing dead corpse, so we probably want to respawn. + %client.spawnPlayer(); + + // Set the camera back into observer mode, since in + // debug mode we like to switch to it. + %this.setMode(%obj,"Observer"); + } +} + +function Observer::setMode(%this,%obj,%mode,%arg1,%arg2,%arg3) +{ + switch$ (%mode) + { + case "Observer": + // Let the player fly around + %obj.setFlyMode(); + + case "Corpse": + // Lock the camera down in orbit around the corpse, + // which should be arg1 + %transform = %arg1.getTransform(); + %obj.setOrbitMode(%arg1, %transform, 0.5, 4.5, 4.5); + + } + %obj.mode = %mode; +} + + +//----------------------------------------------------------------------------- +// Camera methods +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- + +function Camera::onAdd(%this,%obj) +{ + // Default start mode + %this.setMode(%this.mode); +} + +function Camera::setMode(%this,%mode,%arg1,%arg2,%arg3) +{ + // Punt this one over to our datablock + %this.getDatablock().setMode(%this,%mode,%arg1,%arg2,%arg3); +} diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs index 3f0f64b3d..a3c2d578a 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs @@ -90,17 +90,15 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) %diffuseImageSuffix = ImportAssetWindow.parseImagePathSuffixes(%diffuseImagePath); - - if(ImportAssetWindow.activeImportConfig.UseDiffuseSuffixOnOriginImg == 1 && %diffuseImageSuffix $= "") { %diffuseToken = getToken(ImportAssetWindow.activeImportConfig.DiffuseTypeSuffixes, ",;", 0); - %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %materialItemId, %filename @ %diffuseToken); + %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %assetItem, %filename @ %diffuseToken); } else { - %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %materialItemId); + %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %assetItem); } %assetItem.diffuseImageAsset = %diffuseAsset; @@ -141,7 +139,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%targetFilePath !$= "") { - %normalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId); + %normalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.normalImageAsset = %normalAsset; } } @@ -160,7 +158,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%foundFile) { - %specularAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId); + %specularAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.specularImageAsset = %specularAsset; break; } @@ -182,7 +180,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%foundFile) { - %metalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId); + %metalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.metalImageAsset = %metalAsset; break; } @@ -204,7 +202,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%foundFile) { - %roughnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId); + %roughnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.roughnessImageAsset = %roughnessAsset; break; } @@ -226,7 +224,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%foundFile) { - %smoothnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId); + %smoothnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.SmoothnessImageAsset = %smoothnessAsset; break; } @@ -248,7 +246,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%foundFile) { - %AOAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId); + %AOAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.AOImageAsset = %AOAsset; break; } @@ -270,7 +268,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%foundFile) { - %compositeAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId); + %compositeAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.compositeImageAsset = %compositeAsset; break; } diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 60ac085e1..e247da59b 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -866,6 +866,10 @@ if(TORQUE_TEMPLATE) message("Prepare Template(${TORQUE_TEMPLATE}) install...") file(GLOB_RECURSE INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/*") + IF( NOT TORQUE_D3D11) + list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/D3DCompiler_47.dll") + ENDIF() + foreach(ITEM ${INSTALL_FILES_AND_DIRS}) get_filename_component( dir ${ITEM} DIRECTORY ) STRING(REGEX REPLACE "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/" "${TORQUE_APP_DIR}/" INSTALL_DIR ${dir})