SqHd Posted July 6, 2016 Share Posted July 6, 2016 (edited) *Updated Subject for clarification*Hi all. I had Yack Pack working in 3.6.1 and now I'm having some trouble with 3.8. Below is the merge guide I created for 3.6.1 and used for 3.8 (*note: only changed code snippets are shown. You still need to own Yack Pack and have access to it's merge guide.)First, here are some helpful references that I used:TDN: http://tdn.garagegames.com/wiki/TorqueShaderEngine/Yack_Pack_TGEA_1_7Resource: http://www.garagegames.com/community/resource/view/19541/1Forums: http://www.garagegames.com/community/forums/viewthread/100823/1And here is the current Visual Studio error I'm getting when trying to compile with 3.8. I think it has something to do with "console.h". A lot has changed in that file since 3.6 and "dialogMemory.cpp" has that as an #include. Any tips on what I need to change?error C2440: 'type cast' : cannot convert from 'ConsoleValueRef' to 'char *' dialogMemory.cpp 120error C2440: 'type cast' : cannot convert from 'ConsoleValueRef' to 'char *' dialogMemory.cpp 125dilaogMemory.cpp code that the errors are referring to:ConsoleMethod(DialogMemory, addPhrase, void, 3, 3, "phrase") { object->addPhrase((char*)argv[2]); } ConsoleMethod(DialogMemory, hasPhrase, bool, 3, 3, "phrase") { return object->hasPhrase((char*)argv[2]); } And now for the 3.6.1 merge changes:Change the following in dialogMemory.cpp:change #include "core/bitStream.h" to #include "core/stream/bitStream.h"change #include "game/gameConnection.h" to #include "T3D/gameBase/gameConnection.h"change #include "game/dialogMemory.h" to #include "T3D/dialogMemory.h"change bool DialogMemory::onNewDataBlock(GameBaseData* dptr) to bool DialogMemory::onNewDataBlock(GameBaseData* dptr, bool reload)change if (!mDataBlock || !Parent::onNewDataBlock(dptr)) to if (!mDataBlock || !Parent::onNewDataBlock(dptr, reload))Change the following in dialogMemory.h:change #include "game/gameConnection.h" to #include "T3D/gameBase/gameConnection.h"change #include "core/tVector.h" to #include "core/util/tVector.h"change #include "game/gameBase.h" to #include "T3D/gameBase/gameBase.h"change bool onNewDataBlock(GameBaseData* dptr); to bool onNewDataBlock(GameBaseData* dptr, bool reload);Follow the official Yack Pack Merge Guide with the noted changes:Step 1) engine/source/T3D/player.h1. Insert: replace #include "game/dialogMemory.h" with #include "T3D/dialogMemory.h"2. Insert: same as merge guide3. Insert: same as merge guideStep 2) engine/source/T3D/player.cpp1. Insert: same as merge guide2. Insert: same as merge guide3. Insert: same as merge guide4. Insert: same as merge guideStep 3) engine/source/T3D/shapeBase.h1. Insert: Place after the following bool mTrigger[MaxTriggerKeys]; ///< What triggers are set, if any.2. Insert: comment out static void initPersistFields();Step 4) engine/source/T3D/shapeBase.cpp1. Replace: Not necessary, sAudioTimeout is already set to 5002. Insert: Place after the following mWeaponCamShake = NULL; (instead of damageDir.set(0, 0, 1);)3. Insert: same as merge guide4. Insert: same as merge guide5. Insert: Place after the following “Parent::initPersistFields();” (in the void ShapeBase::initPersistFields() function)//START YACK addField("enableUse", TypeBool, Offset(mEnableUse, ShapeBase)); //END YACKThen insert the following at the end of the file://START YACK ConsoleMethod( ShapeBase, enableUse, void, 3, 3, "bool") { object->enableUse(dAtob(argv[2])); } ConsoleMethod( ShapeBase, isUseEnabled, bool, 2, 2, "") { return object->isUseEnabled(); } //END YACK Step 5) engine/source/T3D/fps/guiCrossHairHud.cpp1. Insert: same as merge guide2. Insert: same as merge guide3. Insert: same as merge guide4. Insert: same as merge guide5. Replace: same as merge guide6. Replace: same as merge guide7. Insert: same as merge guide8. Insert: same as merge guide9. Insert: replace Con::executef(this, 1, "onRender"); with Con::executef(this, "onRender");10. Insert: same as merge guideStep 6) engine/source/gui/utility/guiInputCtrl.h1. Insert: place after the following: typedef GuiMouseEventCtrl Parent;2. Insert: place the following after DECLARE_CONOBJECT(GuiInputCtrl);//START YACK GuiInputCtrl(); //END YACK Step 7) engine/source/gui/utility/guiInputCtrl.cpp1. Insert: same as merge guide2. Insert: place after the following IMPLEMENT_CONOBJECT(GuiInputCtrl);//START YACK GuiInputCtrl::GuiInputCtrl() { mAutoGrabInput = true; } //END YACKThen place after the following Parent::initPersistFields(); (in the void GuiInputCtrl::initPersistFields() function)//START YACK addField("autoGrabInput", TypeBool, Offset(mAutoGrabInput, GuiInputCtrl)); //END YACK3. Replace: same as merge guide4. Replace: same as merge guideStep 8) engine/source/gui/controls/guiTextListCtrl.h1. Insert: same as merge guide2. Insert: same as merge guide3. Insert: same as merge guideStep 9) engine/source/gui/controls/guiTextListCtrl.cpp1. Insert: same as merge guide2. Insert: same as merge guide3. Replace: the entire GuiTextListCtrl::onRenderCell function with:void GuiTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver) { if ( mList[cell.y].active ) { if (selected || (mProfile->mMouseOverSelected && mouseOver)) { RectI highlightRect = RectI(offset.x, offset.y, mCellSize.x, mCellSize.y); highlightRect.inset( 0, -1 ); renderFilledBorder( highlightRect, mProfile->mBorderColorHL, mProfile->mFillColorHL); GFX->getDrawUtil()->setBitmapModulation(mProfile->mFontColorHL); } else GFX->getDrawUtil()->setBitmapModulation(mouseOver ? mProfile->mFontColorHL : mProfile->mFontColor); } else GFX->getDrawUtil()->setBitmapModulation( mProfile->mFontColorNA ); const char *text = mList[cell.y].text; for(U32 index = 0; index < mColumnOffsets.size(); index++) { const char *nextCol = dStrchr(text, '\t'); if(mColumnOffsets[index] >= 0) { dsize_t slen; if(nextCol) slen = nextCol - text; else slen = dStrlen(text); Point2I pos(offset.x + 4 + mColumnOffsets[index], offset.y); RectI saveClipRect; bool clipped = false; if(mClipColumnText && (index != (mColumnOffsets.size() - 1))) { saveClipRect = GFX->getClipRect(); RectI clipRect(pos, Point2I(mColumnOffsets[index+1] - mColumnOffsets[index] - 4, mCellSize.y)); if(clipRect.intersect(saveClipRect)) { clipped = true; GFX->setClipRect( clipRect ); } } GFX->getDrawUtil()->drawTextN(mFont, pos, text, slen, mProfile->mFontColors); if(clipped) GFX->setClipRect( saveClipRect ); } if(!nextCol) break; text = nextCol+1; } }4. Insert: same as merge guide5. Insert: same as merge guide6. Insert: same as merge guide7. Insert: same as merge guide Edited July 6, 2016 by SqHd Quote Link to comment Share on other sites More sharing options...
SqHd Posted July 6, 2016 Author Share Posted July 6, 2016 Step 10) game/scripts/client/default.cs1. Insert: same as merge guideStep 11) game/scripts/client/init.cs1. Insert: the following after the client scripts section://Yack scripts exec("scripts/gui/yackGui.cs"); exec("scripts/gui/guiCrossHairHud.cs"); exec("scripts/gui/yackProfiles.cs"); exec("art/gui/YackGui.gui"); //END YACK Step 12) game/scripts/server/default.cs1. Insert: same as merge guideStep 13) game/art/datablocks/aiPlayer.cs1. Insert: the following after shootingDelay = 2000;//START YACK canTalk = true; dialogScriptName = "Stanley_Sunshine_Dialogue"; dialogScriptFile = "scripts/server/dialogue/Stanley_Sunshine.dls"; dialogImg = "art/yack/Kork_Portrait.png"; name = "SquareHead"; //END YACK Step 14) game/art/datablocks/audioProfiles.cs1. Insert: the following://START YACK datablock SFXDescription(DialogSound : AudioClosest3D) { volume = 1.2; isLooping= false; is3D = true; ReferenceDistance= 10.0; MaxDistance= 30.0; type = $SimAudioType; }; //END YACK2. Insert: the following into game/scripts/server/scriptExec.cs (at the end)://START YACK exec("./dialogue/Stanley_Sunshine.dla"); //END YACK Step 15) game/scripts/server/scriptExec.cs1. Insert: same as merge guide2. Insert: same as merge guide, but in this file game/scripts/server/gameCore.cs3. Insert: place after the following %player.setShapeName(%client.playerName); but in this file game/scripts/server/gameCore.csStep 16) game/scripts/client/default.bind.cs1. Insert: same as merge guideStep 17) game/art/gui/playGui.gui1. Insert: the following after new GuiCrossHairHud(ZoomReticle)new GuiCrossHairHud(Crosshair) { damageFillColor = "0 1 0 1"; damageFrameColor = "1 0.6 0 1"; damageRect = "50 4"; damageOffset = "0 10"; interactDist = "10"; bitmap = "art/gui/crossHair_talk.png"; wrap = "0"; position = "496 368"; extent = "32 32"; minExtent = "8 8"; horizSizing = "center"; vertSizing = "center"; profile = "GuiModelessDialogProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "0"; canSave = "1"; canSaveDynamicFields = "0"; };2. Insert: the following at the end before the last bracket:new GuiTextCtrl(NpcName) { text = "DemoPlayer"; maxLength = "1024"; docking = "None"; margin = "0 0 0 0"; padding = "0 0 0 0"; anchorTop = "1"; anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; position = "20 448"; extent = "175 23"; minExtent = "8 8"; horizSizing = "relative"; vertSizing = "relative"; profile = "YackNameProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "0"; canSave = "1"; canSaveDynamicFields = "0"; }; Quote Link to comment Share on other sites More sharing options...
SqHd Posted July 6, 2016 Author Share Posted July 6, 2016 File Placement:Place in game/art/gui/1. black.png(I had to make a new 'black.png'. I made it 64 x 64 pixels because the 1 x 1 pixel version wasn't working. Before I did this, there were just white bars showing up at the top and bottom of the screen instead of the black ones.)2. crossHair_talk.png3. YackGui.guiPlace in game/art/1. Yack (folder with the 2 .png portraits and all the .ogg sound files)Place in game/scripts/gui/1. yackGui.cs2. yackProfiles.cs – replace the following:“new GuiControlProfile” with “singleton GuiControlProfile”“(YackTextListProfile: GuiTextListProfile)” with “(YackTextListProfile: GuiTextProfile)”3. guiCrossHairHud.cs (change the following):change %this.setBitmap("starter.fps/client/ui/crossHair_talk.png"); to %this.setBitmap("art/gui/crossHair_talk.png");change %this.setBitmap("starter.fps/client/ui/crossHair.png"); to %this.setBitmap("art/gui/weaponHud/crossHair.png");change %this.setBitmap("starter.fps/client/ui/crossHair.png"); to %this.setBitmap("art/gui/weaponHud/crossHair.png");Place in game/scripts/server/1. yack.cs2. dialogue (folder with the Stanley_Sunshine.dla and Stanley_Sunshine.dls files)Stanley_Sunshine.dla (Replace “AudioProfile” with “SFXProfile”)Stanley_Sunshine.dla (Replace “~/data/shapes/player/” with “art/yack/”) Quote Link to comment Share on other sites More sharing options...
SqHd Posted July 6, 2016 Author Share Posted July 6, 2016 Build Warning:This is due to the 3rd insert from step 7 from the merge guide:Warning 31 warning C4715: 'GuiInputCtrl::onWake' : not all control paths return a value guiinputctrl.cpp 107Console Errors:Debug (32 bit):scripts/gui/yackGui.cs (104): Unable to find object: '0' attempting to call function 'hasPhrase'scripts/gui/yackGui.cs (68): Unable to find function alxIsPlayingRelease (32 bit):scripts/gui/yackGui.cs (104): Unable to find object: '0' attempting to call function 'hasPhrase'(Need to do further experimentation – make sure to use the correct AI from UAISK – defaultplayer)??????scripts/server/yack.cs (262): Unknown command addPhrase.???? Object (4287) Camera -> ShapeBase -> GameBase -> SceneObject -> NetObject -> SimObject????? We've blocked so end this sucker??????Mapping string: YackEnd to index: 21scripts/gui/yackGui.cs (68): Unable to find function alxIsPlayingGlitches:1. When speaking to an NPC, there is a quick twitch as the player centers on the NPC.(This may have something to do with the centerHead and facePlayer code in player.cpp and player.h.)2. NPC name is off to the left side3. Audio will continue to play after a mouse click (unless another phrase was selected)Feature Wish List:1. Ability for NPCs to stop and talk (when on a path) and to return to the path afterwards2. Ability for NPCs to return to idle animations Quote Link to comment Share on other sites More sharing options...
Azaezel Posted July 6, 2016 Share Posted July 6, 2016 Folks transitioned to a cleaner system a while back for most of that stuff: https://github.com/GarageGames/Torque3D/blob/7bba3ee2de610c2757bc70eba10db869bab72a85/Engine/source/console/engineAPI.h#L2729***do note, haven't gotten around to PRing over a doc-fix. that " ( "value for s" )" bit should more read "default for f, default for s)") or something along those lines since a) it don't read things backjwards, and b) well, it's the default if you don't pass the method a variable.edit: also, we has community editable wiki http://torque3d.wikidot.com/ nao :D Quote Link to comment Share on other sites More sharing options...
SqHd Posted July 6, 2016 Author Share Posted July 6, 2016 Thanks for the post, Azaezel.Being a non-programmer, sadly I didn't understand much of it.I know just enough about scripting to update a few resources here and there. Quote Link to comment Share on other sites More sharing options...
Azaezel Posted July 11, 2016 Share Posted July 11, 2016 to use https://github.com/GarageGames/Torque3D/blob/7bba3ee2de610c2757bc70eba10db869bab72a85/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp#L95 as a template example, ConsoleMethod(DialogMemory, addPhrase, void, 3, 3, "phrase") { object->addPhrase((char*)argv[2]); } ConsoleMethod(DialogMemory, hasPhrase, bool, 3, 3, "phrase") { return object->hasPhrase((char*)argv[2]); } becomes DefineConsoleMethod( DialogMemory, addPhrase, void, ( const char * phrase ),(""), "Add phrase to the dialogue") { object->addPhrase(phrase); } DefineConsoleMethod( DialogMemory, hasPhrase, bool, ( const char * phrase ),(""), "Does the dialogue contain this passed phrase?") { return object->hasPhrase(phrase); } Quote Link to comment Share on other sites More sharing options...
SqHd Posted July 13, 2016 Author Share Posted July 13, 2016 Thanks for the continued support, Azaezel.It's very nice of you to take the time!Unfortunately, I'm getting even more errors now, so I'll have to do some fiddling. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.