Jump to content

GorzenDev

Members
  • Posts

    141
  • Joined

  • Last visited

Posts posted by GorzenDev

  1. I have combined all my model surfaces into 1 surface and pick still returns prop collision.
    I have checked every single entity in my scene and made sure none have a Collision:Prop.
    I even went all the way and attached a script with pickmode(0) to every single brush and even all the skeleton bones.
    It still returns the same result.

    This is an impossible situation there is no way pick should return collision on something with collisiontype prop since there simple is nothing having that collision type in my scene.
     

    "Frustration starts to build"

    Nobody had similar problems and have an idea what could be wrong?

  2. I am working on a third person controller with 'over the shoulder view', all thats left to do is camera collision/occlusion.
    I do a world:pick from the camera's lookat target back to the camera, then check distance etc.
    But the problem is my pick hits the character, or so it says.
    I know this sounds like a noob problem and it may as well be for all i know.

    I set pickmode and collisiontype in the modelscript.

    	self.entity:SetPickMode(0, true)
    	self.entity:SetCollisionType(Collision.None, true)

    During picking i print some stuff.

    	local distance = -1.0
    	local pickInfo = PickInfo()
    	if world:Pick(p0, p1, pickInfo, 0, true) then 
    		System:Print("camera occluded by: "..pickInfo.entity:GetClassName())
    		System:Print("name: "..pickInfo.entity:GetKeyValue("name"))
    		System:Print("collisiontype: "..pickInfo.entity:GetCollisionType())
    		distance = p0:DistanceToPoint(pickInfo.position)
    	end

    The weird thing is the print results.

    Quote

    camera occluded by: Model
    name: 
    collisiontype: 1

    I checked and collisiontype 1 = Collision:Prop.


    How is it possible my model has collisiontype 1 ?
    Could it be because my model has multiple surfaces ?

    Anybody has an idea?

  3. After all these new little updates i no longer can compile any c++ project.
    gives error:

    Quote

    1>   Creating library E:\Projects\Leadwerks\CriminalMinds\Projects\Windows\..\..\CriminalMinds.debug.lib and object E:\Projects\Leadwerks\CriminalMinds\Projects\Windows\..\..\CriminalMinds.debug.exp
    1>Leadwerks.lib(Face.obj) : error LNK2019: unresolved external symbol ___std_reverse_trivially_swappable_4 referenced in function "void __cdecl std::_Reverse_unchecked1<int *>(int * const,int * const,struct std::integral_constant<unsigned int,4>)" (??$_Reverse_unchecked1@PAH@std@@YAXQAH0U?$integral_constant@I$03@0@@Z)
    1>E:\Projects\Leadwerks\CriminalMinds\Projects\Windows\..\..\\CriminalMinds.debug.exe : fatal error LNK1120: 1 unresolved externals
    1>Done building project "CriminalMinds.vcxproj" -- FAILED.

    this a new project with all my codes commented out to make sure its not me.
    this problem persist using 4.5 and even beta.

    grabbing an older project and trying to compile, results in the same compile error.

  4. Does clamp get a proper result when negative values are used?
    Since in that case the self.maxZoom would be the smallest value of the 2.
    maiby flip them around ?

    During optimisation i did at one point use clamp but got a bad result so reverted it back and never looked at it again. :D

  5. FYI the z index of mouseposition is cumulative.

    To get proper values you could do something like:

    	local oldWheelPos = 0.0
    	if self.currentMousePos ~= nil then
    		oldWheelPos = self.currentMousePos.z 
    	end
    
    	self.currentMousePos = window:GetMousePosition()
    	self.currentMousePos.x = Math:Round(self.currentMousePos.x)
    	self.currentMousePos.y = Math:Round(self.currentMousePos.y)
    
    	local newWheelPos = (self.currentMousePos.z - oldWheelPos) * 0.1
    	if newWheelPos > 0.0 or newWheelPos < 0.0 then
    		self.curZoom = self.curZoom + newWheelPos
    		if self.curZoom < self.maxZoom then
    			self.curZoom = self.maxZoom
    		elseif self.curZoom > self.minZoom then
    			self.curZoom = self.minZoom
    		end
    	end

     

    • Like 2
  6. I'm baffled as to where the problem may lay, like you said nothing has changed either in LE or on my PC.

    I'm also reluctant to opt into beta and rather wait for stable release, as in my opinion developing a game with a version that is prone to (big)changes could end into more work for me.

    Using cpp so luckily the editor is only used during map development.
    So for now i think i choose to wait and continue work on the map once 4.5 is no longer beta.

  7. Turning/Moving the camera in the perspective viewport stopped working for some reason.
    It whas working fine yesterday.

    This is using leadwerks 4.4.

    The things that do work is:
    Panning/Zooming (scroll wheel).

    The things that dont work anymore:
    Moving (ASWD).
    Up/Down (QE).
    Panning (Arrow Keys).

    Is this a bug or did i accidentally change a option somewhere? (i've tried changing some options in config but no changes)

  8. 6 hours ago, St0nedas said:

    Hmm okay, but do you have any idea as to why it may be causing break points when I compile and run in release mode (At exactly when I assign the function pointer to the widget)? Because strangely enough it only happens *most* of the time ... sometimes it can run just fine, but runs fine every time in debug mode.

    i am not sure to be honest i have never tried assigning a function pointer to a widget.
    i usually just check event.source against a widget pointer and call a specific class function corresponding to that widget.

  9. your code creates a textarea which is differant from a textfield.
    a textarea is always multiline.
    a textfield is just one line.

    setlayout works as supposed to just dont forget widget->Redraw() after setting layout.

    also like josh said the basewidget needs a panel script.
    if you dont want a visible panel you can always use SetObject('backgroundcolor', new Vec4(0,0,0,0)); to make it transparant.

  10. I wish we had lessons like these on school when i whas little, it would have saved me a lot of time teaching myself a certain way of thinking. 

    Also very helpfull for those that are new to programming or scripting.

    • Upvote 1
  11. honestly looking at the vanilla TextArea.lua it looks like it should support what you want.
    try something like below. (not tested it)

    function Script:AddText(text)
    	self.updateslidersneeded=true
    	local morelines = text:split("\n")
    	local gui=self.widget:GetGUI()
    	local n
    	for n=1,#morelines do
    		self.lines[#self.lines+1] = morelines[n]
    		self.linewidth[#self.lines] = gui:GetTextWidth(morelines[n])
    		self.maxlinewidth = math.max(self.maxlinewidth,self.linewidth[#self.lines])
    	end
      	--try something like this
    	self:MouseWheel(#morelines)
    end

     

×
×
  • Create New...