Jump to content

flysouth

Members
  • Posts

    105
  • Joined

  • Last visited

Everything posted by flysouth

  1. To my noob understanding of TS, in this case %this holds the reference to player in both examples.... or perhaps I am missing something here?
  2. 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???
  3. 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.
  4. 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
  5. 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?
  6. Thank you. I never noticed that there before. Works like a charm :)
  7. 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.
  8. 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?
  9. @Azaezel are you saying the decalType is already in shapebase? if so how do you access it?
  10. @Bloodknight 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.
  11. 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?
  12. Yes floppy disk were also great back then, but things have changed :lol:
  13. Thanks for this speedy fix, although I think that it would also be good if ShapeBase also had a decalType like TSStatic so that one could decide a decal type if any. Then if it was set to "none" a decal wou;d never be placed on it. Do fixes like this automatically get put in to future engine releases?
  14. Anybody know how to do this... or is it the standard answer... you need to change the C++ code?
  15. 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
  16. Maybe a stupid question but... this is a scripted object and the option is not available in the scene editor. I have tried setting it in the datablock but does nothing
  17. 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?
  18. 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?
  19. Thank you that is just what I want :)
  20. @Duion How do you deactivate decals for objects that can be destroyed?
  21. 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?
  22. 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?
  23. 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
  24. Where can I find documentation that shows smartPlayThread() ? ie Where are the latest docs?
×
×
  • Create New...