Jump to content

SqHd

Members
  • Posts

    55
  • Joined

  • Last visited

SqHd's Achievements

  1. Hi. Link is back and working. Sorry about that. I didn't think anyone was interested. On a separate note, thanks for all your hard work on 3.10! And I enjoy your work blog. Later.
  2. Very cool. I subscribed to your channel.
  3. @Johxz: Wow! Great work! This is awesome. Thanks for the fix. I did some testing tonight and works like a charm. It's so nice to have this functionality back. Hope it makes the cut for 3.10.
  4. game/core/scripts/client/core.cs - After: exec("~/scripts/client/scriptDoc.cs"); - Add: //---------------------------------------------------------------- //RPGDialog Code Begin //---------------------------------------------------------------- exec("~/scripts/RPGDialogEditor/ingameRPGDialogEditor.cs"); //---------------------------------------------------------------- //RPGDialog Code End //---------------------------------------------------------------- game/scripts/client/config.cs - Add: moveMap.bind(keyboard, "q", TalkTo); game/scripts/client/default.bind.cs - Comment/remove the following line: //moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Ryder\");", ""); - Add to the end of the file: // RPGdialog moveMap.bind(keyboard, "q", TalkTo); //---------------------------------------------------------------- //RPGDialog Code Begin //---------------------------------------------------------------- function TalkTo(%val) { if(%val) commandToServer('RPGDialogRay'); } moveMap.bind(keyboard, "q", TalkTo); moveMap.bindCmd(keyboard, "1", "SelectAnswer(1);", ""); moveMap.bindCmd(keyboard, "2", "SelectAnswer(2);", ""); moveMap.bindCmd(keyboard, "3", "SelectAnswer(3);", ""); moveMap.bindCmd(keyboard, "4", "SelectAnswer(4);", ""); moveMap.bindCmd(keyboard, "5", "SelectAnswer(5);", ""); moveMap.bindCmd(keyboard, "6", "SelectAnswer(6);", ""); moveMap.bindCmd(keyboard, "7", "SelectAnswer(7);", ""); moveMap.bindCmd(keyboard, "8", "SelectAnswer(8);", ""); moveMap.bindCmd(keyboard, "9", "SelectAnswer(9);", ""); moveMap.bindCmd(keyboard, "0", "SelectAnswer(10);", ""); function OutOfRPGDialogFunction(%Number) { switch(%Number) { case 1: commandToServer('use',"Ryder"); case 2: %Number=0;//Does nothing... just a placeholder. case 3: %Number=0;//Does nothing... just a placeholder. case 4: %Number=0;//Does nothing... just a placeholder. case 5: %Number=0;//Does nothing... just a placeholder. case 6: %Number=0;//Does nothing... just a placeholder. case 7: %Number=0;//Does nothing... just a placeholder. case 8: %Number=0;//Does nothing... just a placeholder. case 9: %Number=0;//Does nothing... just a placeholder. case 0: %Number=0;//Does nothing... just a placeholder. } } //---------------------------------------------------------------- //RPGDialog Code End //---------------------------------------------------------------- game/scripts/gui/optionsDlg.cs - Right after: $RemapName[$RemapCount] = "Fire Weapon"; $RemapCmd[$RemapCount] = "mouseFire"; $RemapCount++; - Add: $RemapName[$RemapCount] = "Talk to NPC"; $RemapCmd[$RemapCount] = "TalkTo"; $RemapCount++; game/scripts/client/defaults.cs - Add to the end of the file: //---------------------------------------------------------------- //RPGDialog Code Begin //---------------------------------------------------------------- $Pref::RPGDialog::Client::QuestionPath="art/dialogs/dlq/";//RPGDialog Question Path. $Pref::RPGDialog::MaxOptions = 100;//RPGDialog Max Options. $Pref::RPGDialog::ChatHudQuestionColor="\c1";//Question text Color on the chat hud. $Pref::RPGDialog::ChatHudAnswerColor="\c5";//Answer text Color on the chat hud. //---------------------------------------------------------------- //RPGDialog Code End //---------------------------------------------------------------- game/scripts/client/init.cs - After: exec("art/gui/remapDlg.gui"); - Add: //---------------------------------------------------------------- //RPGDialog Code Begin //---------------------------------------------------------------- exec("art/gui/RPGDialog.gui"); //---------------------------------------------------------------- //RPGDialog Code End //---------------------------------------------------------------- - After: exec("scripts/gui/optionsDlg.cs"); - Add: //---------------------------------------------------------------- //RPGDialog Code Begin //---------------------------------------------------------------- exec("./RPGDialog.cs"); exec("./RPGDialogAudioProfiles.cs"); //---------------------------------------------------------------- //RPGDialog Code End //---------------------------------------------------------------- - After: Canvas.setCursor("DefaultCursor"); - Add //---------------------------------------------------------------- //RPGDialog Code Begin //---------------------------------------------------------------- initRPGDialogEditor(); //---------------------------------------------------------------- //RPGDialog Code End //---------------------------------------------------------------- game/scripts/client/pref.cs - Add to the end of the file: $Pref::RPGDialog::ChatHudAnswerColor = "\c5"; $Pref::RPGDialog::ChatHudQuestionColor = "\c1"; $Pref::RPGDialog::Client::QuestionPath = "art/dialogs/dlq/"; $Pref::RPGDialog::MaxOptions = 100; $Pref::Server::RPGDialog::ActionPath = "art/dialogs/dla/"; game/scripts/server/scriptExec.cs - After: exec("./aiPlayer.cs"); - Add: //---------------------------------------------------------------- //RPGDialog Code Begin //---------------------------------------------------------------- exec("./RPGDialog.cs"); //---------------------------------------------------------------- //RPGDialog Code End //---------------------------------------------------------------- game/scripts/server/defaults.cs - After: // Now add your own game specific server preferences as // well as any overloaded core defaults here. - Add: //---------------------------------------------------------------- //RPGDialog Code Begin //---------------------------------------------------------------- $Pref::Server::RPGDialog::ActionPath="art/dialogs/dla/"; //RPGDialog Action Path. //---------------------------------------------------------------- //RPGDialog Code End //---------------------------------------------------------------- game/scripts/server/pref.cs - Add to the end of the file: $Pref::Server::RPGDialog::ActionPath = "art/dialogs/dla/"; game/scripts/server/aiPlayer.cs - Change this function: //----------------------------------------------------------------------------- // AIPlayer static functions //---------------------------------------------------------------------------- function AIPlayer::spawnAtLocation() - To the following: function AIPlayer::spawnAtLocation(%name, %data, %spawnPoint, %Script, %Portrait, %startQuestion) { // Create the demo player object %player = new AiPlayer() { //dataBlock = DemoPlayer; dataBlock = %data; path = ""; }; MissionCleanup.add(%player); %player.setShapeName(%name); %player.setTransform(%spawnPoint.getTransform()); %player.RPGDialogScript = %Script; %player.RPGDialogPortrait = %Portrait; %player.RPGDialogStartQuestion = %startQuestion; %player.RPGDialogBusy = false; %player.RPGDialogBusyText = 'Sorry but I\'m busy talking to %1 right now.'; %player.RPGDialogTalkingTo = 0; return %player; } game/scripts/server/gameCore.cs - In this function: function GameCore::startGame(%game) - After: // // Start the AI on the specified path // AIPlayer::spawn("Path1"); - Add: AIPlayer::spawnAtLocation(Kaneda, DemoPlayer, spawn1, "Test", "test.png", 1); *Note: This is how you spawn the NPCs - First is the NPC name: Kaneda - Second is the datablock used for the NPC: DemoPlayer (derived from game/art/datablocks/aiPlayer.cs) - Next is the new spawn point: spawn1 - Then the RPG Dialog script: Test (found in the dialogs folder) - Next the RPG Dialog portrait: test.png (found in the dialogs folder) - Finally, the RPG Dialog start question: 1 Create a spawnsphere in the world editor and name it "spawn1". Place it where ever you like. Also, if you don't want the player to use this as a spawn point, make sure it's NOT in the playerDropPoints simset.
  5. RPG Dialog 1.4 to T3D 3.8 (*It also works in T3D 3.9) Since I couldn’t get the Yack Pack working in T3D 3.8, I decided to check out an old GG resource called: RPG Dialog (v1.4). After some experimenting, I was able to get NPCs spawning with the dialog options. Only issue is the sound isn't working. See console errors: scripts/client/RPGDialog.cs (190): Unable to find function alxIsPlaying scripts/client/RPGDialog.cs (191): Unable to find function alxStop scripts/client/RPGDialog.cs (194): Unable to find function alxPlay DropBox link: https://www.dropbox.com/sh/gxfy58huq3hvrpl/AACefZCSBHwnU4JAftDhzv9Ga?dl=0 I used the following forum topics to get this working: (Original Resource): http://www.garagegames.com/community/resources/view/3531 https://www.garagegames.com/community/forums/viewthread/93667 http://www.garagegames.com/community/forums/viewthread/75606 https://www.garagegames.com/community/forums/viewthread/137872
  6. 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.
  7. 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.
  8. 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 107 Console 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 alxIsPlaying Release (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: 21 scripts/gui/yackGui.cs (68): Unable to find function alxIsPlaying Glitches: 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 side 3. 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 afterwards 2. Ability for NPCs to return to idle animations
  9. 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.png 3. YackGui.gui Place in game/art/ 1. Yack (folder with the 2 .png portraits and all the .ogg sound files) Place in game/scripts/gui/ 1. yackGui.cs 2. 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.cs 2. 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/”)
  10. Step 10) game/scripts/client/default.cs 1. Insert: same as merge guide Step 11) game/scripts/client/init.cs 1. 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.cs 1. Insert: same as merge guide Step 13) game/art/datablocks/aiPlayer.cs 1. 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.cs 1. 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.cs 1. Insert: same as merge guide 2. Insert: same as merge guide, but in this file game/scripts/server/gameCore.cs 3. Insert: place after the following %player.setShapeName(%client.playerName); but in this file game/scripts/server/gameCore.cs Step 16) game/scripts/client/default.bind.cs 1. Insert: same as merge guide Step 17) game/art/gui/playGui.gui 1. 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"; };
  11. *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_7 Resource: http://www.garagegames.com/community/resource/view/19541/1 Forums: http://www.garagegames.com/community/forums/viewthread/100823/1 And 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 120 error C2440: 'type cast' : cannot convert from 'ConsoleValueRef' to 'char *' dialogMemory.cpp 125 dilaogMemory.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.h 1. Insert: replace #include "game/dialogMemory.h" with #include "T3D/dialogMemory.h" 2. Insert: same as merge guide 3. Insert: same as merge guide Step 2) engine/source/T3D/player.cpp 1. Insert: same as merge guide 2. Insert: same as merge guide 3. Insert: same as merge guide 4. Insert: same as merge guide Step 3) engine/source/T3D/shapeBase.h 1. 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.cpp 1. Replace: Not necessary, sAudioTimeout is already set to 500 2. Insert: Place after the following mWeaponCamShake = NULL; (instead of damageDir.set(0, 0, 1);) 3. Insert: same as merge guide 4. Insert: same as merge guide 5. 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.cpp 1. Insert: same as merge guide 2. Insert: same as merge guide 3. Insert: same as merge guide 4. Insert: same as merge guide 5. Replace: same as merge guide 6. Replace: same as merge guide 7. Insert: same as merge guide 8. Insert: same as merge guide 9. Insert: replace Con::executef(this, 1, "onRender"); with Con::executef(this, "onRender"); 10. Insert: same as merge guide Step 6) engine/source/gui/utility/guiInputCtrl.h 1. 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.cpp 1. Insert: same as merge guide 2. 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 guide 4. Replace: same as merge guide Step 8) engine/source/gui/controls/guiTextListCtrl.h 1. Insert: same as merge guide 2. Insert: same as merge guide 3. Insert: same as merge guide Step 9) engine/source/gui/controls/guiTextListCtrl.cpp 1. Insert: same as merge guide 2. Insert: same as merge guide 3. 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 guide 5. Insert: same as merge guide 6. Insert: same as merge guide 7. Insert: same as merge guide
  12. SqHd

    Save / Load System?

    Still no luck. Anybody have Steve's save / load system working w/ T3D 3.8?
  13. SqHd

    Save / Load System?

    Finally had a chance to do some more investigation. When I load the game and end up in the black screen mission, I'm being loaded into the "RootGroup" of the scene. I opened the World Editor and that is what shows up scene tree view (instead of the MissionGroup from the save file). If I open the saved .mis file from the World Editor, it loads correctly.
  14. SqHd

    Save / Load System?

    Well, I have some progress. I put the functions in default.bind.cs (bc I'm not sure how to call them via a keybind if they are in another file). When I'm in a mission and I press the key to save, it creates 2 save files. Odd... When trying to load (via the console), I get this console error: getSubStr(...): error, starting position and desired length must be >= 0: (-3, 3) And the screen is just black with an ammo counter for the pistol and the chat HUD welcoming me. If I open the save file via the world editor it works great.
  15. SqHd

    Save / Load System?

    Thanks. I'll try putting in the defaultbind.cs
×
×
  • Create New...