Jump to content

Sir_Skurpsalot

Members
  • Posts

    60
  • Joined

  • Last visited

Posts posted by Sir_Skurpsalot

  1. Question for you, Sir_Skurpsalot,


    Did you do the echo part of the tutorials on this page?


    I'm typing in the code as written, into the console, but am not getting the intended result.


    The code is just:

    echo("Hello World", 3);


    The result should be:

    Hello World3


    Instead, I get:

    33


    Not sure what's going on there.


    The first code I've ever typed for T3D, and already having issues. Yikes :lol:

     

    Never did that one. Didn't realize echo is supposed to take a second argument until just now... might have to find it in the source code to see how the second argument really works, tutorial must be outdated.

    To get Hello World3 in a similar fashion I would type

    echo("Hello World"@3);

    @ concates strings

     

    I "hacked" it by doing echo("Hello World", "3"); :p


    It worked, but I don't think I've actually solved anything. :lol:

     

    Seems putting a number directly into echo() makes it print twice unless you pre-convert it to a string with "" or another string operator.... weird. I've used echo to print tons of numbers from variables and never ran into this though.

  2. Question for you, Sir_Skurpsalot,


    Did you do the echo part of the tutorials on this page?


    I'm typing in the code as written, into the console, but am not getting the intended result.


    The code is just:

    echo("Hello World", 3);


    The result should be:

    Hello World3


    Instead, I get:

    33


    Not sure what's going on there.


    The first code I've ever typed for T3D, and already having issues. Yikes :lol:

     

    Never did that one. Didn't realize echo is supposed to take a second argument until just now... might have to find it in the source code to see how the second argument really works, tutorial must be outdated.

    To get Hello World3 in a similar fashion I would type

    echo("Hello World"@3);

    @ concates strings

  3. Putting the finishing touches on a tree model and am following the wind effects tutorial from the art primer.

    I have been applying one vertex color at a time and then testing and red and green values work as they are supposed to, but upon adding blue values to my vertex colors to get the leaf flutter effect it causes the faces the vertex is connected to to separate.... anything I could try? I have made sure in blender that there are not duplicate vertices.

  4. How to successfully get a terrain heightmap from GIMP 2.10.20 into Torque? I keep getting the error "Heightmap failed to load!" when I try.

    Size 1024 x 1024, mode is set to grayscale, precision is set to 16 bit integer / linear light, tried in png and bmp format. I am not attempting to load

    any texture maps yet along with the heightmap. What am I missing here?

  5. Been messing with these a lot today and the AI does not seem to be able to choose the correct one based on the direction of the threat... even though the source code shows

    that the angle is what they are scored by first. Also, do the peek left / right/ over properties actually effect anything?

  6. If I try to tell my bot to just move directly to a location he just runs into a mountain and does not navigate.... is there something I am forgetting in order to get the bot to acknowledge the NavMesh? Because in the navigation editor if I spawn the test bot and click around at various points that one works great.

  7. Trying to learn to use navmesh and navpath, but I keep getting this error.

    "No NavMesh polygon near visit point (105.3, 88.7, 513.094) of NavPath 21142"


    There are indeed blue navmesh polygons around it according to the editor.

    This is all that is needed to create a navpath from script right?

    [code2=BBCODE40_TORQUESCRIPT

    ]%navPath1 = new NavPath()

    {

    mesh = Nav;

    from = %demoAI.getPosition();

    to = NavTest.getPosition();

    };

    %navPath1.plan();[/code2]

  8. Stopping glitches / exploits is pretty simple. I have a function called "DeniedStateCheck" that I use for many things, including reloads, to lock out certain behaviors like switching weapons in the middle of reloading for example. Basically it gets the player's weapon image state, loops through an array of state names to see if the name matches any of the denied state names, and then returns a 1 or 0. As in your example, if the player requests to change weapons and the current image state name matches "CombatReload" or "TacReload", the loop will return 0 to the changing weapon function that called it and the request will be denied. Otherwise, it returns a 1 and the request proceeds. It is a very useful function. My function currently looks like this:

     

    function deniedStateCheck(%player)
    {
    	%stateName = %player.getImageState(0);
    	%deniedState[0] = "FireBranch";
    	%deniedState[1] = "Fire";
    	%deniedState[2] = "AimFire";
    	%deniedState[3] = "CombatReload";
    	%deniedState[4] = "TacReload";
    	%deniedState[5] = "ToKneeling";
    	%deniedState[6] = "ToProne";
    	%deniedState[7] = "Activate";
    	%deniedState[8] = "Release";
    	%deniedState[9] = "Draw";
    	%deniedState[10] = "NoDraw";
     
    	for(%i = 0; %i < 11; %i++)
        {
           if (%stateName $= %deniedState[%i])
           {	
           	   echo("Denied State: " @ %stateName);
           	   return 0;
           }
        }
        return 1;
    }
  9. engine/source/t3d/player.cpp is where you will find the footprint stuff, around line 3949.


    Those are some good points you bring up about animation triggers and looping animations. I am more interested in them for one shot action animations. My application that caused me to look into this was I wanted to use an animation trigger to create an empty mag "debris" object that would be created at a certain frame in a reload animation. Since I can't do that I just scheduled a function that does that with a delay in the weapon's reload state instead, but being able to use an animation trigger would have been nice because it takes the trial and error out of getting the timing right. I could see them being useful for knife/melee attack or grenade throwing as well in, where you want something to occur midway in an animation and not right at the beginning.

  10. "there can be up to 30 independent trigger states each with their respective on (1 to 30) and off (-1 to -30) states. You decide what each of those trigger states means"

    But it seems states 1 and 2 are hard coded for footprints and you can't actually define any other states yourself. I was wanting to know if it was possible to actually define more states as the documentation says and have triggers that can do anything, not just make footprints/dust.

  11. Are animation triggers set by TSShapeConstructor not actually fully implemented contrary to this documentation https://torque-3d.readthedocs.io/en/latest/artist/playercharacter.html?highlight=trigger


    This post from 2015 seems to suggest so : https://forums.torque3d.org/viewtopic.php?f=12&t=156&p=1712&hilit=animation+trigger#p1712


    is this outdated or can you now actually define these supposedly available 30 triggers somewhere?

×
×
  • Create New...