Jump to content

Birdman

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by Birdman

  1. Im using DrawImage to draw a Texture into the screen, in which surface format i have to make the DDS so it shows with transparency? This is the code: TTexture img= LoadTexture("abstract::image.dds"); DrawImage(img,40,50,-1,-1); The result is a white box of the image size (without transparency) and with a circle i drawed inside. Is there a command i'm missing to load the texture with transparent background? Thanks a lot in advance.
  2. Hello Soamp, i'm investigating this too, i wasn't able to package the scripts folder. I have a Data folder with all the models, maps, etc and this works like a charm. I'm unsure if you can do this without a modification. This is why i prefer to code most of the important things in c++. EDIT: What you can do in the worst case is put scripts in the data folder, for an instance i have a specific script inside the model folder, so basically what i have in the scripts folder is all generic Leadwerks stuff.
  3. I had the 4 LUA lines commented, now i got it workiong, since most scripts were working i didn't cared to check that until now. Thanks for your response guys. Edit:This lines were giving me problems with physics in general, vehicle related mostly, there was a script that was messing up my c++ code, thats why i had this lines commented, now i at least found the real problem, and got all working.
  4. The scripts are loading OK, even the Atmosphere object of the Scene is loading, i can check that in the log, i already have that lines of code to setup script, most scripts do their work, except for the skybox. I will check setting the background but im a bit lost on what im missing to be honest.
  5. I have a sbx which haves a skybox that works on the editor, on my c++ code the sky is totally black. I checked the log and the enviroment object is loading OK. Also i tried this: It results on the Shader of objects reflecting the Sky, but the sky i still black. Im using: Maybe im missing something to initalize the enviroment on the Framework. Any idea?
  6. I think if: then Gotta check this code later.
  7. Thanks for the responses guys, i got it working. I just checked there was a sample in the viper vehicle lua. object.model:SetKey("collisiontype",COLLISION_PROP) object.model:SetKey("mass",1.0) C++ Code:
  8. How do you store an Entity Key in lua?
  9. Is there a way to create a variable or property in a class in LUA and access it from C++? For an instance there switch.lua have a Reset time property created in the Property Dialog, and then in the main function you have a resettime variable. How would i access this property/variable from c++? Thanks a lot in advance.
  10. Any idea on how to generate a simple Traffic Light, with Green, Yellow and Red timed via scripts? I was trying to figure out how to do this using the switch model .frag and .lua.
  11. Yes you are right, this works too: GetBodyVelocity(chassis,0)
  12. Thanks for your Repply, i don't know where to get the velocity Vector, do you have an idea on how will this be? I Tried doing something like this but it crashes inside GetBodyVelocity, either using the Chassis object or the vehicle object. appliedvelocity = (0.2 * GetBodyVelocity(veh,1).Z)*(-1); Finally CalcBodyVelocity worked with this, idk why GetBodyVelocity Crashes. Edit: Btw checking the vehicle script i found this code that is used for the decals: speed = math.abs(self.model:GetVelocity(0).z) speed = (speed - 4) / 120.0 speed = Clamp( speed, 0, 1 ) * 0.05 I will try to convert this to C++ to use to calculate speed.
  13. If i use that code my project will close without giving an error. Release or Debug the same.
  14. Why this code won't hide my entity? TModel test=LoadModel("abstract::model.gmf"); .... pivot=FindChild(test,"block"); if (pivot) { HideEntity(pivot); } else { MessageBoxA(0,"block not found.","Error",0); } All names are OK since pivot is being found OK. Any idea? Edit: Block is a mesh inside the model, and i have no way to scale it or hide it. Tried both.
  15. Hello, Since i can't use Joystick for a Driving LUA demo, i made a c++ code that have a running vehicle based on few posts i saw and a rewrite of the original LUA i had. Im applying Torque to the vehicle this way: TVehicle veh=CreateVehicle(chassis); ..... TMesh tire[4]; ..... // Torque AddTireTorque(veh, 0, -1); if (KeyDown(KEY_UP)) { if (!TireIsAirborne(tire[0])) AddTireTorque(veh, -24, 0); if (!TireIsAirborne(tire[1])) AddTireTorque(veh, -24, 1); } if (KeyDown(KEY_DOWN)) { if (!TireIsAirborne(tire[0])) AddTireTorque(veh, +24, 0); if (!TireIsAirborne(tire[1])) AddTireTorque(veh, +24, 1); } I can't seem to find a way to check Tire actual torque to be able apply negative Torque until vehicle is stopped. I'm applying torque only to wheels 0 and 1 becouse i want a front-wheel drive vehicle. My idea was to make something like this (Anyway applying 0 torque will do nothing, but if apply negative it will go backwards after stopped): // BRAKE if (KeyDown(KEY_SPACE)) { if (!TireIsAirborne(tire[0])) AddTireTorque(veh, 0, 0); if (!TireIsAirborne(tire[1])) AddTireTorque(veh, 0, 1); } Also Is there a way to calculate some kind of speed with raycastvehicle? Anybody implemented some kind of Engine to do gears and stuff? Thanks a lot in advance
  16. Yeah i think ZioRed answered this, anyway, i have a working LUA for a driving example code, and i have an exe that have joystick implemented, and i cant put em together to work. Is something simple, but working with leadwerks seems to be far from simple. What i need is an engine.exe with joystick implemented, my other option is what im finishing now, recoding all my LUA script in c++ becouse im not getting support.
  17. Mmm.. What about commented functions like LoadScript, RunScript, etc? I have Setup LUA OK, but idk how to run a script in my code TFramework fw = CreateFramework(); SetGlobalObject("fw",fw); BP lua = GetLuaState(); lua_pushobject(lua,fw); lua_setglobal(lua,"fw"); lua_pop(lua,1);
  18. Does anybody remeber how to do this?
  19. I asked this before, but all my posts are deleted!!!! What were the lines to initialize lua scripts objects from c++, and to run for an instance FPSController.lua. Thanks a lot in advance.
×
×
  • Create New...