Jump to content

burgelkat

Members
  • Posts

    218
  • Joined

  • Last visited

Everything posted by burgelkat

  1. thanks for your answer. i got the first part. but at the "DoSomething" it crashs to desktop without error
  2. Hallo, i hope someone can explain this to me. i build a vwep praefab (like autogun) this script function and the bucket is show in the Start function i have this code. if i take the bucket, the child is now hidden. function Script:Start() local child = self.entity:FindChild("WaterforBucket") child:Hide() the problem now is, if i would show it again, i got an error. this is the code for showing the child function Script:becomewater()--in self.becomewater=true local child = self.entity:FindChild("WaterforBucket") if child:Hidden() then child:Show() end end the child is now nil. (Script Error attempt to index local "child" (a nil value) why now the child is not found? can someone explain and how i can fix it?
  3. thanks for the replay .. i think i should explain a little better. this ist the working script, but only with one button function Script:Start() self.close=false self.conservation2=false end -----------------------Conservation-------------------------- function Script:StartConservation()--in System:Print("Conservation") self:Conservation1() end function Script:Conservation1() Talkingpanel=gui System:Print("TextShow") local Talkingpanel={} local scale = 1 --GUI local gui = GUI:Create(context) Talkingpanel.gui=gui Talkingpanel.context = context Talkingpanel = Widget:Panel(gui:GetBase():GetClientSize().x/2+150,gui:GetBase():GetClientSize().y/2-300,500,600,gui:GetBase()) Talkingpanel:SetAlignment(0,0,0,0) Talkingpanel.Talkingpanel=Talkingpanel Talkingpanel=Talkingpanel local widget widget = Widget:Tabber(indent,indent,Talkingpanel:GetClientSize().x-indent*2,Talkingpanel:GetClientSize().y-indent*2,Talkingpanel) widget:AddItem("Old Man",true) x=30 y=60 Talkingpanel:SetObject("backgroundcolor",Vec4(0.15,0.15,0.15,1)) Talkingpanel.tabber = widget local indent = 12 Talkingpanel = Widget:Panel(indent,indent,widget:GetClientSize().x-indent*2,widget:GetClientSize().y-indent*2-30,widget) Talkingpanel = Widget:TextArea(x,y,Talkingpanel:GetClientSize().x-indent*2-50,Talkingpanel:GetClientSize().y-indent*2-300,Talkingpanel) --------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------Dialog 1----------------------------------------------------------------------------- Talkingpanel:SetText("Mhm? What do you want from me?") Talkingpanel:SetBool("border",true) Talkingpanel.panel={} Talkingpanel.panel.general=panel --Talkingpanel.btnClose = Widget:Button("Close",widget:GetClientSize().x-72-indent,widget:GetClientSize().y-28-5,72,28,widget) --Talkingpanel.btnClose:SetStyle(BUTTON_CANCEL) ------------------------------------------------------------------------------------------------------------------ local y=20 local sep=40 while true do Time:Update() window:ShowMouse() if window:Closed() then return end --if window:KeyHit(Key.Escape) then return end ---------------------------------------------------------------------------------------------- while EventQueue:Peek() do local event = EventQueue:Wait() if event.id == Event.WidgetAction then System:Print("Conservation2") self.conservation2=true return end end context:Sync() end end so with one button its no problem. i really try now to understand how it function with more then one button . becaus this event is for all buttons in the script. so i search some posts and look into menu.lua to understand. but if i try to do the same, the button have no reacton this is the code ( i cleaned it a little) function Script:Start() self.close=false self.conservation2=false end -----------------------Conservation-------------------------- function Script:StartConservation()--in self:Conservation1() System:Print("Conservation") --self.component:CallOutputs("Conservation") end function Script:Conservation1() local Talkingpanel={} local scale = 1 --GUI local gui = GUI:Create(context) --Talkingpanel.context = context Talkingpanel = Widget:Panel(gui:GetBase():GetClientSize().x/2+150,gui:GetBase():GetClientSize().y/2-300,500,600,gui:GetBase()) Talkingpanel:SetAlignment(0,0,0,0) Talkingpanel.Talkingpanel=Talkingpanel Talkingpanel=Talkingpanel local widget widget = Widget:Tabber(indent,indent,Talkingpanel:GetClientSize().x-indent*2,Talkingpanel:GetClientSize().y-indent*2,Talkingpanel) widget:AddItem("Old Man",true) x=30 y=60 Talkingpanel:SetObject("backgroundcolor",Vec4(0.15,0.15,0.15,1)) Talkingpanel.tabber = widget local indent = 12 Talkingpanel = Widget:Panel(indent,indent,widget:GetClientSize().x-indent*2,widget:GetClientSize().y-indent*2-30,widget) Talkingpanel = Widget:TextArea(x,y,Talkingpanel:GetClientSize().x-indent*2-50,Talkingpanel:GetClientSize().y-indent*2-300,Talkingpanel) --------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------Dialog 1----------------------------------------------------------------------------- Talkingpanel:SetText("Mhm? What do you want from me?") Talkingpanel:SetBool("border",true) Talkingpanel.panel={} Talkingpanel.panel.general=panel Talkingpanel.btnClose = Widget:Button("Close",widget:GetClientSize().x-72-indent,widget:GetClientSize().y-28-5,72,28,widget) Talkingpanel.btnClose:SetStyle(BUTTON_CANCEL) ------------------------------------------------------------------------------------------------------------------ Talkingpanel.btnConservation1 = Widget:Button("Who am i?",widget:GetClientSize().x-450-indent,widget:GetClientSize().y-250,72,28,widget) Talkingpanel.btnConservation1:SetStyle(BUTTON_CANCEL) ------------------------------------------------------------------------------------------------------------------ local y=20 local sep=40 ----------------------------------------------------------------------------------------------------- while true do Time:Update() window:ShowMouse() if window:Closed() then return end ----------------------------------------------------------------------------------------------------- function Talkingpanel:ProcessEvent(event) if event.id == Event.WidgetAction then if self.event.source == self.btnClose then self:ProcessEvent(Event(Event.WidgetAction,self.btnClose)) System:Print("WidgetAction") self.component:CallOutputs("LostAttention") Talkingpanel.btnClose:Hide() window:FlushMouse() window:FlushKeys() window:HideMouse() window:SetMousePosition(window:GetWidth()/2,window:GetHeight()/2) gui:Hide() widget:Hide() end end end function Talkingpanel:Update() if self.btnClose:GetText()=="Close" then self:ProcessEvent(Event(Event.WidgetAction,self.btnClose)) end while EventQueue:Peek() do self.event = EventQueue:Wait() if self:ProcessEvent(event)==false then return false end end return true end context:Sync() end end the Widget show up with buttons but if i click on the button. nothing happens. I cleand this code to only one Event becaus if the Event Close function, i think i understand and the other buttons will function too. i hope really someone understand me and can help me here
  4. Hallo, I am experimenting with widgets. I don't know what I'm doing wrong here. A single button as described in the documentation works very well. But if I want to use more buttons, it doesn't respond. What am I doing wrong? i hope someone can help function Script:Start() self.close=false self.conservation2=false end -----------------------Conservation-------------------------- function Script:StartConservation()--in System:Print("Conservation") self.component:CallOutputs("Conservation") end function Script:Conservation1()--in local gamemenu={} gameMenu=gui System:Print("TextShow") local Talkingpanel={} local scale = 1 --GUI local gui = GUI:Create(context) -----------------------no need for this ------------------ --gui:Show() --gui:SetScale(scale) --gui:GetBase():SetScript("Scripts/GUI/Panel.lua") --gui:GetBase():SetObject("backgroundcolor",Vec4(0.2,0.2,0.2,1)) ------------------------------------------------------------ Talkingpanel.gui=gui Talkingpanel.context = context Talkingpanel = Widget:Panel(gui:GetBase():GetClientSize().x/2+150,gui:GetBase():GetClientSize().y/2-300,500,600,gui:GetBase()) Talkingpanel:SetAlignment(0,0,0,0) Talkingpanel.Talkingpanel=Talkingpanel Talkingpanel=Talkingpanel local widget widget = Widget:Tabber(indent,indent,Talkingpanel:GetClientSize().x-indent*2,Talkingpanel:GetClientSize().y-indent*2,Talkingpanel) widget:AddItem("Old Man",true) x=30 y=60 --Talkingpanel = Widget:TextArea(indent,indent,400,150,Talkingpanel) --Talkingpanel = Widget:TextArea(x,y,Talkingpanel:GetClientSize().x-indent*2-50,Talkingpanel:GetClientSize().y-indent*2-300,Talkingpanel) --Talkingpanel:SetText("Mhm? What do you want from me?") Talkingpanel:SetObject("backgroundcolor",Vec4(0.15,0.15,0.15,1)) Talkingpanel.tabber = widget local indent = 12 Talkingpanel = Widget:Panel(indent,indent,widget:GetClientSize().x-indent*2,widget:GetClientSize().y-indent*2-30,widget) Talkingpanel = Widget:TextArea(x,y,Talkingpanel:GetClientSize().x-indent*2-50,Talkingpanel:GetClientSize().y-indent*2-300,Talkingpanel) --------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------Dialog 1----------------------------------------------------------------------------- Talkingpanel:SetText("Mhm? What do you want from me?") Talkingpanel:SetBool("border",true) Talkingpanel.panel={} Talkingpanel.panel.general=panel Talkingpanel.closeoptions = Widget:Button("Close",widget:GetClientSize().x-72-indent,widget:GetClientSize().y-28-5,72,28,widget) Talkingpanel.closeoptions:SetStyle(BUTTON_CANCEL) ------------------------------------------------------------------------------------------------------------------ Talkingpanel.Conservation1 = Widget:Button("Who am i?",widget:GetClientSize().x-450-indent,widget:GetClientSize().y-250,72,28,widget) Talkingpanel.Conservation1:SetStyle(BUTTON_CANCEL) ------------------------------------------------------------------------------------------------------------------ local y=20 local sep=40 ----------------------------------------------------------------------------------------------------- while true do Time:Update() window:ShowMouse() if window:Closed() then return end --if window:KeyHit(Key.Escape) then return end ---------------------------------------------------------------------------------------------- function Talkingpanel:ProcessEvent(event) if event.id == Event.WidgetAction then if event.source == self.closeoptions then System:Print("WidgetAction") self.component:CallOutputs("Close") Talkingpanel.button:Hide() window:FlushMouse() window:FlushKeys() window:HideMouse() window:SetMousePosition(window:GetWidth()/2,window:GetHeight()/2) gui:Hide() widget:Hide() end end end function Talkingpanel:Update() if self.closeptions:GetText()=="Close" then self:ProcessEvent(Event(Event.WidgetAction,self.closeoptions)) end while EventQueue:Peek() do local event = EventQueue:Wait() if self:ProcessEvent(event)==false then return false end end return true end context:Sync() end end
  5. Hi , Top down shooting Game I tried to create during the summer holidays. I wanted to introduce it to the next event, something like "Halloweeen Event" by Josh. At least my Light version. I called the project "Blue Max". Maybe someone still remembers the old game on the Atari 2600. A screenshot I had set on Discord. Light version because my programming skills are very limited and I am still learning and trying hard so there are still bugs in it . You could also "pimp it up". It based on Joshs Game "Astroid" Other wise, I had the days also thought something like "International Karate" but with new Game Engine
  6. if i remeber correct this was c++ if it is possible and someone translate it in lua (i am to bad) this was also a nice effect
  7. it looks like I'm very creative today. Yeah, I have a welder. mhm .. ok .. and what now?
  8. no not yet. But I think if you invest more time, you get a nice explosion. My explosion was only a quick version. I have to spend more time in this. maybe later
  9. https://vfx.productioncrate.com/explosion-vfx-categories.html#_ga=2.63300844.238680612.1515842131-1939002152.1515230501 try this webside.. than make a sprite sheet with the explosion
  10. yes thats the way it is so much fun to create spritesheets for this .. I do not know about you, but I play games now with completely different eyes. "oh, I could try that in leadwerks too .."
  11. burgelkat

    Bird Effect

    Hi, Here is an effect to bring more life into the landscape. I used a sprite sheet with an emitter ..
×
×
  • Create New...