Jump to content

Slimwaffle

Members
  • Posts

    245
  • Joined

  • Last visited

Posts posted by Slimwaffle

  1. So the only option I can see to make this somewhat work is possibly creating a blank square and then a label over the top. To make it look like a textarea. Because SetText on a label does exactly what it is supposed to do. Its just a shame because a clear text command is really badly needed.

  2. No you can't and this is part of the problem. So SetText doesn't work like java's Set and append. It doesn't matter if you use SetText or AddText it will always add it under existing text and Setting empty text just creates an empty line. And the Scroll bar always stays at the top even though new text is added to the bottom. 

    So to prevent the player from having to scroll through walls of text to see if an item is created or not. I want to be able to clear the Text before setting it again.

  3. Hey Guys 

    I need a way to remove the text from a textArea before setting it again. I am using lua. Can anyone please help? I have checked everywhere possible and can't find a solution.

  4. Hey guys.

    I was looking on the forums to find a way to center a drawn image. Couldn't find a solution. I figured it out and then thought hey this might be useful. So I am going to post some code here. You guys might find easier ways to do this. But whatevs hope this helps someone.

    local a = self.player.script.stamina
    	local b = self.player.script.maxstamina
    	local d = self.staminaBarColor
    	
    	local e = a / b 
    
    	local sx = 70 
    	local sy = 10 
    	local hbc = self.staminabarbackColor
    	 local ix = 105
    	local iy = 5
    	local c1 = 90 * e
    	local ix2 = ix + (90 - c1) / 2
    	local iy2 = iy + (90 - c1) / 2
    	--Background Square
    	context:SetColor(0.2,0.2,0.2,1)
    	context:DrawRect(105, 5, 90 , 90)
    	
    	context:SetColor(1,1,1,1)
    	context:DrawImage(self.run ,ix2, iy2, c1 , c1)

     

  5. Hey guys and girls

    So in preparation for 4.6 and multiplayer functionality to leadwerks. I have been thinking about my game and how to prep it. I have decided to use the existing FPS script but add a character model and animations for walking crouching running etc. What I want to know is that when it comes to the weapons, is there a way to do this where the weapons are a child of the character? So that way I can keep the existing fps code and just remove the arms from the weapons models and then just position the guns as children of the characters hands or arms.

    Are there any examples of something similar being done before?

    Also when the multi player stuff is added will there be a function like update world that works for the multiplayer calls?

  6. This was very similar to the first method I tried.

    What I figured out is that no matter what you do each armature is treated as a separate animation.

    I wanted to keep the gun and hands in their original forms when combining them to be able to separate the textures over two objects (so I could keep the original textures).

    What I decided to do in the end was keep the bones for the hands (to allow posing) and remove all the bones from the gun. Then when I did the animations I was able to pose the hands and move them. Then add all the separate parts of the gun and movements using object mode movement and rotations. I still ended up with the same result and was able to do everything as a single animation because there is only one armature. 

    • Upvote 1
  7. Does anyone have any experience animating with blender? I have a gun and fps hands model each made separate. I want to create a animation that combines the two. So far I have them combined fine and able to assign original textures inside leadwerks to each part. 

    The problem is that my gun model has loose parts each with its own armature. I tried making an animation in blender that moves the trigger, hammer and the fingers. When I added the animation model to leadwerks it gave me 4 separate animations. Is there a way to combine these animations? I just used a basic one that uses bone rotation and key-framing.

  8. yeah pretty much exactly what happened.

    As an alternative until I can fix this. I have made a prefab box with one surface textured to the blood. This has transparency and works perfectly (using the same material) and fixes all issues at once.I would like to however get this working with decals. Because scene overload from too many scripted prefabs is a big issue with my game. Every time I make something new I have to find ways to balance it.

    blood1.jpg

  9. I need help with blood decals for my game. They are loading in fine. But they are square looking patches and the keep flickering and vanishing.I have tried everything I can think of. And the fact that I can't see a preview in the material editor isn't helping. I will provide a screen shot and the code I am using. Ideally I would like them to look like pools of blood. And not vanish at all. So that I can create a whole other script that dictates how long to wait before vanishing.

    --Moving Check
    	if self.mode == "roam" then
    	self.moving = 1
    	elseif self.mode ~= "roam" then
    	self.moving = 0
    
    	end
    	--Foot step sound
    	if self.moving == 1 then
    	if self.sound.foot ~= nil then
    	self.footdelay2 = self.footdelay2 - 1
    	if self.footdelay2 <= 0 then
    	self.entity:EmitSound(self.sound.foot, 30 , 1 , 1 , false)
    	self.footdelay2 = self.footdelay
    	--Blood Texture for ground
    	if wounded == 1 then
    	--Bullet mark decal
    	
    	
    			
    			--Bullet mark decal
    			local mtl
    			local scale = 0.1
    			
    				mtl = Material:Load("Materials/Decals/wound.mat")
    			end
    			local decal = Decal:Create(mtl)
    			
    			--decal:SetScript("Scripts/Objects/Effects/BulletMark.lua")
    			
    			decal:SetColor(1,0,0,1)
    			decal:SetPosition(self.entity:GetPosition())
    			decal:SetParent(terrain.entity)
    
    			
    			
    
    	
    	
    	end
    	end
    	end

     

    error decal.jpg

  10. What I ended up doing with  my game was removing all the code that says what happens if the player dies. Then inserted my own code that says; teleport to respawn location, reset health, reset stamina, reset thirst, reset hunger, empty inventory.

    Using this method the player technically doesn't die but it simulates death. Then all you have to do is for your enemies is add code that makes thier target nil and tells them to search for new target.

    But as for your code the only thing I can suggest is set up a trigger value and then breadcrumb. So for example add something like;

    Script.trigger = 0

    Then in your update world add;

    if self.health <= 0 then

    self.trigger = 1

    end

    if self.health > 0 then

    self.trigger = 0

    end

    if self.trigger == 1 then

    --Add the code here that triggers or references the change map.

    end

  11. Thanks I got a temp fix by right clicking the published version and selecting the option that lets the exe handle DPI scaling instead of the system. But it still doesn't go to a true fullscreen because it has black bars now(that is on my gtx 1080). On my gt1030 which is a 2gb card everything works fine. I am wondering if there is an option somewhere in nvidia panel or windows that always allows the application to handle scaling.

  12. The 1080 seems to be working amazingly. I just have an issue with it and leadwerks. Its something to do with higher resolutions and dpi scaling. I posted another thread in general about it. Leadwerks as well as my published game aren't going into full screen properly and giving off weird resolution numbers in the game's menu.

×
×
  • Create New...