Jump to content

flysouth

Members
  • Posts

    105
  • Joined

  • Last visited

Posts posted by flysouth

  1. Thanks for the example but....

    If I change schedule(250,LocalClientConnection.player,"hello") to schedule(250,0,"hello") it still works. This seems to indicate that for the stand alone function it does not care about that object. From this I take it that the object was intended for use when the function was a method of an object such as in the example at the link provided above???

  2. For it to work in the first way (plain schedule without player) it should be defined as

    function scheduledLook() { ... }

    as a global function.

    Why? The first method passes %this to the scheduling code. Surely the intention of the second parameter is to pas the object to the scheduling code so that it can call the method? If this is not the case then why do we pass that object?

    If you look at the link provided, I used it the same way they did in their example.

  3. Thanks for the reply. I have now run into a problem with setting the schedule. I can get it all working if I put the schedule in command.cs but I think it must be assigned to the player. So in PlayerData::onAdd I call my schedule function for the first time. But when I re-call the schedule from within the function it gives a message of scheduledLook: Unknown command. This error is coming from line 6 below....

    This is the function:

    function Player::scheduledLook(%this)
    {
    	echo("schedule called");
    	CommandToServer('ActionLook');
    	cancel($ActShedId);
    	$ActShedId = schedule(250,%this, "scheduledLook");
    }

     

    okay I have got it to work by changing the function to this:

     

    function Player::scheduledLook(%this)
    {
    	echo("schedule called");
    	CommandToServer('ActionLook');
    	cancel($ActShedId);
    	$ActShedId = %this.schedule(250, "scheduledLook");
    }

     

    According to my understanding of the wiki they should both work....

    http://wiki.torque3d.org/scripter:schedules-and-timers

  4. Hi


    I want to detect if the player gets near to an object that they can interact with, I have done some keyboard driven tests using

    %result = %control.getLookAtPoint(%range,$TypeMasks::StaticShapeObjectType);
    %obj = getWord( %result, 0);
    %Message = "Looking at: " @ %obj.getName();
    commandToClient(%client, 'ActionMessage', %Message);
    

    and it works fine.

    I now want to set a schedule to do this every 250ms for each player.

    I see how the scheduling is done but if I wanted this to happen for all players on a multiplayer system, what would the best way be to set up the schedules?

    Would this also work for single player games with client and server on same machine?

  5. I did a simple test with a cube. Let it stick about 30cm out of ground. Cube has a collision cube the same size. Next to it I made another identical one with sketch tool and player can step onto that one but not onto cube.

  6. I have a flight of stairs but the player is unable to walk up the steps. He can only jump up the steps which is not what I want. I have tried changing maxStepHeight but it only seems to affect the players ability to step onto things that are created with the sketch tool. Is this how it is supposed to work or is is this a bug?

  7. @Bloodknight

    Also, I feel I should add, that for a decade or so now I have been the community leader as far as grumpy sarcastic is concerned, and feel you are cruising a little close to my turf, also I should warn you that this is a poor way of getting answers, trust me, I'm an expert.

    That is most likely true. It is just that almost everything that I want to do with T3D has amounted to ..you need to change the c++ code for that.

    So I have just become a little frustrated. :cry:


    The rock does have a name and when the vehicle hits it the onImpact is called. In my onimpact function I have the following statements to see which works:

     

    function VehicleData::onImpact(%this, %obj, %col, %vec, %speed)
    {
     echo("This = ",%this.getName());
     echo("Obj = ",%obj.getName());
     echo("Col = ",%col.getName());
      echo("Col Type = ",%col.getType());
     echo("Vec = ",%vec);
      echo("Speed = ",%speed);
    	echo("Class =" ,%col.class);
    	echo("ClassName =" ,%col.getClassName());		
    	echo("TargetName =",%col.GetTargetName(0));
    
    }

     

    and the result is:


    This = CheetahCar

    Obj = Cheeta1

    scripts/server/vehicle.cs (151): Unable to find object: '0' attempting to call function 'getName'

    Col =

    scripts/server/vehicle.cs (152): Unable to find object: '0' attempting to call function 'getType'

    Col Type =

    Vec = -13.4593 -32.5138 2.24118

    Speed = 35.2608

    Class =

    scripts/server/vehicle.cs (156): Unable to find object: '0' attempting to call function 'getClassName'

    ClassName =

    scripts/server/vehicle.cs (157): Unable to find object: '0' attempting to call function 'getTargetName'

    TargetName =


    The problem is that when you hit a rock %col is just 0 so this information is not available. So some things that should work in theory, dont.

  8. Hi

    I have just tried the turret mounted to a vehicle again. As per a previous post by @JeffR in 3.9 the turret does stay in sync with the vehicle. I still have one majot problem. I have not figured out how to make it move. The setTurretEulerRotation code seems to be broken. If you set it then get it, you get strange values returned and the turret does not move. Is this something that should be logged as a bug? or am I perhpas just doing something wrong?

  9. I'm just gonna chime in here and say that when the engine was written people were happy just to have decals working - most didn't bother doing anything besides let the decals fade (like T3D does). Old code is old, bro.

    Yes floppy disk were also great back then, but things have changed :lol:

  10. Okay after looking in the code I see this is yet another thing that needs C++ code changes to achieve. :cry:

    Only TSStatic apears to have a decalType property that allows the decals to be turned off.

    The decal system itself is pretty lame. It does not make public any method of finding decals without an ID. The Decalmanager C++ code does contain a getClosestDecal function but it cannot be used by TS.

    The more I try to use T3D the more I realize that in its current form even the most basic things require code changes :roll:

    I am sure glad I did not have to pay for it or by now I would be pretty p'd @ff

  11. I shoot a bullet with a directDamage = 5 at glass with a destroyedLevel = 2. The glass breaks but if there is another piece of glass behind this one, nothing happens. Surely even without using a physics engine directDamage should equal directDamage - destroyedLevel. Then when it hits the second piece of glass it will have a directDamage of 3 so that glass will also break. The 3rd piece of glass will not as it will only recieve damage of 1.

    Or is there some other way that this works?

  12. When driving a vehicle if I crash into a rock or tree I would like to know what I collided with. It would also be good if I could affect the object I hit. Trees and rocks are TSStatic.

    In vehicle.cs I used onCollision and onImpact, in these functions have tried using %col.getClassName(), %col.getType(), %col.GetName(), %col.GetTargetName(0), %col.GetInternalName() etc. but nothing works.

    The script document indicates that most of these should be valid for a TSStatic but some of them give an error when calling them.

    So how do I get this information?

  13. Thanks for the suggestion. Unfortunatly it seems to suggest that I would know the name of the decal. It was put there by a bullet not by my script. Is there a way to search for it?

    Do decals become a 'child' of the surface they are on?

  14. I made some windows that when shot break. The problem is that the default bullet decals stay floating in the air even though the window has been destroyed. Is there a way to prevent the decals from being placed on a specific object? Or perhaps being removed somehow?

  15. Figured toss you something that *didn't* touch the c side for a change there
    Thanks for that lol. I dont have a problem with C programming, although my abilities are mostly around embedded mcu's and C++ not so much. I just would prefer not to have to mod the engine because then it requires that one needs to manage those mods each time an upgrade happens
×
×
  • Create New...