Jump to content

burgelkat

Members
  • Posts

    218
  • Joined

  • Last visited

Everything posted by burgelkat

  1. Ok, but as i said . I deinstalled Everything. Then i installed Ultraengine again. If i use 0.97 Everything is fine. I create a new clean Projekt. if i update it to Beta Version only the Projekt Manager opens. There is the alert to update the Projekt. After that i click on the blank Projekt . The manager close. In Steam i can only start again the same procedere. Same if i create a clean Projekt in 0.98e before 0.98e it also has no Problems. And the 0.97 Version has no Problems too. sorry, it seems only i have that Problem.
  2. by the way, if i start Ultraengine (Editor.exe) from my instalations folder, there is with the latest Beta an Error "Failed to initialize Steam" if i go back to 0.97 it starts without problem
  3. sorry, dont work. I deinstalled everything and deleted all folders. then i reinstalled all new. If i start a plank projekt, the client closes with no error. Only if i install the 0.97 version everything is fine. but without the new fine updates
  4. If i go back to 0.9.7 the client opens but 3 shader failed to load. (Projekt Manager is updated )
  5. If i use the last achived version. The material is strange. I think because of the new tessilation
  6. The client only works if I use the 0.96 archive version or don’t use the beta.
  7. I updated the project every time the warning icon popped up. If I create a new project, the same issue occurs. I also uninstalled the engine and reinstalled it, even on a different hard drive.
  8. Hi josh, no i have a msi rtx 3060 driver is the latest game ready driver
  9. I’ll post the problem here since it fits the latest beta version. My client simply closes on startup without any error message (Steam version). When I start it from Steam, the Project Manager opens. However, when I click on the project, it closes without any error message. If I load the last archived version, the client does open, but there’s an error with the MDL files, saying that MDL 303 is not supported. Everything was working fine in the version before the last beta update. I’m sorry I can’t provide more information since no error occurs.
  10. i have fun with that .. now i have a flock of fishes with avoid collision and different movements. at the moment there is a flicker in pitch or in avoid collision . maybe i find a solution later or someone find a solution Flock = {} Flock.name = "Flock" function Flock:Start() world = self.entity:GetWorld() self.boxes = {} self.boxProperties = {} self.offset = self.entity:GetPosition() -- Position of the pivot used as offset -- Define Y-axis limits self.minY = self.offset.y - 2.0 -- Minimum Y limit self.maxY = self.offset.y + 0.5 -- Maximum Y limit -- Initialize random seed (per instance) math.randomseed(os.time()) InitializeBoxes(self) end -- Define constants Flock.radius = 5.0 Flock.numBoxes = 8 minDistance = 3 -- Minimum distance to avoid collision avoidanceStrength = 0.2 -- Strength of the avoidance force -- Movement pattern functions movementPatterns = {} function movementPatterns.circular(self, angle) local x = self.offset.x + self.radius * math.cos(angle) local y = self.offset.y + self.radius * math.sin(angle * 0.5) -- y-movement added local z = self.offset.z + self.radius * math.sin(angle) y = math.max(math.min(y, self.maxY), self.minY) -- Clamp Y within limits return Vec3(x, y, z) end function movementPatterns.elliptical(self, angle) local a = self.radius local b = self.radius / 2 local x = self.offset.x + a * math.cos(angle) local y = self.offset.y + b * math.sin(angle * 0.5) -- y-movement added local z = self.offset.z + b * math.sin(angle) y = math.max(math.min(y, self.maxY), self.minY) -- Clamp Y within limits return Vec3(x, y, z) end function movementPatterns.spiral(self, angle) local r = self.radius + angle * 0.5 local x = self.offset.x + r * math.cos(angle) local y = self.offset.y + r * math.sin(angle * 0.5) -- y-movement added local z = self.offset.z + r * math.sin(angle) y = math.max(math.min(y, self.maxY), self.minY) -- Clamp Y within limits return Vec3(x, y, z) end function movementPatterns.zigzag(self, angle) local amplitude = 2.0 local frequency = 2.0 local x = self.offset.x + self.radius * math.cos(angle) local y = self.offset.y + amplitude * math.sin(frequency * angle) -- y-movement adjusted local z = self.offset.z + amplitude * math.sin(frequency * angle) y = math.max(math.min(y, self.maxY), self.minY) -- Clamp Y within limits return Vec3(x, y, z) end function AlignBoxWithMovement(box, previousPosition, newPosition) local direction = (newPosition - previousPosition):Normalize() -- Calculate yaw (rotation around Y-axis) and pitch (rotation around X-axis) to face the movement direction local yaw = ATan(direction.x, direction.z) -- Yaw around Y-axis local pitch = ATan(direction.y, (direction.x^2 + direction.z^2)^0.5) -- Pitch around X-axis -- Adjust yaw for model orientation if needed yaw = yaw + 180 -- Ensure pitch and yaw are numeric types before setting rotation pitch = tonumber(pitch) or 0 yaw = tonumber(yaw) or 0 -- Set the rotation of the box (yaw and pitch ) box:SetRotation(pitch, yaw, 0) end function InitializeBoxes(self) for i = 1, self.numBoxes do local patternNames = {"circular", "elliptical", "spiral", "zigzag"} local patternName = patternNames[math.random(#patternNames)] local movementFunction = movementPatterns[patternName] local speed = math.random() * 2 + 0.5 local angle = math.random() * 2 * math.pi local position = movementFunction(self, angle) local box = LoadModel(world, "H:/UltraEngine/New Project/Models/Diverses/Fish.mdl") -- or CreateBox(world,1) box:SetPosition(position) self.boxes[i] = box self.boxProperties[box] = { movementFunction = movementFunction, speed = speed, angle = angle, patternName = patternName, lastPosition = position -- Store the initial position as last position } end end function AvoidCollisions(self, box, newPosition, otherPositions) local smoothingFactor = 0.1 -- The factor by which to smooth the Y-axis movement for _, otherBox in ipairs(self.boxes) do if box ~= otherBox then local otherPosition = otherPositions[otherBox] -- Use previous position instead of current position if otherPosition then local distance = newPosition:DistanceToPoint(otherPosition) if distance < minDistance then local avoidanceDirection = (newPosition - otherPosition):Normalize() local horizontalDistance = ((newPosition.x - otherPosition.x)^2 + (newPosition.z - otherPosition.z)^2)^0.5 if horizontalDistance < minDistance then if newPosition.y < otherPosition.y then newPosition.y = math.max(newPosition.y - smoothingFactor, self.minY) -- Smooth downward movement else newPosition.y = math.min(newPosition.y + smoothingFactor, self.maxY) -- Smooth upward movement end end newPosition = newPosition + avoidanceDirection * ((minDistance - distance) / minDistance) * avoidanceStrength newPosition.y = math.max(math.min(newPosition.y, self.maxY), self.minY) -- Clamp Y within limits end end end end return newPosition end function UpdateBoxes(self, deltaTime) local newPositions = {} for _, box in ipairs(self.boxes) do local props = self.boxProperties[box] props.angle = props.angle + props.speed * 0.003 local newPosition = props.movementFunction(self, props.angle) if newPosition then newPosition = AvoidCollisions(self, box, newPosition, newPositions) newPositions[box] = newPosition end end for _, box in ipairs(self.boxes) do local newPosition = newPositions[box] local props = self.boxProperties[box] if newPosition then AlignBoxWithMovement(box, props.lastPosition, newPosition) box:SetPosition(newPosition) props.lastPosition = newPosition end end end function Flock:Update(deltaTime) UpdateBoxes(self, deltaTime) end RegisterComponent("Flock", Flock) return Flock
  11. ok thanks .. thats my solution not yet perfect but for now ok .. the boxes will be change with a fish model
  12. new one.. but there is a problem with "otherbox" ^^ attempt to call a nil value (method "GetPosition") also math.atan2 dont works
  13. I wanted to try to recreate the script in UltraEngine.
  14. Hello, long time no see ^^ at the moment i have a littel time and i try to learn more with lua. I need help with my script. Maybe my thoughts completley wrong. I have a simple map with two boxes. One box is Main the second Box i made as a child each box has the script I'm trying to find out if the box is included in table. and how i can store it. maybe i am compleatly wrong.. maybe someone can help me FlockEntity = {name = "FlockEntity"} FlockEntity.maxforce = Vec3(0) --set to 20.005 then its hoovering (Mass = 1) FlockEntity.pointforce = Vec3(0) function FlockEntity:Start() self.tbl = {} self.entity:GetParent() self.entity:FindChild("Box*") print(index) print(self.tbl) print(name) end function FlockEntity:Update() ------ Hoover ---------------------- self.entity:AddForce(self.maxforce) ------------------------------------ -----------------Flock.lua------------------------------------------------------------------------ self.radius = 1 for i=1, #self.tbl do self.elem = self.tbl[i] if (self.elem ~= self.entity) then self.vNeighborDelta = self.elem:GetPosition() - self.entity:GetPosition() self.dist = self.vNeighborDelta:Length() if (self.dist < self.radius * 2) then self.vNeighborDelta:Normalize() self.entity:GetPhysicsMode() self.entity:AddForce(self.pointforce) end end end end RegisterComponent("Flock", FlockEntity) return FlockEntity
  15. Maybe you can build this in blender and use the result as model?
  16. function Script:Start() self.close=false self.conservation2=false end -----------------------Conservation-------------------------- function Script:StartConservation()--in System:Print("Conservation") self:ConservationPart1() end function Script:ConservationPart1() 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("Name of Person",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(" NPC Text 1 ") 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.btnClose = Widget:Button("Close",widget:GetClientSize().x-450-indent,widget:GetClientSize().y-250,100,28,widget) --Talkingpanel.btnClose:SetStyle(BUTTON_CANCEL) Talkingpanel.btnConservation2 = Widget:Button("Answer 1",widget:GetClientSize().x-450-indent,widget:GetClientSize().y-280,160,28,widget) Talkingpanel.btnConservation2:SetStyle(BUTTON_CANCEL) Talkingpanel.btnConservation3 = Widget:Button("Answer 2",widget:GetClientSize().x-450-indent,widget:GetClientSize().y-280,300,28,widget) Talkingpanel.btnConservation3:SetStyle(BUTTON_CANCEL) ----------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------------------------------------------- Talkingpanel.btnConservation3:Hide() local y=20 local sep=40 while true do world:Render() Time:Update() Time:Resume() window:ShowMouse() if window:Closed() then return end ---------------------------------------------------------------------------------------------- while EventQueue:Peek() do local event = EventQueue:Wait() if event.id == Event.WidgetAction then ---------------------------------------------------------- if event.source == Talkingpanel.btnClose then --self:ProcessEvent(Event(Event.WidgetAction,Talkingpanel.btnClose)) System:Print("WidgetAction1") self.component:CallOutputs("Output1") Talkingpanel.btnClose:Hide() window:FlushMouse() window:FlushKeys() window:HideMouse() window:SetMousePosition(window:GetWidth()/2,window:GetHeight()/2) gui:Hide() widget:Hide() return elseif event.source == Talkingpanel.btnConservation2 then --self:ProcessEvent(Event(Event.WidgetAction,Talkingpanel.btnConservation2)) System:Print("WidgetAction2") Talkingpanel:SetText("NPC Text 2") Talkingpanel.btnConservation2:Hide() Talkingpanel.btnConservation3:Show() elseif event.source == Talkingpanel.btnConservation3 then System:Print("WidgetAction3") self.component:CallOutputs("EndConservation3") Talkingpanel.btnConservation3:Hide() end end end context:Sync() end end Mybe someone can use it for NPC conversations
  17. ok, solved it. In the player script I have to make a reference to the weapon index in order to trigger the function. self.weapons[self.currentweaponindex]:becomewater()
  18. ah ok got it.. thanks .. i try .. and post again if it function. many thanks
×
×
  • Create New...