Jump to content

havenphillip

Members
  • Posts

    556
  • Joined

  • Last visited

Everything posted by havenphillip

  1. OK sorry. What do you mean that the Flowgui manager is empty in the script? You mean the entity?
  2. Yeah here's scene tree gui: Now I"m getting: attempt to call method 'AddElement' (a nil value) -- Line 70 Line 70: self.guiManager:AddElement(self.healthLabel) I don't know why it would be nil. Here's my current script. You can see it's a mess. System:Print is currently under PostRender near the bottom. "Timer" is this script on the tree. Countdown Circle.lua
  3. Oh duh of course load the font in the Start()! It's not changing position. I'm not sure at what point we told it to. Tried System:Print it's telling me "argument #3 is 'string';'[no object]' expected. I'm not sure maybe I'm not putting the right thing in the brackets. I've tried "text" and "self.timer" I tried with FlowGUI it's telling me "attempt to index field 'healthLabel' (a nil value) --line 93 line 93: self.healthLabel:SetText("Your updated health") I'm not supposed to child something to something or anything else, right? I created the two pivots with the correct scripts.
  4. Ok this is what I have. If I put it under PostRender() it loads the font like every second. Doesn't do that if I put it under Start() but I think that would probably defeat the purpose. The other thing is it doesn't move position when it changes from 100 to 99. --text positions font = Font:Load("Fonts/arial.ttf",10) context:SetFont(font) centerUiX = self.cirPos.x - self.radius/2 timeX = font:GetTextWidth(text) drawX = centerUiX - timeX/2 (self.cirPos.x is context:GetWidth I'll clean that up) I'm going to try this with your FlowGUI. Also it's a countdown timer, though. Not health. I don't know if that changes anything. I think that may be why it's loading the font every second.
  5. OK that'll take me a minute. Let me see if I can do that. The healthAmountWidth every frame? Is that just context:GetWidth? I got the FlowGUI. I've looked through it before. It seems really cool but it's out of my league. If only there were a tutorial or something on it (cough cough).
  6. Ok like if the countdown is 100 the text is centered where I want it to be but once it goes to 99 it looks slightly left since it loses that third digit place. So I want to keep it looking centered as it counts down and my solution was to shift it over slightly so it looks centered at 99 like it does at 100. But my problem is I'm animating it across the screen. I just want it to scoot over a bit then stop moving.
  7. Is there a simpler way to center text so that it doesn't depend on the left margin? I have this counter and it looks right until it goes less than 100 and then less than 10. At that point it looks out of place. I thought I'd use "if self.timer...then self.textPos..." but then the text slides across the whole screen the whole time it's in the timer range. I want it to scoot over once then stop. How do I stop it? context:DrawText(""..Math:Round(self.timer),self.textPos, 465) --text positions if self.timer >= 100 and self.timer <= 999 then self.textPos = self.textPos end if self.timer >= 10 and self.timer <= 99 then self.textPos = self.textPos +4 end --slides across screen at a rate of "4" if self.timer >= 0 and self.timer <= 9 then self.textPos = self.textPos +8 end --slides across screen at a rate of "8"
  8. Something like this maybe on the cube? I had to child the cube to the player. The numbers work and it follows the player but I don't know if it's what you're trying to do exactly you might have to mess with it. Script.Yue = nil --entity "Malla Jugador" Script.Pivote = nil --entity "Pivote" function Script:PostRender(context) self.pos = self.entity:GetPosition(true) DrawX = self.pos.x context:SetBlendMode(Blend.Alpha) context:SetColor(1,0,0,1) context:DrawText(""..Math:Round(DrawX), 2, 2) context:SetBlendMode(Blend.Solid) context:SetColor(1,1,1,1) context:DrawStats(2,22) end
  9. So the camera moves with the cube as you move the cube but the character doesn't move?
  10. What are you trying to do? Get another entity's position written on the screen?
  11. Ok I reinstalled Leadwerks. I tried starting it from C:\Program Files (x86)\Steam\steamapps\common\Leadwerks and I get: The code execution cannot proceed because MSVCR100.dll was not found. So I downloaded that and I put it in C/Windows and then got this: The application was unable to start correctly (0xc000007b).
  12. Ok where is that folder? You mean this one? C:\Program Files (x86)\Steam\steamapps\common\Leadwerks\_CommonRedist\vcredist
  13. Ah I bet it's the visual studio. I just uninstalled it I had a few versions. So do I need to reinstall Visual Studio?
  14. Nope. Nothing. Still the same. I did that and uninstalled and reinstalled it again.
  15. . For some reason I can't start my Leadwerks. I tried uninstalling and re-installing. I click it and this little window appears but then it disappears and nothing. Says it's running, then syncing then nothing. The window closes like it shut itself down.
  16. Aw man it's saying video unavailable on YouTube as well. This seems cool but I'm still a noob I need those baby steps.
  17. Ah ok. I worked that out. Was not aware of the "stage" aspect of shaders. I had no vertex information.
  18. That's what I was afraid of. I'm looking through a tutorial on shaders right now from the Leadwerks wiki. I want to learn it. Where do I start? Is there a shader that comes to mind that is close to what you're describing that I can start messing with? Also what does "surface drawn with no active shader" mean?
  19. Yeah I thought about that. I tried a quick version but it was tacky I didn't see much potential. Maybe if I worked on it more I could make that work. The planet material and the cloud material are turning at slightly different speeds, which is kinda cool. And I can adjust the alpha on the clouds right in the code rather than going back and forth in GIMP. But I may end up doing that. I was hoping there is some little trick somewhere I might not be aware of.
  20. Is there any way to get a Z-sort material to pick up shadow? I made this cool planet with clouds that are layered over the top. It looks cool with it set to Alpha but I have to use Z-sort to do it and the lack of shadow on the bottom left is bothering me. I tried it the other way by using the "Diffuse + Alphamask" but I can't fine tune the alpha channel because it vanishes from the center where it's transparent outwards and the lower I go the more cloud I lose, plus the edges are too sharp that way. Or is there a way to use the "Diffuse + Alphamask" and set an alpha channel adjustment that makes it evenly transparent?
  21. Yeah I'm using the FPSPlayerStatusBar from the workshop and if you zoom out the minimap (down arrow) the health bar and stamina and ammo and the minimap itself can be seen in the minimap. I noticed the health, stamina, and ammo shown in the minimap don't change which leads me to conclude that it takes a snapshot of the first frame of the player cam, which I presume is what you mean about saving in a buffer.
  22. Ok I did this but it didn't work. I'm still trying to understand but it looks like the minimap takes a snapshot of the screen right at the start and renders it from the top view? So wouldn't I have to delay the healthbar, etc. within that code? Seems like delaying the minimap wouldn't work. in Minimap: function Script:UpdateWorld() if self.toggle==0 then self:DisableUI() world:Render() self:EnableUI() end function Script:DisableUI() self.player:Hide() end function Script:EnableUI() self.player:Show() end
  23. Oh ok. It's no problem but you may have to explain to me how to do that. I'll look it up and see if I can figure out .zip files. But the code should work in any project so long as you put "GetKeyValue("type","enemy") in your enemy scripts (you can use crawlers) and have the code attached to a pivot and childed to a player, and have the shader at the bottom of the code named right and in the right folder..But whatever you want, man. I appreciate your help with this. I'm totally stoked on it! I'm going to go see if I can figure it out...
×
×
  • Create New...