Jump to content

tipforeveryone

Members
  • Posts

    382
  • Joined

  • Last visited

Posts posted by tipforeveryone

  1. 9 hours ago, burgelkat said:

    How did. you import it? Maybe a dump question :ph34r:

    Yes, your question is not dumb. that was a long process.

    First, I used cloth simulator for a plane in Blender with Force Field as Wind then attached bones to that simulated flag. Finally, baked animation of those bones, that is it!

    36 minutes ago, CangoJoe said:

    Very cool! Maybe upload it into the workshop? :)

    Yes I will, soon ;)

    • Like 1
  2. Agree, this can make Leadwerks better for beginners who want to create a beam from their start

    I think, even beginners dont have any gamedev experience but when finding their first game engine, they will look for what that engine can offer, the easiest ways to solve their needs

    "I want to build a gun with laser beam" / "I want to make a starwar game with a jedi running around swinging his light-beam saber"

    ..googling.. 5 minutes later

    "Wow Leadwerks can solve this in 1 line of code, amazing, lets buy it!"

     

  3. I thought about GetDistance() before. yes, that is only one solution for this, and using entity:Point() for pulling coins to player is brilliant.

    But if there are multiple objects like player (may be a random enemy which wants to collect coins too then you must collect more coins than them to win) how can those coins use GetDistance() to all player like objects and only move toward the closest one?

  4. Hi,

    I want to make a small game in which playerObject can move and collect coins around it among stones (demonstrated in below images)
    when player moves to a point, press a key to make every coins within its aura radius be collected (sucked to) by player except stones
    and is there any way to get only the closest coin ?
    Those stones and coins are randomly generated and not moving

    any idea for this ? how to make it in lua? Thanks for helping :)

    image.png.62e08664d219a54475eccd54457e8a08.png

  5. As my opinion, I will use decals for something which has non flat surfaces. Example, blood on a piles of stones, mud on curved edges of a car, something like that, and 2D model with transparent textures for walls, ground.

    When I used my old computer, decal ate alot of FPS.

    For your paper, I suggest you to use a plane with text texture.

  6. 27 minutes ago, Thirsty Panther said:
    
    local joint = Joint:Ball(pos.x, pos.y , pos.z + 1,box)

    When I use the above code I get the result you are after. Or if you use 

    
    local joint = Joint:Ball(pos.x+1, pos.y - 1, pos.z,box)

    If you +1 or -1 the Y variable it goes crazy.

    Yes it is, the reason I use "pos.y - 1" is that will make the box become higher than Joint position so when the box falls down, it will have enough velocity to traverl at least 1 round. the bad thing is its velocity was NOT decreased by gravity, and it become bigger and biger, thus it spin like hell.

    if you only use pos.z + 1, you can see the box will move forever, and if you use box:AddForce(--with a big force vector--) that box will go crazy again.

    It feels like mass and friction is nothing in leadwerks

  7. On 1/12/2018 at 2:19 PM, AggrorJorn said:

    Maybe the mass is too low? For the ropes I use a mass of 10.

    SetMass(10) even (100) is no use, my box still spin around the joint like crazy

    this video I made a simple joint:ball with a light which has the same code and it worked properly (LE4.1 with old Newton) You can see the diffirence.

     

    On 1/12/2018 at 2:55 PM, Thirsty Panther said:

    I'm no expert but aren't you moving the joint to give your box its momentum.

    If you look at the example in the documentation you set the joints position then apply Torque to the object to get it to rotate.

    If you remove the Y component in your script the box swings.

    If you add to the X component with no Y or Z the box swings.

    Is this the behavior you are looking for?

    I did not move the joint, i let it stay still, and I dont want to addTorque, just leave it there, then I can simulate a hanging target to shoot. I wonder why Josh does not pay any attention

  8. function Script:Start()
    	local box = Model:Box(0.5,0.5,0.5)
    	box:SetPosition(0,4,0)
    	box:SetMass(1)
    	box:SetCollisionType(Collision.Prop)
    
    	local pos = box:GetPosition(true)
    	local joint = Joint:Ball(pos.x, pos.y - 1, pos.z + 1,box)
    	--This makes sure that box has high velocity after dropping
    
    	joint:SetFriction(200)
    end

    And I got this, I think there is a problem with Joint:Ball (and Joint:Hinge - I tried too) of velocity and gravity interaction

     

  9. Sometime I need something like this

    if self.condition then
    	if window:KeyHit(Key.A) then
    	--Do a bunch of code--
    	end
    	if window:KeyHit(Key.B) then
    	--Do a bunch of code--
    	end
    	if window:KeyHit(Key.C) then
    	--Do a bunch of code--
    	end
    end

    It is much clear and structurable than this :D I think

    if window:KeyHit(Key.A) then
    	if self.condition then
    	--Do a bunch of code--
    	end
    end
    if window:KeyHit(Key.B) then
    	if self.condition then
    	--Do a bunch of code--
    	end
    end
    if window:KeyHit(Key.C) then
    	if self.condition then
    	--Do a bunch of code--
    	end
    end

     

  10. Hi,

    There is something not right with window:KeyHit() function, I did mention this problem in the past but wasn't solved

    This is the code

    Script.condition = false
    
    function Script:UpdateWorld()
    	if self.condition then
    		if window:KeyHit(Key.F) then
      			System:Print("F key pressed!!")
    		end
    	end
    	if window:KeyHit(Key.L) then
    		self.condition = true
    	end
    end

    Process:

    • self.condition = false will make sure that when I press the F key, there is nothing happen
    • then If I press the L key to make self.condition = true, the console displays string "F key pressed!".

    I suppose the window:KeyHit(Key.F)  is somehow  "saved" and waits until the condition is met to execute code inside it.

    This is annoying in some situations indeed. Here is an example:

    1. A door can only be opened by pressing F when a electric switch is ON.
    2. Player may try to press the F key to open door before he is instructed that the switch must be ON to open the door (at this point the window:KeyHit(Key.F) is "saved" as I said above)
    3. After turn on the electric switch, the door will be Opened by that "saved" command from Key.F hit.
    4. I don't want that. It should be kept closing until I press F with the turned ON electric switch.

    The temporary fix is using window:KeyDown() with a boolean variable like this

    Script.keyPressed = false
    
    function Script:UpdateWorld()
    	if window:KeyDown(Key.F) then
    		if self.keyPressed == false then
    			self.condition = true
    			--ANOTHER CODE
    
    			self.keyPressed = true
    		end
    	else
    		self.keyPressed = false
    	end
    end

    But this causes another problem, that is: If I replace a function to the "--ANOTHER CODE", will be executed many times because it is in UpdateWorld() function. Therefore I don't want to use this fix

    So how can I execute my code only one time when I press my desired key without getting the first problem with window:KeyHit()

  11. I published my game as standalone version and sent to my friend to test, he gave me some ideas to fix and improve

    Is there anyway to update my game without repack a whole game ? I just modify some .lua files. How can I update my game like that ? Maybe a patch to do Copy/Paste task.

    If I create folders like structure inside data.zip, will it override game content ? In case it is possible, I think user can "mod" my game too hehe. Good Idea ?

  12. 2 minutes ago, AggrorJorn said:

    The weapon shooting feels really nice. 

    1 tiny feedback point: the options menu shows the 'on' color as red and the 'off' color as green. Personally I would swap the colors.

    :D Thanks for your feedback! I want to warn player that all red options can affect game performance. It is kind of confused

×
×
  • Create New...