Jump to content

Steve_Yorkshire

Contributor
  • Posts

    350
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Steve_Yorkshire's Achievements

  1. Wooo! Look at those Torquescript gains!
  2. Flight and footslogger for variation surely. Also nice objectives gui.
  3. So, I've been playing around with explosions, player.blowUp(), etc and noticed the info in InitPersistant fields is a bit ... out of date and not very helpful. Here's what it says: addGroup( "Destruction", "Parameters related to the destruction effects of this object." ); addField( "explosion", TYPEID< ExplosionData >(), Offset(explosion, ShapeBaseData), "%Explosion to generate when this shape is blown up." ); addField( "underwaterExplosion", TYPEID< ExplosionData >(), Offset(underwaterExplosion, ShapeBaseData), "%Explosion to generate when this shape is blown up underwater." ); addField( "debris", TYPEID< DebrisData >(), Offset(debris, ShapeBaseData), "%Debris to generate when this shape is blown up." ); addField( "renderWhenDestroyed", TypeBool, Offset(renderWhenDestroyed, ShapeBaseData), "Whether to render the shape when it is in the \"Destroyed\" damage state." ); addField( "debrisShapeName", TypeShapeFilename, Offset(debrisShapeName, ShapeBaseData), "The DTS or DAE model to use for auto-generated breakups. @note may not be functional." ); endGroup( "Destruction" ); And we should be looking at "debris" line ~607-608 and "debrisShapeName" line ~611-612. "@note may not be functional." is the clue here as auto-generated breakups are a thing of the past. What actually happens is your debris model is a collection of mesh objects (with LODs) which are each centred on origin (or else they spin weird because origin is the spin point). "debrisShapeName" the dae/dts file that you have debris mesh objects in. "debris" needs to point to a datablock of "debrisData" to derive velcoity, spin, particles and other data from for "debrisShapeName" - NOTE: if this datablock has a shapefile mentioned then it will override the "debrisShapeName". HOWEVER: if there is no "debrisShapeFile" then NOTHING WILL SPAWN regardless of whether "debrisData" has a shapeFile. And without "debris" pointing to a "debrisData" nothing will spawn because no number of debris has been set. So, maybe change "debris" info (line ~608) to say something like: And "debrisShapeName" info (line ~ 612) to say something like: Anyhow, just muh thoughts in clearing up the outdated info.
  4. I made a text speed-o-meter based on the health text hud gui. 1: First up alter source/T3D/vehicles/vehicle.h so we can get some data returned for the speed hud. This is actual speed (eg: length of velocity) and throttle control. Throttle is pretty much just full power using the keyboard but can be incremented using a gamepad stick. //.... //for returning values to the guiSpeedTextHud F32 getThrottle() { return mThrottle; }//yorks F32 getSpeed() { return getVelocity().len(); }//yorks DECLARE_CONOBJECT(Vehicle); }; #endif Next up we create our new cpp file for the speed text to dsipaly which will reference getSpeed and getThrottle. Call it guiSpeedTextHud.cpp and then save it to your game's source folder and add an fps folder for it to go into. Then add it to your solution in Visual Studio. It gets the player, then what they are mounted to, and bails it it's not a vehicle, or proceeds to get the speed and throttle values. // ---------------------------------------------------------------------------- // A gui control that displays Speed as a numerical value. // ---------------------------------------------------------------------------- #include "platform/platform.h" #include "gui/core/guiControl.h" #include "console/consoleTypes.h" #include "T3D/gameBase/gameConnection.h" #include "T3D/shapeBase.h" #include "T3D/rigidShape.h" #include "T3D/vehicles/vehicle.h" #include "gfx/gfxDrawUtil.h" class GuiSpeedTextHud : public GuiControl { typedef GuiControl Parent; bool mShowFrame; bool mShowFill; bool mShowThrust; //bool mShowTrueSpeed; LinearColorF mFillColor; LinearColorF mFrameColor; LinearColorF mTextColor; LinearColorF mWarnColor; F32 mWarnLevel; F32 mPulseThreshold; S32 mPulseRate; F32 mValue; public: GuiSpeedTextHud(); void onRender(Point2I, const RectI &); static void initPersistFields(); DECLARE_CONOBJECT(GuiSpeedTextHud); DECLARE_CATEGORY("Gui Game"); DECLARE_DESCRIPTION("Shows the Speed or speed level of the current\n" "PlayerObjectType control object as a numerical text display."); }; // ---------------------------------------------------------------------------- IMPLEMENT_CONOBJECT(GuiSpeedTextHud); ConsoleDocClass(GuiSpeedTextHud, "@brief Shows the Speed or Speed value of the current PlayerObjectType control object.\n\n" "This gui can be configured to display either the Speed or speed value of the current Player Object. " "It can use an alternate display color if the Speed or drops below a set value. " "It can also be set to pulse if the Speed or speed drops below a set value. " "This control only works if a server connection exists and it's control object " "is a PlayerObjectType. If either of these requirements is false, the control is not rendered.\n\n" "@tsexample\n" "\n new GuiSpeedTextHud()" "{\n" " fillColor = \"0.0 0.0 0.0 0.5\"; // Fills with a transparent black color\n" " frameColor = \"1.0 1.0 1.0 1.0\"; // Solid white frame color\n" " textColor = \"0.0 1.0 0.0 1.0\" // Solid green text color\n" " warningColor = \"1.0 0.0 0.0 1.0\"; // Solid red color, used when damaged\n" " showFill = \"true\";\n" " showFrame = \"true\";\n" " showTrueValue = \"false\";\n" " showThrust = \"false\";\n" " warnThreshold = \"20\";\n" " pulseThreshold = \"10\";\n" " pulseRate = \"500\";\n" " profile = \"GuiBigTextProfile\";\n" "};\n" "@endtsexample\n\n" "@ingroup GuiGame\n" ); GuiSpeedTextHud::GuiSpeedTextHud() { mShowFrame = mShowFill = true; mShowThrust = false; //mShowTrueSpeed = false; mFillColor.set(0, 0, 0, 0.5); mFrameColor.set(1, 1, 1, 1); mTextColor.set(0, 1, 0, 1); mWarnColor.set(1, 0, 0, 1); mWarnLevel = 20.0f; mPulseThreshold = 10.0f; mPulseRate = 0; mValue = 0.2f; } void GuiSpeedTextHud::initPersistFields() { addGroup("Colors"); addField("fillColor", TypeColorF, Offset(mFillColor, GuiSpeedTextHud), "Color for the background of the control."); addField("frameColor", TypeColorF, Offset(mFrameColor, GuiSpeedTextHud), "Color for the control's frame."); addField("textColor", TypeColorF, Offset(mTextColor, GuiSpeedTextHud), "Color for the text on this control."); addField("warningColor", TypeColorF, Offset(mWarnColor, GuiSpeedTextHud), "Color for the text when Speed is low."); endGroup("Colors"); addGroup("View"); addField("showFill", TypeBool, Offset(mShowFill, GuiSpeedTextHud), "If true, draw the background."); addField("showFrame", TypeBool, Offset(mShowFrame, GuiSpeedTextHud), "If true, draw the frame."); //addField("showTrueValue", TypeBool, Offset(mShowTrueSpeed, GuiSpeedTextHud), "If true, we don't hardcode maxSpeed to 100."); addField("showThrust", TypeBool, Offset(mShowThrust, GuiSpeedTextHud), "If true, display the speed value rather than the Speed value."); endGroup("View"); addGroup("Alert"); addField("warnThreshold", TypeF32, Offset(mWarnLevel, GuiSpeedTextHud), "The Speed level at which to use the warningColor."); addField("pulseThreshold", TypeF32, Offset(mPulseThreshold, GuiSpeedTextHud), "Speed level at which to begin pulsing."); addField("pulseRate", TypeS32, Offset(mPulseRate, GuiSpeedTextHud), "Speed at which the control will pulse."); endGroup("Alert"); Parent::initPersistFields(); } // ---------------------------------------------------------------------------- void GuiSpeedTextHud::onRender(Point2I offset, const RectI &updateRect) { // Must have a connection and player control object GameConnection* conn = GameConnection::getConnectionToServer(); if (!conn) return; ShapeBase* control = dynamic_cast(conn->getControlObject()); if (!control || !(control->getTypeMask() & PlayerObjectType)) return; //now get the vehicle we are mounted to if there is one, else quit Vehicle* cab = dynamic_cast(control->getObjectMount()); if (!cab) return; if (mShowThrust) { F32 thrust = cab->getThrottle(); //mThrottle is a float mValue = thrust * 100;//set it to 0-100% } else mValue = cab->getSpeed(); GFXDrawUtil* drawUtil = GFX->getDrawUtil(); // If enabled draw background first if (mShowFill) drawUtil->drawRectFill(updateRect, mFillColor.toColorI()); // Prepare text and center it S32 val = (S32)mValue; char buf[256]; dSprintf(buf, sizeof(buf), "%d", val); offset.x += (getBounds().extent.x - mProfile->mFont->getStrWidth((const UTF8 *)buf)) / 2; offset.y += (getBounds().extent.y - mProfile->mFont->getHeight()) / 2; LinearColorF tColor = mTextColor; // If warning level is exceeded switch to warning color if(mValue < mWarnLevel) { tColor = mWarnColor; // If the pulseRate is set then pulse the text if Speed is below the threshold if (mPulseRate != 0 && mValue < mPulseThreshold) { U32 time = Platform::getVirtualMilliseconds(); F32 alpha = 2.0f * F32(time % mPulseRate) / F32(mPulseRate); tColor.alpha = (alpha > 1.0f)? 2.0f - alpha: alpha; } } drawUtil->setBitmapModulation(tColor.toColorI()); drawUtil->drawText(mProfile->mFont, offset, buf); drawUtil->clearBitmapModulation(); // If enabled draw the border last if (mShowFrame) drawUtil->drawRect(updateRect, mFrameColor.toColorI()); } And that's it. You have to add it via the GUI Editor to the PlayGui.gui obviously, and it remains hidden until you mount a vehicle. Change the warning level in the editor to get it display green at smaller numbers, default is 10.
  5. Call the volume directly rather than a function to alter the volume - which seems a bit odd but hey ... soundEmitterID.volume=0.5; And apologies for not mentioning this months ago ;)
  6. *squints* Tries to ID the tank ...
  7. Apologies for late reply. You can disable the console in game/main.cs by changing setLogMode from 6 to 0. // Default to a new logfile each session. if( !$logModeSpecified ) { if( $platform !$= "xbox" && $platform !$= "xenon" ) setLogMode(6); } However a client could just turn it back so probably best to remove it and set it to zero in C++ (search for wherever setlogmode gets logged). If the client is seperate from the server they shouldn't be able to access server-side functions as is.
  8. Just to note I had the issue with the DAE exporter adding a "phantom" duplicate armature again recently. I fixed this by parenting the meshes to the armature (without parent via deform) and keeping the armature modifier. This seemed to resolve everything and the exporter did not add a duplicate armature.
  9. Just to note I had the issue with the DAE exporter adding a "phantom" duplicate armature again recently. I fixed this by parenting the meshes to the armature (without parent via deform) and keeping the armature modifier. This seemed to resolve everything and the exporter did not add a duplicate armature.
  10. Alien (Mantis Man) Art Pack https://drive.google.com/file/d/1qedTnm7NaD7dlRbTAobsfrjlLEq8VkHH/view?usp=sharing Also if you're using Blender my how-to tutorial on exporting the zombie FBX files via Blender and into Torque https://forums.torque3d.org/viewtopic.php?f=18&t=1237
  11. Way back in 3.5.1 ... your project/source/torqueConfig.h file should look like this: So first up enable dso compiling flag, then run your project for the DSOs to compile, then disable the flag again. Remove all cs and dae files, let your game read only the compiled files dso and cached.dts ( that way no one can see how bad your scripts are ;) or reuse your collada files) Set the relevant flags for shipping, player etc. As I remember, you have to add the player build flag above the debug flag to disable debug which in turn selects release build. Also manualy set shipping. Also seem to remember that game/main.cs had to be included and NOT the dso of it. This might have been fixed since then as I did mention it to GG but that doesn't mean anything happened and I can't remember off the top of my head. #ifndef _TORQUECONFIG_H_ #define _TORQUECONFIG_H_ //----------------------------------------------------------------------------- //Hi, and welcome to the Torque Config file. // //This file is a central reference for the various configuration flags that //you'll be using when controlling what sort of a Torque build you have. In //general, the information here is global for your entire codebase, applying //not only to your game proper, but also to all of your tools. /// What's the name of your application? Used in a variety of places. #define TORQUE_APP_NAME "Airship Dragoon" /// What version of the application specific source code is this? /// /// Version number is major * 1000 + minor * 100 + revision * 10. #define TORQUE_APP_VERSION 1660 /// Human readable application version string. #define TORQUE_APP_VERSION_STRING "1.6.6" /// Define me if you want to enable multithreading support. #ifndef TORQUE_MULTITHREAD #define TORQUE_MULTITHREAD #endif /// Define me if you want to disable Torque memory manager. #ifndef TORQUE_DISABLE_MEMORY_MANAGER #define TORQUE_DISABLE_MEMORY_MANAGER #endif /// Define me if you want to disable the virtual mount system. //#define TORQUE_DISABLE_VIRTUAL_MOUNT_SYSTEM /// Define me if you want to disable looking for the root of a given path /// within a zip file. This means that the zip file name itself must be /// the root of the path. Requires the virtual mount system to be active. //#define TORQUE_DISABLE_FIND_ROOT_WITHIN_ZIP //Uncomment this define if you want to use the alternative zip support where you can //define your directories and files inside the zip just like you would on disk //instead of the default zip support that treats the zip as an extra directory. //#define TORQUE_ZIP_DISK_LAYOUT /// Define me if you don't want Torque to compile dso's //#define TORQUE_NO_DSO_GENERATION #define TORQUE_PLAYER//yorks add this and for player! // Define me if this build is a tools build #ifndef TORQUE_PLAYER # define TORQUE_TOOLS #else # undef TORQUE_TOOLS #endif /// Define me if you want to enable the profiler. /// See also the TORQUE_SHIPPING block below //#define TORQUE_ENABLE_PROFILER /// Define me to enable debug mode; enables a great number of additional /// sanity checks, as well as making AssertFatal and AssertWarn do something. /// This is usually defined by the build target. //#define TORQUE_DEBUG /// Define me if this is a shipping build; if defined I will instruct Torque /// to batten down some hatches and generally be more "final game" oriented. /// Notably this disables a liberal resource manager file searching, and /// console help strings. #define TORQUE_SHIPPING//yorks on /// Define me to enable a variety of network debugging aids. /// /// - NetConnection packet logging. /// - DebugChecksum guards to detect mismatched pack/unpacks. /// - Detection of invalid destination ghosts. /// //#define TORQUE_DEBUG_NET /// Define me to enable detailed console logging of net moves. //#define TORQUE_DEBUG_NET_MOVES /// Enable this define to change the default Net::MaxPacketDataSize /// Do this at your own risk since it has the potential to cause packets /// to be split up by old routers and Torque does not have a mechanism to /// stitch split packets back together. Using this define can be very useful /// in controlled network hardware environments (like a LAN) or for singleplayer /// games (like BArricade and its large paths) #define MAXPACKETSIZE 1500//yorks on /// Modify me to enable metric gathering code in the renderers. /// /// 0 does nothing; higher numbers enable higher levels of metric gathering. //#define TORQUE_GATHER_METRICS 0 /// Define me if you want to enable debug guards in the memory manager. /// /// Debug guards are known values placed before and after every block of /// allocated memory. They are checked periodically by Memory::validate(), /// and if they are modified (indicating an access to memory the app doesn't /// "own"), an error is flagged (ie, you'll see a crash in the memory /// manager's validate code). Using this and a debugger, you can track down /// memory corruption issues quickly. //#define TORQUE_DEBUG_GUARD /// Define me if you want to enable instanced-static behavior //#define TORQUE_ENABLE_THREAD_STATICS /// Define me if you want to gather static-usage metrics //#define TORQUE_ENABLE_THREAD_STATIC_METRICS /// Define me if you want to enable debug guards on the FrameAllocator. /// /// This is similar to the above memory manager guards, but applies only to the /// fast FrameAllocator temporary pool memory allocations. The guards are only /// checked when the FrameAllocator frees memory (when it's water mark changes). /// This is most useful for detecting buffer overruns when using FrameTemp<> . /// A buffer overrun in the FrameAllocator is unlikely to cause a crash, but may /// still result in unexpected behavior, if other FrameTemp's are stomped. //#define FRAMEALLOCATOR_DEBUG_GUARD /// This #define is used by the FrameAllocator to align starting addresses to /// be byte aligned to this value. This is important on the 360 and possibly /// on other platforms as well. Use this #define anywhere alignment is needed. /// /// NOTE: Do not change this value per-platform unless you have a very good /// reason for doing so. It has the potential to cause inconsistencies in /// memory which is allocated and expected to be contiguous. /// ///@ TODO: Make sure that everywhere this should be used, it is being used. #define TORQUE_BYTE_ALIGNMENT 4 /// This #define should be set if the engine should use a 32-bit format for /// 24-bit textures. The most notable case is converting RGB->RGBX for various /// reasons. // CodeReview: It may be worth determining this at run-time. Right now I just // want to wrap code which forces the conversion from 24->32 in a common // #define so it is easily turned on/off for the problems we are encountering in // the lighting. [5/11/2007 Pat] //#define TORQUE_FORCE_24_BIT_TO_32_BIT_TEXTURES /// This #define is used by the FrameAllocator to set the size of the frame. /// /// It was previously set to 3MB but I've increased it to 16MB due to the /// FrameAllocator being used as temporary storage for bitmaps in the D3D9 /// texture manager. #define TORQUE_FRAME_SIZE 16 << 20 // Finally, we define some dependent #defines. This enables some subsidiary // functionality to get automatically turned on in certain configurations. #ifdef TORQUE_DEBUG #define TORQUE_GATHER_METRICS 0 #define TORQUE_ENABLE_PROFILE_PATH #ifndef TORQUE_DEBUG_GUARD #define TORQUE_DEBUG_GUARD #endif #ifndef TORQUE_NET_STATS #define TORQUE_NET_STATS #endif // Enables the C++ assert macros AssertFatal, AssertWarn, etc. #define TORQUE_ENABLE_ASSERTS #endif #ifdef TORQUE_RELEASE // If it's not DEBUG, it's a RELEASE build, put appropriate things here. #endif #ifdef TORQUE_SHIPPING // TORQUE_SHIPPING flags here. #else // Enable the profiler by default, if we're not doing a shipping build. #define TORQUE_ENABLE_PROFILER // Enable the TorqueScript assert() instruction if not shipping. #define TORQUE_ENABLE_SCRIPTASSERTS // We also enable GFX debug events for use in Pix and other graphics // debugging tools. #define TORQUE_ENABLE_GFXDEBUGEVENTS #endif #ifdef TORQUE_TOOLS # define TORQUE_INSTANCE_EXCLUSION "TorqueToolsTest" #else # define TORQUE_INSTANCE_EXCLUSION "TorqueTest" #endif // This is the lighting system thats enabled by default when the scene graphs are created. //#define DEFAULT_LIGHTING_SYSTEM "SynapseGaming Lighting Kit" #define DEFAULT_LIGHTING_SYSTEM "Basic Lighting" // Someday, it might make sense to do some pragma magic here so we error // on inconsistent flags. // The Xbox360 has it's own profiling tools, the Torque Profiler should not be used #ifdef TORQUE_OS_XENON # ifdef TORQUE_ENABLE_PROFILER # undef TORQUE_ENABLE_PROFILER # endif # # ifdef TORQUE_ENABLE_PROFILE_PATH # undef TORQUE_ENABLE_PROFILE_PATH #endif #endif #endif // _TORQUECONFIG_H_ If you're using Steam you need to ship the steam_api.dll in your game folder and of course have the necessary links to #include and probably achievements and hookup stuff in app/mainLoop.cpp. Sure I wrote a tutorial on this somewhere. :?
  12. *Changes bookmark to read @JeffR master builds, because I can never remember his github username* ... squints at Az for same reason ... :evil:
  13. Just to note; after more faffing around in Blender I discovered that you can actually "apply all transforms" via the object and it will automagically set it's position, rotation and scale to default, once you have rotated and repositioned the armature to your liking, with just the click of a button (and the same for each mesh) - thus saving all the faffing around of manual rotations. You can also export a T-Pose straight from makeHuman under their "Pose tab", but you will still have to make the 1 degree change midway up the spine to get the armature perfectly straight.
×
×
  • Create New...