Jump to content

havenphillip

Members
  • Posts

    550
  • Joined

  • Last visited

Everything posted by havenphillip

  1. I want to make a horizontal compass that allows the player to navigate towards a goal. How can I set the rotation towards the goal to equal zero so that whenever the player is facing the objective it is set at the middle?
  2. Does your camera have a script? I got this from Aggror's death trigger script. Maybe put this on your camara? You'd have to create a pivot and child the pivot where the camera will reset to the player too. Script.start = "" --entity "Start Point" function Script:Collision(entity, position, normal, speed) reset = self.start:GetPosition() self.entity:SetPosition(reset) end
  3. OK I'm going to have to keep looking at this to see if I can understand what I can get away with and what I can't. There's a few examples floating around but this is new territory. I feel like I'm about to level up.
  4. My idea is if I can create a single bounding box script and have different scripts call on it that way I can make multiple use of it, but how would I call the bounding box script in another script?
  5. Ok so I can just call it like "self.menu"?
  6. How do I interact with a script I've imported into another script from that second script?
  7. Can you explain this again? You want the camera to shoot a beam or you want to shoot a beam at the camera? You want the camera to stop or the beam?
  8. I still want to learn that FlowGUI though. I studied some of the sample maps but the scripts call scripts that call scripts. Where's the starting point if I want to understand it? I want to read it all and understand the step by step logic. Where do I start? What's the first script? I also don't understand how you don't use the format "function Script:Start()" for instance but do things like "function GetGuiElements(guiType)". Reminds me of Rick's State Machine Coroutine thing he posted which I also can't make sense of.
  9. Ah ok sweet that worked: context:DrawText(string.format("%.0f",self.timer), self.cirPos.x-14, self.cirPos.y-14, 30, 30, Text.VCenter+Text.Center) Cool I'll leave it here for whoever wanders by: Circle Timer.lua (Currently set up to attach to pivot then child to player. Kills player at zero)
  10. OK sorry. What do you mean that the Flowgui manager is empty in the script? You mean the entity?
  11. 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
  12. 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.
  13. 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.
  14. 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).
  15. 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.
  16. 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"
  17. 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
  18. So the camera moves with the cube as you move the cube but the character doesn't move?
  19. What are you trying to do? Get another entity's position written on the screen?
  20. 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).
  21. Ok where is that folder? You mean this one? C:\Program Files (x86)\Steam\steamapps\common\Leadwerks\_CommonRedist\vcredist
  22. 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?
  23. Nope. Nothing. Still the same. I did that and uninstalled and reinstalled it again.
×
×
  • Create New...