Jump to content

Defranco

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by Defranco

  1. Are you using: entity:Release() to clear the entity after death?
  2. We're still having issues with version 4.6 and 4.7 beta in regards to Navmesh generating. On a fresh install, with a fresh map.... using all default settings... creating a simple room has the Navmesh about 64 decimals from a wall. Or two tiles of 32ea (grid view default). Which works out great for doorway spacing with the default scale size. However, when changing the map size to 4096x4096 to create a bigger game (creating terrain), generating Navmesh puts the spacing at 544 instead of 64 away from a wall, or 17 tiles of 32ea (grid view default). Now most rooms don't get any Navmesh generated. Deleting the terrain and re-doing Navmesh doesn't revert the space changes. So the only way to get the Navmesh to work is to scale everything 500% so that the Navmesh can go thru doorways, which defeats the purpose of the larger map. Am I missing something? My understanding is that the Navmesh distance from walls is based on character controller radius, which remains the same (or should).
  3. After finishing up our coding marathon and doing over 4500 lines of code last night, we finally finished the Stats & Skills allocation. 2 standalone scripts. One controls the stats. One controls the visual screen. Our stats script is 24,967 lines. Our screen script (that shows everything) is 16,643 lines. Total time was about 350 hours of work to complete just these 2 scripts. It's ready to be inserted into our pre-alpha release. A fully functioning stats and skills system. Players get to level skills by using ability (exactly like skyrim with 'skill exp') and by also allocating bonus skill points on top of it. The stats/skills allocations for what you wear (equipment) is also implemented. As well as potions, scrolls, spells (positive) and debuffs (negatives) are fully integrated as well. There is also a perk system and fully customized character creation with races/hometown and starting class that all determines stats and skills. Video uploaded is in 1080p capabilities. 100% lua scripted, just to give people an idea of what is possible with 350 hours of work.
  4. Hey Gamecreator, Did you ever resolve this? We're going through the same issue after updating our project file from 4.4 to 4.6 beta. Our map size is 4096 and has the exact issue you describe with Navmesh generation
  5. It would be self.Pivote:GetPosition() for position and (self.Pivote:GetRotation().x.0) (example) for rotations there is also GetAngle() in the documentation but I've never used this one
  6. Been working on a couple projects lately, This is from one of our older RPG's. Credits to Rick on coaching us for inventory (over a year ago), and Jorn for always answering our questions as well and his tutorials, especially on youtube, and Josh as well, and many others around the forums and private chat. -- Inventory System, 90% functioning. Diablo2-style (items can be moved, created--pickedup--, released--dropped--) - just need to work on stacking, and overlap issues. -- Fully Functioning HUD including working scripts for, just took off some image overlay temporary for redesign: Health Bars Mana Bars Thirst, Hunger, Sleep, Temperature, and even Mood/Karma system EXP Bars, level display -- Fully Functioning Level System, including stats, primary/secondary skills, that control everything from skills for items, stats, and every value possible. All stat allocations for leveling up works perfectly, just need to duplicate the text and button scripts for overlay. (codes all finished finally, but many weeks of work left for graphics and proper text - overlay work - ), but it fully works. Also about 20% done the character tab, one of the next things we'll be working on is putting this together along side the inventory system. We're also dabbing into scripted quests with NPC's, so far so good, had to abandon the Flowgraph editor after it couldn't hold more than 1/10th of a quest.
  7. Yes, using the FPS character controller included in Leadwerks, then took codes out of the third person player controller in the workshop, combined them then coded a bunch of new lines and changed a few things so they could work together (using a toggle), then coded the rest of what you see in the video
  8. Crouching can be done, Crouching + jumping into pipes/windows/vents can be done. Crouching under things like trucks can be done. Crouching up stairs with bypassing the 8cm height step limit can be done. You have to code around the hardcode and overwrite it by being creative, this is a test we made in about 6 hours of coding. We used glass/mirrors and made it appear to have altered the hardcode with lua coding. In reality, its just a work around.
  9. We did a project 'update' in the Project Manager to update the game files to 4.6 updated, Now Navmesh doesn't seem to work, we're using the same settings to generate Navmesh, (left side is 4.4) (right side is 4.6) No matter what we try the navmesh won't go closer to the walls like before. Looking back at previous posts on the forums, it's indicated that navmesh is based on character controller radius, which isn't editable. Was the values changed in one of the updates?
  10. I 3rd the invisible ramp idea. It's also good for navmesh (AI movement). Stairs, bridges, narrow walk areas, bumps. Invisible ramps are your friend to make everything smooth, especial AI who get stuck on stuff easily without invisible ramps. You can use something like this for jump, and I'm sure you can lower the values to make a 'sway motion' while walking. -- Goes at top Script.jumpoffset=Vec3(0) -- Put in your jumpscript after keyhit space o self.jumpoffset = Vec3(math.random(-1,1),math.random(-1,1),0):Normalize()*30
  11. I'd thought I would share a basic level system for anyone new (or checking forums search function) could use as a base point to get started. At the top --------- Level System --------- --below is the player level Script.playerLevel = nil --below is the players maximum level, I use 99 for this game Script.playerMaximumLevel = 99 --below is the players starting level Script.playerStartingLevel = 1 --------- Experience System --------- --below is the players current experience points Script.playerExperiencePoints = nil --below is the players current maximum experience points Script.playerMaximumExperiencePoints = nil --below is the players starting experience points Script.playerStartingExperiencePoints = 0 --below is the players starting maximum experience points Script.playerStartingMaximumExperiencePoints = 500 --below is the amount of maximum experience points increase multiplier per level up Script.playerRateExperiencePoints = 2 --below is the calculator for extra experience points after leveling up to make sure it carries over to the next level Script.playerExtraPoints = 0 Inside the Function Start --------- SETUP LEVEL & EXP--------- --below we setup our level, experience and maximum experience to match starting values self.playerLevel = self.playerStartingLevel self.playerExperiencePoints = self.playerStartingExperiencePoints self.playerMaximumExperiencePoints = self.playerStartingMaximumExperiencePoints Scripts -- We received EXP (EXP = Experience Points) -- And if the EXP bar reaches full, then we level up and check the EXP function Script:PlayerReceiveEXP(expPoints) --lets check that we aren't going to die, dead people don't receive exp, lets also check that we are not maximum level if self.health > 0 and self.playerLevel < self.playerMaximumLevel then --lets check if our experience is less than our maximum experience if self.playerExperiencePoints < self.playerMaximumExperiencePoints then --if it is, we can add the experience points to our player self.playerExperiencePoints = self.playerExperiencePoints + expPoints end --now lets check if our experience is equal or greater to our maximum experience if self.playerExperiencePoints >= self.playerMaximumExperiencePoints then --if it is, we need to run a check to calculate the extra experience points self:PlayerCheckEXP() --also, we need to level up self:PlayerReceiveLevel(1) end end end -- We need to check how much EXP is left -- After that, we will give the EXTRA EXP back after leveling up function Script:PlayerCheckEXP() --below we calculate our extra experience points after leveling up and set them aside self.playerExtraPoints = self.playerExperiencePoints - self.playerMaximumExperiencePoints --now we reset our current experience back to 0 self.playerExperiencePoints = 0 --now we give the player back just the extra experience points self:PlayerReceiveEXP(self.playerExtraPoints) --now we reset the extra points set aside back to 0 self.playerExtraPoints = 0 end -- We received a level -- After that, we increase the maximum EXP allowed function Script:PlayerReceiveLevel(levelPoints) --we need to check that we are not maximum level first if self.playerLevel < self.playerMaximumLevel then --below we add the level to our player self.playerLevel = self.playerLevel + levelPoints --now that we have leveled up, below we increase our maximum experience points to get to the next level self.playerMaximumExperiencePoints = self.playerMaximumExperiencePoints * self.playerRateExperiencePoints end end All you have to do to receive Experience points is point to the Script:PlayerReceiveEXP(expPoints) So if you kill a monster, or finish a quest, or anything you can say something like self:PlayerReceiveEXP(250) to get 250 experience points, or run the script like self.player.script:PlayerReceiveEXP(250) or however you have it setup. The reason I personally used the words Player and player in all the names above is because this allows me to know all these functions are specifically for the player so I can have other NPCS/monsters in the game also have their own style of level system and not get it mixed up with the players scripts.
  12. I think its working. I moved just the sound file for the torch and put it under self.sound={} (which is in function start) And it works under it, odd. I didn't think it had to be part of the table Edit: I had originally had tried it both in the Function UpdatePhysics as well as at the top of the Function Start (above self.sound={}) moving it a few lines down seems to be working. I'm not sure I understand the logic..... Is it because the table starts with self.sound and the line calling the sound file was called self.sound.FLsound?
  13. Seems like it cant get past the "if self.FLsource:GetState()== Source.Playing then" that shows up after the Else When I pres F the 2nd time -- it hides the torch It prints: System:Print("Hide Light Works") and System:Print("Check 1 This works too") Thats as far as it goes. When I do System:Print(self.FLsource:GetState()) It returns 1 before the else statement and returns 0 after the else statement
  14. if window:KeyHit(Key.F) then self.FLsource = Source:Create() self.FLsource:SetSound(self.sound.FLsound) self.FLsource:SetVolume(0.2) self.FLsource:SetLoopMode(true) if self.torch1:Hidden() then self.torch1:Show() --check if source exists if self.FLsource ~= nil then --if it's not playing, play it if self.FLsource:GetState() == Source.Stopped then self.FLsource:Play() if self.FLsource:GetState() == Source.Playing then System:Print("Sound Is On") end System:Print("Sound Is Still On") end end else self.torch1:Hide() System:Print("Hide Light Works") --check if source exists if self.FLsource ~= nil then System:Print("Check 1 This works too") if self.FLsource:GetState() == Source.Playing then System:Print("Check 2 Doesn't work") self.FLsource:Stop() System:Print("Sound Off Doesn't work") end end end end
  15. The first sound line (not using source) is a on-button sound effect self.sound.torch1:Play() its about a 1 second sound effect Whereas the one i'm trying to use in the source is a loop effect that keeps playing until the action is turned off I was playing around with if self.FLsource:GetState() == Source.Playing then self.FLsource:Stop() But it has no effect and won't stop. I've even put in system:prints right in there to test, and the first prints go off, but the sound keeps on playing and the second system print doesn't register. Basically I have, if window:KeyHit(Key.F) then self.FLsource = Source:Create() self.FLsource:SetSound(self.sound.FLsound) self.FLsource:SetVolume(0.2) self.FLsource:SetLoopMode(true) if self.torch1:Hidden() then self.torch1:Show() --check if source exists if self.FLsource ~= nil then --if it's not playing, play it if self.FLsource:GetState() == Source.Stopped then self.FLsource:Play() System:Print("Sound On") end end else self.torch1:Hide() --check if source exists if self.FLsource ~= nil then --if it's playing, stop it if self.FLsource:GetState() == Source.Playing then self.FLsource:Stop() System:Print("Sound Off") end end end end
  16. **should have put this in programming I am having a bit of difficulty getting a sound file to stop playing. I've converted the sound wav file to a source, set the source to loop, set volume, and I can get it to play on-key press no problem But I can't get it stop on keypress again. This is just 1 variation of the method I've tried. I've tried moving around so everything is in its own script, I've tried parts of it in updateworld, tried it in update physics, I just can't get it to stop. --Toggle the torch on and off self.sound.FLsound = Sound:Load("Sound/Torch/Torch2.wav") if window:KeyHit(Key.F) then self.sound.torch1:Play() self.FLsource = Source:Create() self.FLsource:SetSound(self.sound.FLsound) self.FLsource:SetVolume(0.2) self.FLsource:SetLoopMode(true) if self.torch1:Hidden() then self.torch1:Show() self.FLsource:Play() else self.torch1:Hide() self.FLsource:Stop() end end
  17. Hey Rick, Greatly appreciate the feedback. Especially anything criticism, as that's how we're going to learn the fastest. We are indeed using multiple pivots: we've got the primary character controller, then we have the hit-box pivot, then the stat/skills pivot, then attached to the stats/skills pivot we have every single bar pivot: health bar, mana bar, stamina bar, etc Event programming is something we are indeed lacking. I guess that when we create the scripts where the player puts a piece of armor on, or removes a piece of armor, or drinks a potions, or potion affects wear off, we would call to the function in those scripts that calls for updating player stats instead of keeping them in update world?
  18. I thought I would both share what we've been working, as well as get some feedback on a really complicated line of code for stats/skills and stuff for our upcoming RPG. This is just 0.5% of our code, our original code has dozens of skill-types and thousands of lines of coding. We've now split up our lua script into multiple scripts using GetChild(#) and GetParent() references instead of having it in the FPSPlayer.lua area. It was just getting too long and complicated. What I'm sharing is some of our stats & skill system (archery skill displayed) playerStatsSystem.lua -- At the top of our lua script. -- Starting Stats ----------------------------------------- -- Strength: Archery-3:1, OneHanded-1:1, TwoHanded-1:2, Shield-3:1, Defense-3:1 Script.playerStrength = 5 --float "Strength" -- Dexterity: Archery-1:2, OneHanded-1:1, TwoHanded-5:1, Defense-5:1, Sneak-2:1, Pickpocket-2:1, Lockpick-2:1 Script.playerDexterity = 5 --float "Dexterity" -- Constitution: Shield-1:2, Defense-1:2, HealingMagic-3:1, BuffMagic-3:1 Script.playerConstitution = 5 --float "Constitution" -- Intelligence: DamagicMagic-1:2, HealingMagic-2:1, BuffMagic-1:1, Speech-4:1, Vision-4:1, LockPick-3:1 Script.playerIntelligence = 5 --float "Intelligence" -- Wisdom: DamagicMagic-2:1, HealingMagic-1:1, BuffMagic-1:2, Speech-2:1, Vision-1:1, Script.playerWisdom = 5 --float "Wisdom" -- Charisma: Speech-1:2, Lockpick-3:1, Pickpocket-1:1 Script.playerCharisma = 5 --float "Charisma" -- Luck: Vision-1:1, Lockpick-1:1, Sneak-1:2, Pickpocket-1:1 Script.playerLuck = 5 --float "Luck" -- Available Starting Unallocated Stat Points -- Script.playerUnspentStatPoints = 9 --float "Unspent Stat Points" -- Unallocated Stat Points Per Level -- Script.playerLevelUpStatPoints = 1 This top part is just the start (the base and foundation) of our stats & skills system. We've set out to do a RPG that is a cross between Ultima Underworld (series) & Arx Fatalis, with many of Skyrims RPG elements. - A player has a starting of 5 points in each Stat when creating a character. He/she can then use the 9 unspent starting stats points to customize the rest of the stats. And the player gets 1 stat point per level-up to use. - Each of these stats increase various skills. For example. Every 1 point in Dexterity gives the player 2 skill points in Archery, and every 3 points in Strength gives the player 1 skill point in Archery. - Stats also increase other values such as health, health regen, mana, stamina, crit chance, dodge chance, etc etc Here is some sample code taken for Archery that continues our script. -- Available Skills -- Script.playerSkillArchery = 0 --damage with bows / crossbows -- Skills Starting -- Script.playerSkillStartArchery = 0 -- Skills Leveled Up Based on Stats -- --Archery-- Script.playerArcheryValueStrength1 = 3 Script.playerArcheryValueStrength2 = 1 Script.playerArcheryValueDexterity1 = 1 Script.playerArcheryValueDexterity2 = 2 Script.playerArcheryValueEquipment = 0 Script.playerArcheryValueMagic = 0 Script.playerArcheryValueScrolls = 0 Script.playerArcheryValuePotions = 0 -- Available Starting Unallocated Skill Points -- Script.playerUnspentSkillPoints = 22 --float "Unspent Skill Points" -- Unallocated Skill Points Per Level -- Script.playerLevelUpSkillPoints = 4 The above code sets the base for anything that could give the player any Archery points. Stats such as strength and dexterity give the player archery points. But also, equipment, magic spells, scrolls, and potions. These values are at 0 now, but when a player equips a piece of armor that has an archery value on it, the formula will add it to the total archery point. Also, a player gets 22 unspent skill points at character creation. So not only can they put 9 stat points, they can put in 22 skill points to further customize the character. The player also gets 4 extra skill points per level-up. Here is what we have in our Function Script:Start() ------ SETUP ALL SKILLS ------ --Setup Archery-- self.playerSkillArchery = self.playerSkillStartArchery + (self.playerStrength/self.playerArcheryValueStrength1)*self.playerArcheryValueStrength2 + (self.playerDexterity/self.playerArcheryValueDexterity1)*self.playerArcheryValueDexterity2 + self.playerArcheryValueEquipment + self.playerArcheryValueMagic + self.playerArcheryValueScrolls + self.playerArcheryValuePotions What this code does is adds up all the values that gives the player Archery Skills, and it works perfectly. We've also put that same code above into our UpdateWorld. This allows the game to constantly make changes if a player removes/puts on armor, or drinks a potion the values get updated right away. What we still need to do: -Make a ROUND-DOWN feature. Because as of right now it shows Archery Skill as 11.666666666~ when we want it to just show as 11. -------------------- Here's my question to anyone who read this. Is there an easier way, maybe more simplified? Do you have any suggestions / feedback? -- we have dozens of skills, and dozens of attributes such as crit chances with various weapons and tons and tons of perks, right now all these change in the game depends on stats/skills and equipment worn, and potions/scrolls used or magic buffed used. And we're using all these calculations in the UpdateWorld, should we be putting them there too, or is there another way.
  19. Thanks, that worked perfect. I didn't think it would constantly get larger in the one I was using previous.
  20. Script.thirst = 100 --float "Thirst" Script.maxThirst = 200 --float "Max Thirst" Script.thirst_time = 0 --time to keep track of thirst Script.location_rate_thirst = -0.00000008 Script.healthLocation_ratethirst = .12 --(this part is inside the script: start area)-- --Activate Thirst self.thirst_time = Time:Millisecs() --(this controls using items that give thirst back to player)-- Not really relevant to the timer function. function Script:ReceiveThirst(thirstPoints) --Increase thirst self.thirst = self.thirst + thirstPoints; if self.thirst > self.maxThirst then self.thirst = self.maxThirst end self.component:CallOutputs("ThirstReceived") end --(this part is inside the script: Update World area)-- -- Update Thirst if self.thirst > 0 then self.thirst=self.thirst-self.location_rate_thirst*(self.thirst_time-Time:Millisecs()) end if self.health > 0 then if self.thirst < 5 then self.health=self.health-self.healthLocation_ratethirst; end end if self.thirst > self.maxThirst then self.thirst = self.maxThirst end What I am trying to do: Have thirst decrease at a steady rate that keeps the same forever. Then if it hits lower than 5, it starts damaging the player over time until the player drinks to get thirst back. So what this script seems to be doing is increasing over-time. The first 20 seconds seems normal. But as time increases, so does the rate of decrease. Just an Example: First 1-20 seconds it decreases at 0.5 per second, then 21-40 it decreases at 0.8 per second, then at 41-60 seconds it decreases at 1.2 per second. It seems to be adding on extra time as time goes on and increases the rate. Not sure what I'm missing.
  21. Having an issue with the auto-update on steam. It keeps trying to download a patch (1.7mb) Then 5 seconds later anti virus software is removing the patch update as its being flagged as a virus. C:\program files (x86)\steam\steamapps\downloading\251810\leadwerks.exe has been removed. Threat name: Suspicious.Cloud.9.B Advanced details says risk is high, code within leadwerks.exe has been flagged as suspicious.cloud.9.b Is this false positive? or could there be something off in one of the new patch files?
  22. I'm just learning this part too. I'm looking into timer function to create over-time heal or damage effects. If you have the FpsPlayer.lua - have a look at the movement function which uses the timer function to play a sound for footsteps. In theory, this same method could be used to work it into a buff or debuff. Thats where I'd start! Any specifics however for it i'm not sure yet.
  23. I reset it and tried a new approach;; I got it down to only 2 checks by removing the other 4...... Seems less messy :/ I'm surprised at myself for understanding else/if now. Thanks Rick! It's nice being able to PRINT stuff in the logs to see where the code is activating. if self.mode=="hurt" then if self.target~=nil then if self.target.health<=0 then self:SetMode("idle") return end else if self.target==nil then System:Print("!!!!!!") self:SetMode("idle") end end if self.health<=0 then self:EndDeath() return end And also elseif mode=="hurt" then self:EndHurt() elseif mode=="attack" then self:EndAttack() elseif mode=="chase" then if self.target~=nil then System:Print("Now in chase mode") if self.entity:Follow(self.target.entity,self.speed,self.maxaccel) then System:Print("follow") self.followingtarget=true local animationIndex = self.animation.run[math.random(1, #self.animation.run)] self.animationmanager:SetAnimationSequence(animationIndex, self.runAnimationSpeed * Time:GetSpeed(),300) else System:Print("no path?") end else self:SetMode("idle") end
  24. okay I switched it and that specific problem went away - Now I'm getting a new error Unable to find "target" (a nil value) for this line ---- if self.entity:Follow(self.target.entity,self.speed,self.maxaccel) then Seems to have a chain effect - my first thought was to put in another target check Now I fixed it by adding if self.target~=nil then to almost 6 script sections in the entire AI code --- this fixed it. but that seems like a lot of checks... From the code below - function Script:SetMode(mode) if mode~=self.mode then math.randomseed(Time:GetCurrent()) if self.debugMode then System:Print("AI mode set to: " .. mode) end local prevmode=self.mode self.mode=mode if mode=="idle" then local sound = self.sound.idle[math.random(1, #self.sound.idle)] if sound ~= nil then self.entity:EmitSound(sound,50,1,1,false) end self.target=nil local animationIndex = self.animation.idle[math.random(1, #self.animation.idle)] self.animationmanager:SetAnimationSequence(animationIndex, self.idleAnimationSpeed * Time:GetSpeed()) self.entity:Stop()--stop following anything elseif mode=="patrolling" then self.entity:GoToPoint(self.currentWaypoint:GetPosition(true), self.speed, self.maxaccel) self.isPatrolling = true local animationIndex = self.animation.run[math.random(1, #self.animation.run)] self.animationmanager:SetAnimationSequence(animationIndex, self.runAnimationSpeed * Time:GetSpeed(),300) elseif mode=="hurt" then self:EndHurt() elseif mode=="attack" then self:EndAttack() elseif mode=="chase" then System:Print("Now in chase mode") if self.entity:Follow(self.target.entity,self.speed,self.maxaccel) then System:Print("follow") self.followingtarget=true local animationIndex = self.animation.run[math.random(1, #self.animation.run)] self.animationmanager:SetAnimationSequence(animationIndex, self.runAnimationSpeed * Time:GetSpeed(),300) else System:Print("no path?") end elseif mode=="dying" then self.entity:Stop() local animationIndex = self.animation.die[math.random(1, #self.animation.die)] self.animationmanager:SetAnimationSequence(animationIndex, self.attackAnimationSpeed * Time:GetSpeed(),300,1,self,self.EndDeath) elseif mode=="dead" then local sound = self.sound.die[math.random(1, #self.sound.die)] if sound ~= nil then self.entity:EmitSound(sound,50,1,1,false) end self.entity:SetCollisionType(0) self.entity:SetMass(0) self.entity:SetShape(nil) self.entity:SetPhysicsMode(Entity.RigidBodyPhysics) self.enabled=false end end end
  25. Using a enemy AI script made by someone else - Heres part of the code that seems to be the issue for LE 4.0 function Script:EndHurt() if self.mode=="hurt" then if self.target.health<=0 then self:SetMode("idle") return end if self.health<=0 then self:EndDeath() return end if self.target.health<=0 then gets a NIL error when certain scenarios happen between GOOD/BAD Npcs killing each other. -- Attempt to index field "target" (A nil value) When I put 1 NPC of each Good and Bad to fight, its fine. As soon as I add 3 or more in a area - it gives the error. If i have separate battles far apart its fine.
×
×
  • Create New...