Jump to content

mihaid

Members
  • Posts

    47
  • Joined

  • Last visited

Recent Profile Visitors

3,051 profile views

mihaid's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

3

Reputation

  1. I tried several times to make the respawn missile, NOT WORKING......here is the script: --import "Scripts/Functions/ReleaseTableObjects.lua" Script.respawnPoint = "" -- entity "Respawn Point" Script.soundfile1=""--path "Sound 1" "Wac file (*.wav):wav|Sound" Script.soundfile2=""--path "Sound 2" "Wac file (*.wav):wav|Sound" Script.soundfile3=""--path "Sound 3" "Wac file (*.wav):wav|Sound" Script.soundfile4=""--path "Sound 4" "Wac file (*.wav):wav|Sound" Script.threshhold=2--float "Threshhold" Script.maxfrequency=300--minimum delay between sound plays Script.range=200--float "Range" respawnPoint = nil Script.pivotobuz = nil --smoke = LoadMaterial("Materials/smoke.mat") Script.window = Window:GetCurrent() --Script.move = 0 --Script.entity = Vec3(0,0,0) obuzforce = 250 ImpactNoiseLastSoundTime=0-- This will be shared among all instances of this script and ensure we don't play too many sounds function Script:Start() --particle1 = Emitter:Create(30) --particle1:Paint(smoke) --particle1:SetRadius(0.5,0.5) self.sound={} for n=1,4 do local filepath = self["soundfile"..tostring(n)] if filepath~="" then local noise = Sound:Load(filepath) if noise~=nil then table.insert(self.sound,noise) --self.sound[#self.sound+1]=noise end end end end function Script:Collision(entity, position, normal, speed) if speed>self.threshhold then if #self.sound>0 then local collisiontype = entity:GetCollisionType() if collisiontype==Collision.Prop or collisiontype==Collision.Scene then local t = Time:GetCurrent() if t-ImpactNoiseLastSoundTime>self.maxfrequency then ImpactNoiseLastSoundTime=t local n=math.random(#self.sound) local noise = self.sound[n] self.entity:EmitSound(noise,self.range) --particle1:Play() --self.entity:SetPosition() end end end --self.entity:Release() -- create a missile and set location --Vec3 = GetPosition(pivotobuz, false) --local obuz = Prefab:Load("Prefabs/obuz.pfb") --obuz.script:Start() --obuz:SetPosition(pivotobuz:GetPosition(false)) --obuz.script:Enable() if (entity:GetKeyValue("name") == "obuz") then spawnPos = self.respawnPoint:GetPosition() entity:SetPosition (spawnPos) end self.entity:SetMass(0) end --spawnPoint = self.respawnPoint:GetPosition() -- self.entity:SetPosition (spawnPoint, false) -- self.entity:SetMass(0) --self.entity:SetParent(self.entity.respawnPoint) end function Script:UpdatePhysics() if (self.window:KeyDown(Key.Insert)) then obuzforce = obuzforce + 0.5 end if (self.window:KeyDown(Key.Delete)) then obuzforce = obuzforce - 0.5 end self.move = Vec3(0,0,0) if (self.window:KeyDown(Key.B)) then self.entity:SetMass(1) self.entity:SetParent(nil) self.entity:AddForce(0,0,obuzforce, false) end end function Script:PostRender(context) context:SetBlendMode(Blend.Alpha) context:SetBlendMode(1) context:SetColor(10,66,110,1) context:DrawText("Power:", 10,840) context:DrawText(obuzforce, 110, 840) end So.........i have the physics ..trigger for missile (obuz in my script).....i created a pivot, as respawn point.....anybody can help where is my mistake???
  2. Hello, i need some help with the next issue: I have a flying machine, helycopter, and i want to launch a missile(obuz in my script), with physics to hit terrain. All working fine, but i cant figure this things: I want to respawn the missile(obuz) back on helycopter I want to make a big explosion hitting terrain. Emiter should be child of missile ???How to do that in collosion function and where?? I created a pivot child to helycopter, also the missile, created in Leadwerks, as child of pivot, not sure what kind of physics collision to set, prop, trigger,... I made a script combined from few others, such us respawnpoint, deadtrigger, collision function, but ....no more ideas....anybody can help??? here is the script, attached to my missile: Script.respawnPoint = "" -- entity "Respawn Point" Script.soundfile1=""--path "Sound 1" "Wac file (*.wav):wav|Sound" Script.soundfile2=""--path "Sound 2" "Wac file (*.wav):wav|Sound" Script.soundfile3=""--path "Sound 3" "Wac file (*.wav):wav|Sound" Script.soundfile4=""--path "Sound 4" "Wac file (*.wav):wav|Sound" Script.threshhold=2--float "Threshhold" Script.maxfrequency=300--minimum delay between sound plays Script.range=200--float "Range" Script.window = Window:GetCurrent() ImpactNoiseLastSoundTime=0-- This will be shared among all instances of this script and ensure we don't play too many sounds function Script:Start() self.sound={} for n=1,4 do local filepath = self["soundfile"..tostring(n)] if filepath~="" then local noise = Sound:Load(filepath) if noise~=nil then table.insert(self.sound,noise) --self.sound[#self.sound+1]=noise end end end end function Script:Collision(entity, position, normal, speed) if speed>self.threshhold then if #self.sound>0 then local collisiontype = entity:GetCollisionType() if collisiontype==Collision.Prop or collisiontype==Collision.Scene then local t = Time:GetCurrent() if t-ImpactNoiseLastSoundTime>self.maxfrequency then ImpactNoiseLastSoundTime=t local n=math.random(#self.sound) local noise = self.sound[n] self.entity:EmitSound(noise,self.range) --if (entity:GetKeyValue("name") == "obuz") then -- spawnPos = self.respawnPoint:GetPosition() -- entity:SetPosition (spawnPos) --end end end end end end function Script:UpdatePhysics() self.move = Vec3(0,0,0) if (self.window:KeyDown(Key.B)) then self.entity:SetMass(1) self.entity:SetParent(nil) self.entity:AddForce(0,0,200, false) end end
  3. Thanks a lot !!...ammo box WORKING !!
  4. Hi, i need an advice...: I want to use fps weapons pack..shoot in a barrel and explode: question: which is the entity for collider and how to use..??? or if not ..what to do??? Second question: fps ammo box???? Seen something on web.....but nothing to download....attach...WHAT CAN I DO????
  5. So...i had an older topic when i told about my crosshair and use tex..dissapeared....when i play game. It seems was becose i added the function postRender in fpsplayer script, to display on screen some text and variables used in the script, for instance health. When i deleted the function, my crosshair and use.text appeared back....My question is...what to do to display on screen the variables I use on fps player script????
  6. I made a small video, and you can see on my FB page, with my helicopter flying ...https://www.facebook.com/MD-Gamesoft-570963552973921/
  7. SOLVED, i reinstalled Leadwerks and now working perfect !!!
  8. I have leadwerks 4.4, also installed the mercenary characters. If i have a gun......try to shoot...crosshair missing. Also if i wanna pickup an object, whatever...the use sign it's missing, even if i can take the object.....any ideas??? Its from v4.4???? I didnt changed nothing to fps player script...
  9. OK !! Thanx a lot, i will try fast what you suggested...need to go now..and about position of helicopter, was created backside...i need to rotate in blender or something else.....if was normal...my helicopter was moving back..not front..that's why i inversed...thanx anyway
  10. I tried PhysicsSetPosition instead Move, and PhysicsSetRotation instead of SetRotation....in UpdatePhysics loop.....start game..no errors..bu no movement !! probably forgot something.....i just changed commands...and nothing inside brackets.... Tried again..NOTHING MOVE
  11. OK, i have a helicopter made by me...i have a script which i need to improve, script attached by helicopter. problem is: at rotation, helicopter freezing for 1-2 seconds, after that working aprox well, when i want to change direction, freezing again sometime...please give me some suggestions what to change to make rotation smooth, not freezing. I know about add Torque, try to implement...dont want to move....etc here is my script attached, Please help !!! bodyhel.lua
  12. thanks.....i had a virus and now its ok !!!
  13. Hello, i donno if its a bug, but this is my situation: I was working to my game, ....by the way i have last version of Leadwerks, i mean 4.3, not beta. I closed LE...and when i opened again.....i had several problems, and i wilL say only one: if i want to rotate my view with mouse, left, right, up or down.....nothing change !!!. If i launch the game to test, work perfect !!!!. I deleted Ledwerls, reinstalled.... IT'S WORKING ONLY MY MOUSE WHEEL.....ZOOMING......for the rest.....NOTHING !!! WHAT TO DO ???
×
×
  • Create New...