Jump to content

irei1as

Members
  • Posts

    84
  • Joined

  • Last visited

Posts posted by irei1as

  1. Sadly, inside the class Player there is a lot of code that implies that the orientation will be always feet towards -z direction (head goes to +z).


    This awesome resource:

    http://www.garagegames.com/community/blogs/view/16149

    lets you rotate freely but it needs a few changes as it's a bit outdated (well, as you use a custom gravity you have to program changes, anyway).


    Also, I heavily suggest you to make a copy of your player files before doing the code changes. You may need to go back to the previous player code if anything goes wrong.

  2. Do fixes like this automatically get put in to future engine releases?

    The fix @Azaezel points is already in, of course, but if you mean this resource... I don't think it's all-purpose enough to be included, it's kinda heavy with all those castRay and I'm not sure if it's 100% bug-free.

    You really should fully test it before you add it (specially multiplayer if you plan to use it with that).


    But, hey, if enough people check it and they think it's worth it I'm ok with a pull request to add it to the main code.



    As side note, let me add a few images to the first post so it's a bit clearer what the code does.

  3. Small code change to make the decals from bullet shots to dissapear if the object under it dissapears (or moves away or the shape changes and under the shots there is nothing anymore).

    I'm not sure if it works for multiplayer and it may be heavy on resources if there are a lot of decals active.


    (Related to http://forums.torque3d.org/viewtopic.php?f=12&t=733 )


    Example_ A Red cube becomes a smaller green shape after a few bullets impact.

    Before the code change some decals keep hanging:

    http://i.imgur.com/RoWzqdB.png


    With this code change the decals without base disappear:

    http://i.imgur.com/XkkwlBR.png


    (Note: The decals need to have lifetime. Permanent decals keep hanging.)



    --Code changes--


    In decalInstance.h add after

     

          DecalData *mDataBlock;

     

    this line:

     

          S32 surfaceObject;

     


    Then, also in that file, replace

     

    	   DecalInstance() : mId(-1) {}   

     

    with

     

    	   DecalInstance() : mId(-1), surfaceObject(0) {}   

     



    In projectile.cpp find:

     

          // Client (impact) decal.
         if ( mDataBlock->decal )     
            gDecalManager->addDecal(p, n, 0.0f, mDataBlock->decal);


    And replace it with:

     

          // Client (impact) decal.
         DecalInstance * decalReturn = NULL;
         if ( mDataBlock->decal )     
            decalReturn = gDecalManager->addDecal(p, n, 0.0f, mDataBlock->decal);
         if(decalReturn)
         {
            RayInfo rInfo;
            Point3F oldPosition = p;
            Point3F newPosition = p - (n*0.05);
            // Raycast the abstract PhysicsWorld if a PhysicsPlugin exists.
            bool hit = false;
            //disableCollision();
            //let's ignore bullet physics and go the poor castRay
            hit = gClientContainer.castRay(oldPosition, newPosition, csmDynamicCollisionMask | csmStaticCollisionMask, &rInfo);
            //enableCollision();
            //if(rInfo.object has some quality that enables this check) {
               if(hit)
                  decalReturn->surfaceObject = (rInfo.object)->getId(); //else, surfaceObject keeps being 0
            //} ----- closing of  if(rInfo.object has some quality...)
         }


    ---------------------------------


    In decalManager.cpp find:

                if ( dinst->mVisibility <= 0.0f )
               {
                  mDecalQueue.erase_fast( i );
                  removeDecal( dinst );               
                  i--;
                  continue;
               }
            }


    And add after that:

             if(dinst->surfaceObject)
            {
               if(!Sim::findObject(dinst->surfaceObject))
               {
                  //the object that was under the decal does not exist anymore
                  mDecalQueue.erase_fast( i );
                  removeDecal( dinst );               
                  i--;
                  continue;
               }
               RayInfo rInfo;
               Point3F oldPosition = dinst->mPosition;
               Point3F newPosition = dinst->mPosition - (dinst->mNormal*0.05);
               bool hit = false;
               //disableCollision();
               //let's ignore bullet physics and go the poor castRay in the client
               hit = gClientContainer.castRay(oldPosition, newPosition, (PlayerObjectType | VehicleObjectType) | (TerrainObjectType | StaticShapeObjectType), &rInfo);
               //enableCollision();
               if(!hit || ((rInfo.object)->getId() != dinst->surfaceObject))
               {
                  //the object that was under the decal moved or transformed and the decal is in the air
                  mDecalQueue.erase_fast( i );
                  removeDecal( dinst );               
                  i--;
                  continue;
               }
            }
    

     

    They should end as:

    source\T3D\decal\decalInstance.h : http://pastebin.com/43QiN2df

    source\T3D\projectile.cpp : http://pastebin.com/B170LDAm

    source\T3D\decal\decalManager.cpp : http://pastebin.com/r1U5fJ5F

  4. To use this you need this c++ code addition (it's already merged with the current development branch):

    https://github.com/GarageGames/Torque3D/pull/1608/files


    I'm using the "Full Template" with this example.

    This example is for directX as I don't know much glsl, sorry.


    Create the file "mapFunctions.cs" with this content:

    //Post effect functionality
    
    singleton ShaderData( mapshader )
    {   
      DXVertexShaderFile   = "./mapV.hlsl";
      DXPixelShaderFile    = "./mapP.hlsl";
    
      //if you have the glsl code
      //OGLVertexShaderFile = "./mapV.glsl";
      // OGLPixelShaderFile = "./mapP.glsl";
    
      samplerNames[0] = "$map";
      samplerNames[1] = "$mask";
    
      pixVersion = 2.0;
    };
    
    singleton GFXStateBlockData( mapstateblock )
    {
      samplersDefined = true;
      samplerStates[0] = SamplerClampLinear;
      samplerStates[1] = SamplerClampLinear;
    };
    
    singleton PostEffect( MapTest )
    {
      isEnabled = false;
      shader = mapshader;
      stateBlock = mapstateblock;
      texture[0] = "./map";
      texture[1] = "./mask";
      target = "#maptexture";
    };
    
    function MapTest::preProcess(%this)
    {
      //here we can change the textures if needed of the map and the mask
    
      //switch($differentmaps)
      //{
      //   case 0:
      //      %this.setTexture(0, "./map");
      //   case 1:
      //      %this.setTexture(0, "./map1");
      //   case 2:
      //      %this.setTexture(0, "./map2");
      //}
    
      //switch($differentmasks) {...}
      //use %this.setTexture(1, "./mask#") instead
    }
    
    function getRotationAngleForMap()
    {
      //returns point2f the cosine and sine of the angle of rotation, 0º is up=north, 90º means up=east
      %eyevector=LocalClientConnection.player.getEyeVector();
      %angle=mAtan(%eyevector.x,%eyevector.y);
      return mCos(%angle) SPC mSin(%angle);
    }
    
    function getMapCenter()
    {
      %pos=LocalClientConnection.player.getPosition();
      return %pos.x SPC %pos.y;
    }
    
    function getMapCorners()
    {
      //returns point4f the position of the top-left and bottom-right in torque units of the map
      //(x,y) is the x and y position of the top left and (z,w) are the x and y position of the bottom right
    
      //switch($differentmaps)
      //{
      //   case 0:
      //      return "0 20 20 0";
      //   case 1:
      //      return "40 620 220 500";
      //   case 2:
      //      return "33.12 68.2 87.15 17.9";
      //   //etc
      //}
    
      //example
      return "-6 15 71 -52";
    }
    
    function getMapSizes()
    {
      //returns point2f the range in torque units (x,y) that is showed in the gui
    
      //switch($differentmaps)
      //{
      //   case 0:
      //      return "10 10";
      //   case 1:
      //      return "30 45";
      //   case 2:
      //      return "8 18";
      //   //etc
      //}
    
      //example
      return "20 10";
    }
    
    function MapTest::setShaderConsts(%this)
    {
      %this.setShaderConst( "$cossin", getRotationAngleForMap() );
      %this.setShaderConst( "$centerpos", getMapCenter() );
      %this.setShaderConst( "$mapcorners", getMapCorners() );
      %this.setShaderConst( "$guisizes", getMapSizes() );
    }
    
    //Functions to display the map
    function enableMapDisplay()
    {
      if(!isObject(MissionCleanup))
      {
         echo("No MissionCleanup detected. You need to start a level.");
         return;
      }
      if(isObject(MapDisplayCleaner))
         return; //already enabled
    
      MapTest.enable();
      %scriptObject = new ScriptObject(MapDisplayCleaner){
      };
      MissionCleanup.add(%scriptObject);
      %guidisplay = new GuiBitmapCtrl(MapDisplayBitmap) {
         wrap = "0";
         position = "490 22";
         extent = "130 130";
         horizSizing = "right";
         vertSizing = "bottom";
         visible = "1";
      };
      %playguiProbably = Canvas.getContent();
      %playguiProbably.add(%guidisplay);
      %scriptticker = new ScriptTickObject(MapDisplayUpdater){
         callOnAdvanceTime=1;
      };
      MissionCleanup.add(%scriptticker);
    }
    
    function disableMapDisplay()
    {
      MapTest.disable();
      MapDisplayCleaner.delete();
      mapDisplayUpdater.delete();
    }
    
    function MapDisplayUpdater::onAdvanceTime(%this,%delta)
    {
      MapDisplayBitmap.setNamedTexture("maptexture");
    }
    
    function MapDisplayCleaner::onRemove(%this)
    {
      MapDisplayBitmap.delete();
      MapTest.disable();
    }
    
    

     

    Remember you need to "exec" that file somewhere.


    Now to the same folder add these files:

    -First make "mapV.hlsl" (note: ANSI file)

    struct VertToPix
    {
      float4 hpos       : POSITION;
      float2 uv        : TEXCOORD0;
    };
    
    VertToPix main( VertToPix In )
    {
      VertToPix Out = In;
      return Out;
    }
    

     

    -Second create "mapP.hlsl" (note: ANSI file)

    uniform sampler2D map : register(S0);
    uniform sampler2D mask : register(S1);
    
    uniform float2 cossin;
    uniform float2 centerpos;
    uniform float4 mapcorners;
    uniform float2 guisizes;
    
    float4 main( float2 texcoord : TEXCOORD0 ) :COLOR
    {
      float2x2 baserot = float2x2(cossin.x,-cossin.y,cossin.y,cossin.x);
    
      float2 rotmap;
      float2 delta = float2((mapcorners.z-mapcorners.x),(mapcorners.w-mapcorners.y));
      rotmap = (centerpos-mapcorners.xy)/delta + mul(baserot,(texcoord-0.5)*guisizes/float2(delta.x,-delta.y));
    
      float4 color1 = tex2D(map, rotmap);
      color1.a=(tex2D(mask, texcoord)).a;
      return color1;
    } 
    

     

    -Then download this image and rename it "map.png"

    http://i.imgur.com/R1LCLG8.png


    -Also rename to "mask.png" this one:

    http://i.imgur.com/TCUL2vU.png


    (So, in the same folder you have mapFunctions.cs, mapV.hlsl, mapP.hlsl, map.png and mask.png.)

    Now run the game, start a level and use in the console:

    enableMapDisplay();
    LocalClientConnection.player.setPosition("13 -5 250");

    Now walk around to see the map move with you.

    http://i.imgur.com/SxnZpDY.png


    The comments in the script should give you hints on how to change the values for your needs.


    Some notes:

    The images should be png format.

    The map will display better if all the outer ring of pixels is a constant colour (transparent works, too).

    For the mask, opaque pixels display image.

    Here you have the five files of the example in a zip: http://www.mediafire.com/download/mzu23u3323q3821/map.zip

  5. I can't give you explanationes but here are my confusing experience. I would love explanations, too


    I've used and worked for the main player (class AIPlayer, 3rd person beat'em up thing)


    bob.destroyThread(0);

    bob.playThread(0,"punch");


    But take in account that punch animation is a blended animation. If it were not then just walking would stop the animation. It's a pain if you want to kick.


    I had problems with setActionThread doing "punch" and walking with the main char. But for NPC (class AIPlayer) this worked:


    function SlimeData::onDisabled(%this, %obj, %state)

    {

    %obj.stop(); //so the death doesn't move

    %obj.setActionThread("Death1");

    ...


    and also worked


    function AIPlayer::do_atk(%this)

    {

    %this.setActionThread("bellyhit");

    }

  6. Alright, the code should work as this:

     

      %rayResult = %obj.doRaycast(10000.0, %rayMask);
    
      %objTarget = firstWord(%rayResult);
      %objPos = getWords(%rayResult, 1, 3);
      %objDir = getWords(%rayResult, 4, 6);
    
      %mat_rotx = MatrixCreateFromEuler( mAtan( mSqrt( %objDir.x*%objDir.x + %objDir.y*%objDir.y), %objDir.z) SPC "0 0");
      //%mat_localzrot = MatrixCreateFromEuler("0 0" SPC %localzrot);
      //%mat_rotx = MatrixMultiply(%mat_rotx,%mat_localzrot);
      %mat_rotz = MatrixCreateFromEuler("0 0" SPC mAtan(%objDir.x,%objDir.y));
      %transform = MatrixMultiply(%mat_rotz,%mat_rotx);
    
      %box_.setTransform(%transform);
      %box_.position = %objPos;
    

     

    If you want to rotate the %box_ in the local z axis then remove the commenting and define %localzrot as the radian angle to rotate.

  7. I can't find the function "doRaycast" in my build so I'm going to assume you're using the one defined in

    https://www.garagegames.com/community/forums/viewthread/118723

    (You may want to check the console for "Unknown command doRaycast" error if you're not using that).


    Your code seems correct.

    I would try

      %rayResult = %obj.doRaycast(10000.0, %rayMask);
    
      %objTarget = firstWord(%rayResult);
      %objPos = getWords(%rayResult, 1, 3);
      %objDir = getWords(%rayResult, 4, 6);
      %transform = MatrixCreate(%objPos,%objDir);
    
      %box_.setTransform(%transform);
    

    But that's basicalliy the same.


    For testing you may want to also add to that


    echo("Ray result=" SPC %rayResult);


    To be sure the raycast was correct.

  8. @Dwarf King You're right, my mistake.

    I looked for "Chinese text" with google and used the first result but it seems it's a traditional example. Please, excuse my incorrect use.

    Msmincho fails with simplified Chinese.


    For simplified Chinese it seems SimHei (a microsoft chinese font) works, so use this profile instead of the previous one:

    singleton GuiControlProfile(GuiTextProfileChi : GuiTextProfile)
    {
      fontCharset = "CHINESEBIG5";
      category = "Extra";
      fontType = "SimHei";
      fontSize = 20;
    };
    

    http://i.imgur.com/vstlJ8m.png



    @rlranft Sadly default extended MLText lacks the localization part of TextCtrl (well, I can't find the textID part, correct me if I'm wrong) so from stock we can't use the localization .txt and the profile changing.

    But the profile changing is more of a graphics thing of the font. You can see in the image how "This is English" has a weird font (that's the SimHei English) quite different from the Arial from the "Singleplayer".

    It's not much of an issue if you're ok of how it looks.

  9. Let me confirm that Chinese do work with the c++ change and a localization.

    But it needs a bit of more work as arial fails for chinese.


    I first added msmincho.ttc (ms mincho, a chinese font, I think) to the font folder in core.

    Then I added this new profile:

    singleton GuiControlProfile(GuiTextProfileChi : GuiTextProfile)
    {
      fontCharset = "CHINESEBIG5";
      category = "Extra";
      fontType = "msmincho";
      fontSize = 20;
    };
    

     

    I made sure this thing is loaded before the exec() of the gui that uses it and after the singleton of GuiTextProfile.


    Then in the GuiTextControl I changed the profile to that GuiTextProfileChi.

    Also to that GuiTextControl I pointed textID = "line_chinese";

    line_chinese is defined in the chinese.txt like:

    _linezero = _
    line_chinese = 中國哲學書電子化計劃
    line_b = dos line
    

    Then just loaded chinese.txt as I explained in a previous post.

    http://i.imgur.com/O8HKw0M.png


    Now, it may be a bit hard to properly switch languages if you need two different profiles.

    I guess I could use a common single font with full support for all the languages.

    But I think the best method would be to switch profiles in the OnWake callback if the language needs it.

  10. Ah, you need then Visual Studio.

    If you look inside the build folder yuo'll see vs201x folders. Inside those there are files for those programs.


    I use WindowsXP in my old computer so I have Visual Studio 2010. After installing it AND (important) the directx sdk I can build it running the .sln file. Well, and then using f7 inside the program.


    If you have a newer windows you may want to look for the 2012 version (that's the other vs folder, isn't it).

    Be sure you get the freeware version.


    I think the directx sdk is

    https://www.microsoft.com/en-us/download/details.aspx?id=6812


    Can anybody else confirm this?

  11. Any kind of project to check the changes is alright. Using empty or full template is fine. You may want to use the project you're using to make the gui that is going to be localized.

    The folder "game/scripts" is just an example so it may change for other kind of templates. You can use other directories if you want, of course.


    Those files being txt is because they aren't torquescript files, just the text. After doing all the text, running the program and obtaining its .lso and the languagemap.cs you can delete the txt for its release (I didn't release the txt files). Err, remember to save the original files somewhere for if you want to make updates after the release, of course.



    To remove the BOM (byte order mark) is easy with notepad++:

    http://www.larshaendler.com/2015/01/20/remove-bom-with-notepad/

    If you leave the BOM (a few bytes at the start of a text file) the program may not read the line correctly. But it may still work if the first line is something like:

    first_line = Not used first line.

    And you just don't use it.


    Notepad++ is a freeware text editor with a very good support for a lot of languages (I know it works for English, Spanish and Japanese, for example). It's quite useful for coders, too. I particularly use a lot its "find in files" option for the torque 3d code. I recommend it.


    So, let me point what it's supposed to be done:

    1- Change the c++ code

    2- Create a new project. Full template is a perfect start.

    3- Compile the new exe with the changes made at the start for that new project.

    The way to compile the new exe is in the build folder of that new project.

    4- In "game/scripts" create all the text files in UTF8 without BOM you want like "English.txt", "French.txt", etc and set its content like told in the pastebin thing.

    5- Do the changes to game/scripts/main.cs and game/main.cs as stated.


    Note that you have to use the names of the files you made!

    If you have English.txt, French.txt and Japanese.txt (for example) you'll need to make a few changes:

    compileLanguage("./English.txt", 1); //that 1 exists to create languageMap.cs

    compileLanguage("./French.txt", 0); //different line!

    compileLanguage("./Japanese.txt", 0); //a new third language!

    mainLangTable.addLanguage("./english.lso", "English"); //language #0

    mainLangTable.addLanguage("./French.lso", "French"); //language #1

    mainLangTable.addLanguage("./Japanese.lso", "Japanese"); //language #2


    6- Run the exe (the newly created we did before) and the .lso and the languagemap.cs will be created in game/scripts.

    7- In order for the gui to use those languages you have to use the textID field in the gui editor with the name of the line.

    http://i.imgur.com/KNmIRpr.png


    You can also change textID with the method setTextID(%textID)

    To set a new text for the text gui of the image the console function could be:

    TheNamedText.setTextID("story_text_A01");


    (story_text_A01 = ... is a line defined in the txt)


    8- If the text doesn't change right away use popDialog and pushDialog like said in the TorqueScript Reference Manual for localization.




    Sorry if I'm not explaining myself correctly enough. If you still have any issue please don't hesitate to ask and I'll see if I can upload an example or something.

    Good luck!

  12. Localization is outdated in the current code as it lacks some old programs.

    You can read how it worked if you look for "localization" in the "TorqueScript Reference Manual".

    The TorqueScript Reference Manual is a must to have anyway so get it if you don't have it already. The official one (I think) is in here:

    http://docs.garagegames.com/torque-3d/official/content/documentation/Scripting/Overview/Introduction.html


    I do localization based on the resource posted by the user Manoel Neto in this page:

    https://www.garagegames.com/community/forums/viewthread/114207


    It works with the actual code very well. If you want to check an example you can try this small game:

    https://irei1as.itch.io/1t


    (My documentation on how to use: http://pastebin.com/buMu4cmM )

  13. If you mean show numeric values then you have the console commands


    metrics("gfx");

    metrics("fps");


    How those values are found are in core in torquescript.



    If you mean to actually render something from c++... I don't know much but drawutil.cpp has the basic draw of a textured poligon. I guess that's an start. Aren't there some example clases of rendering shapes,too?

  14. You should compile a new .exe.

    Here is the wiki:

    http://wiki.torque3d.org/coder:compiling-in-windows


    What I do:

    Inside the "buildFiles" folder there are various pre-made methods for some common compiler things.

    For my WindowsXP with preoject manager 2.1 I use the .sln inside "VisualStudio 2010" as I can use the free version of VisualStudio 2010 (obtainable from microsoft web). I have the DirectX SDK like said in the wiki.

    Then I press F7 (build) and wait. I somethimes get linking errors (those aren't code errors) that are fixed by just trying F7 again.

    The new project manajer (2.2) also has linux and VS2015 I think.


    By the way, the first time you compile a new project may take a long time (even some hours) but that exe can be used then for multiple projects if you don't need to change the c++ code.



    -NO COMPILING WAY-

    Well, there is the other option of using an already made exe.

    You can get the engine binaries here:

    http://wiki.torque3d.org/main:downloads#toc4

    But those are a bit outdated.

  15. The crash is related to

    https://github.com/GarageGames/Torque3D/blob/development/Engine/source/lighting/advanced/advancedLightManager.cpp#L79


    If that function returns false, be the pixel shader less than 3.0 or the card unable to use R16F textures, then the advanced lighting isn't initialized (so it could try another light manager next). The old computer fails at both then no light manager at all. It's more a minimum graphics requirement issue so it's not really related to the new template work.

    http://i.imgur.com/VBgzmya.png

    http://i.imgur.com/UdRA8qC.png


    Console log: http://pastebin.com/KjPGfV1b


    I'll "shake" a bit the source around to try to force past the pixshader 3.0 and the 16 bit textures. But I don't think many people needs this kind of ancient compability.

    ---------------------------------------


    A thing I've noted that it's not fixed for the template is the bug of the animation trigger editor explained in:

    https://github.com/GarageGames/Torque3D/issues/1273



    Other minor thing is that some buttons of the menu don't show if the height resolution is kind of small (1024x576). But anybody can fix that with the gui editor if they plan on using a smaller screen.

  16. Maybe a mistype in the script made it to fail to load?

    I've had the issue of missing a ";" on a line making all the rest of the functions to not work.


    Try to look from the start of the console log when you launch the game to see if there are any red lines showing errors.

  17. -Using basic lightning-

    First I start a new mission and open the gui editor so I can change playGui.gui

    Then I add a GuiObjectView (child to playgui), choose a model and it displays correctly. I save the gui and close the game (end the application, not just end the mission). No problem this first time.


    But after starting the program again, the model then shows no texture. And if you use the model elsewhere (like a TSStatic) it keeps not showing textures. It seems the object.cs is not loaded correctly or something.

    http://i.imgur.com/C1c8ig1.png


    Is there any way to fix that? Or should I just add dinamically the GuiObjectView -with script and not save it in playGui.gui-?



    My other question is if there is any way to avoid that "fog" inside the GuiObjectView so it's fully transparent.


    -------------------------------------------------------------------------

    -Edit-

    The issues were fixed. Let me post them here as reference for anybody looking for this in the future.


    A) The lack of texture comes because the exec("...gui") is loaded before the material.cs of the shape.

    Two way to fix it:

    1- Manually call exec("art/shapes/...(whatever)/material.cs") before exec("playgui.gui") in the init file.

    2- (Better but slower)Save the guiObjectView without the shapes loaded and use the callback

    function GuiObjectView_name::onWake(%this)

    to load them with setmodel(...). -Note: you may want to use an if statement so it's only loaded once(when %this.shapefile $= "").-


    B) The fog it's actually a PostFX enabled in the rendering pass. You could change the PostFX or to totally disable it for the gui:

    Change in void GuiObjectView::renderWorld( const RectI& updateRect ) of the c++ code of guiObjectView.cpp


    SceneRenderState state

    (

    gClientSceneGraph,

    SPT_Diffuse,

    SceneCameraState( GFX->getViewport(), frust, MatrixF::Identity, GFX->getProjectionMatrix() ),

    renderPass,

    true

    );


    to


    SceneRenderState state

    (

    gClientSceneGraph,

    SPT_Diffuse,

    SceneCameraState( GFX->getViewport(), frust, MatrixF::Identity, GFX->getProjectionMatrix() ),

    renderPass,

    false

    );

  18. I thought of exporting the terrains as collada (there is an option of that in the world editor), then merge those 3d models with an outside program like blender, create a heightmap and finally import that heightmap to make a new bigger terrain.


    But this option has a lot of issues like how the 3d models of the terrain are so huge my old computer can't handle them to edit; or how you can't make caves or use x-y-rotated terrains because the hightmap can't handle two different heights with the same (x,y) position.

    And that's without the resolution issue or how you have to repaint everything again.

  19. I'm not able to find the option to switch between shadows in the documentation.


    Should I just disable shadows and use raycasts and a "moving decal" with that texture to simulate these?



    As side note let me post an inside engine image:

    http://i.imgur.com/LF8VWRH.png

    The projected shadow is what we have by default. Note the angle from the jumping point due to the sun angle.

    The blob shadow is right under the character so the jump landing can be targeted easily -an old school thing-.

  20. I wanted to experiment with blob shadows for a retro feel so I tried:


    In \source\lighting\basic\basicSceneObjectLightingPlugin.cpp

    After

    #include "lighting/common/projectedShadow.h"

    add

    #include "lighting/common/blobShadow.h"


    Around line 107 that used to be:

    mShadow = new ProjectedShadow( mParentObject );

    change it to:

    mShadow = new BlobShadow( mParentObject );




    But it gravely failed because the class BlobShadow has a different constructor (it has more params).



    So, how can I use the shadows defined in "lighting/common/blobShadow.h"?

    Are they just an abandoned legacy thing? I can't find documentation for them anywhere so any help is very welcome.



    Note: blob shadows are the circle shadows right under the actors independent of lightning direction as seen here

    http://i.imgur.com/V3FTq.jpg

  21. Ugh, trying to replicate the issue I've found what was wrong.

    I should have verified everything again before jumping to conclussions.

    I'm very sorry for asking something that was incorrect on my part.






    -----Please dismiss the incorrect question. Sorry.

    I'm using basic lightning for this as the computer I have available right now is so old it can't manage advanced.


    With that handicap I'm having this situation:

    Let's say I have a wall and a window in it. I have a wall material and a transparent window material.

    As the window is unpassable glass it has collision but I don't want it to cast shadow. So in the material editor I enable disable shadows for that material... but it still makes shadow even if I re-light the scene or save and reload the mission.

    I would want that for invisible walls, too.


    Am I doing something wrong, is it just a limitation of basic lightning or is it suppossed to work and something is buggy?

    Thanks for your help.

  22. I think the easiest way to tackle the aim system is with a global variable defined inside the bind of the right click with something like:

    (in the file default.bind.cs)

    $aimsystemflag=false; //This initializes the aim system. You may want to initialize it when each level is restarted, too.
    
    function aimsystem(%val)
    {
      $aimsystemflag=%val; //when you hold right click you enter 'true' and when you realease it it goes 'false'
      if(%val)
      {
         //you do other stuff of starting aiming
         //here may go the change perspective
      }
      else
      {
         //here you've ended aiming
         //do quitting aiming stuff like change perspective back to normal
      }
    }
    
    moveMap.bind( mouse, button1, aimsystem ); //change 'moveMap' with your Move map if needed
    //button1 is the right click of the mouse
    

     

    This way you know $aimsystemflag is only true when aiming.

    So inside the shot function you can use an if statement checking if that's true or false and act accordingly.



    Now, about changing the eye node... There's a method for TSShapeConstructor to change the location of the a node (like the eye node), bool TSShapeConstructor::setNodeTransform( string name, TransformF txfm, bool isWorld = false )


    But I don't know how to use it or if it can be used at run time to change a node in the player as it has a client/server thing, sorry.

    Maybe other more experienced user than me can explain its posible use.

×
×
  • Create New...