-
Posts
245 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Slimwaffle
-
I am wondering what the correct way to use this Undocumented command is? I am trying to make digging scripts for my game. I will post the code here. If I use SetElevation I get an error saying argument 5 needs to be a boolean and if I use SetHeight nothing changes and the game crashes. Getting the elevation works fine setting it is the issue. I want to be able to raise and lower the ground in game.
-
damn thats a shame. I would really have loved to be able to port the current project
-
ohh can't wait for p2p multiplayer. My current project would greatly benefit from a multiplayer mode that doesn't require server hosting.
- 9 replies
-
- multiplayer
- online
-
(and 1 more)
Tagged with:
-
I was wondering if someone could help me out. I will provide the script. But for some reason enemies even when set to team id good and are not in an attack state are causing damage when walking into the collision box of their arms. HumanAI.lua
-
ohh thank you soo much. Yeah I can see everything but can't open or extract it without the password.
-
ok cause when I open the zip without using the game it lets me straight in. Is it like a only my pc can do it thing?
-
So I have noticed that when I publish my project as standalone it puts everything into a zip folder with all of my scripts, code and assets available to the user. When playing other games everything is encrypted into .bin files and what not. I want to release this game on steam and then later on, on xbox one. How do I go about encrypting the files? Or is this something steam does after I upload it?
-
ohh thanks heaps I didn't even think of that
-
So I was finding that delaying things for x amount of seconds was way harder then it needed to be. And I wanted to be able to make things trigger at set times. So I made a simple script for an in game clock. I am going to post it here for all to use. If you can't get it to work just remove the code that loads and draws the clock.tex file to screen. hours and minutes are globals. So you will be able to reference them from your other scripts. Clock.lua
-
Thanks mate much appreciated. I will look these over now.
-
So I have some odd questions that I feel like might be aimed out the more advanced members of our community. I had some ideas for the project I am working on and just wanted to see if they are do-able. First Idea; Is there some kind of parameter for detecting if an entity or location is located in shadow? I was thinking it would be cool to make enemies spawn out of shadows. Second Idea; Pretty much the same thing as number 1 but for detecting if light is being cast on an entity. So I could make it that; If player is in direct sunlight then hunger and thirst reduce at a greater rate and apply heatwaves to the screen. Last Idea; What is the correct method for getting the terrain height? Is there a way I can set terrain height at location while playing the game? So that the player can hold a button to bring up an overlay to show terrain elevations and then use a second button to raise or lower the terrain. So they can dig raise or flatten ground similar to the way life is feudal does it. Note; I tried getting the terrain height using code from other forum posts but kept getting error messages and couldn't figure it out.
-
Thanks mate. I am almost at the point with this thing where I can just build the map.
-
Thanks mate. I am just going to do bars for now. And re-address this circle thing after getting this game more built. But I will let you know how I go and you were 100% right swapping back to bars fixed the fps drop. Running back at 60 fps now. Got it looking like this for now.
-
Is there anyway to draw a circle without doing this? The only shape I could find in the API was DrawRect.
-
Hey guys. I need help again. So I rewrote the scripts for my HUD to look a little nicer. Using Circles instead of bars. And for some reason I am getting crazy FPS drop. With bars I was able to sit at 60fps very comfortably but using circles I drop to between 5-10fps. Can someone please help? I have looked over the code and can't figure it out. As usual I will provide the code and a screen shot. This fps drop happens even when only using one of the new scripts. Hungerbar.lua Health.lua ThirstBar.lua Staminabar.lua
-
hmm interesting. I will look into it. I am hoping to keep the minimap. Its a really nice feature. I may have to change the way enemies spawn in then if I can't fix this.
-
I have two scripts for AI. Doesn't matter which I use I get the same problem with both. No matter how low I set the sight range and hearing range enemies will target me anywhere on the map and move towards me no matter the distance. Here is the script I have mainly been using. HUD AI.lua
-
The methods I have been using are; Importing the second script, Making variables global, and using a pick to get the value. The method varies depending on how you want the code to work. If you want the script to attach to multiple entities but the functions to be per entity I find the best way is using a pick. And if I want to add multiple scripts the best method I have seen is using pivots and making them children of the entity.
-
Thank you soo much mate. After looking this over I was able to rewrite my own code and get this working perfectly.
-
So I am wanting to know how I go about showing different panels based on the item selected in the tabber widget. So basically if I select the buildings2 tab it shows a different panel that is blank. Because right now it shows the same panel regardless of what I choose. I will post the code I have. --Create a Crafting panel (CRAFTING SCREEN) widget = Widget:Tabber(indent,indent,craftingpanel:GetClientSize().x-indent*2,craftingpanel:GetClientSize().y-indent*2,craftingpanel) widget:AddItem("Buildings1",false) widget:AddItem("Buildings2",false) craftingpanel:SetObject("backgroundcolor",Vec4(0.15,0.15,0.15,1)) GameMenu.tabber = widget local indent = 12 cpanel = Widget:Panel(indent,indent,widget:GetClientSize().x-indent*2,widget:GetClientSize().y-indent*2-30,widget) cpanel:SetBool("border",false) cpanel2 = Widget:Panel(indent,indent,widget:GetClientSize().x-indent*2,widget:GetClientSize().y-indent*2-30,widget) cpanel2:SetBool("border",false) cpanel2:Hide() GameMenu.cpanel={} GameMenu.cpanel.general=ipanel GameMenu.closecrafting = Widget:Button("Close",widget:GetClientSize().x-72-indent,widget:GetClientSize().y-28-5,72,28,widget) local y=20 local sep=40 --CRAFTING TAB START Widget:Label("Wood Buildings",20,y,200,16,cpanel) y=y+16 GameMenu.wbase = Widget:Button("Foundation",10,y,80,30,cpanel) GameMenu.wwall = Widget:Button("Wall",100,y,80,30,cpanel) GameMenu.wroof = Widget:Button("Roof",190,y,80,30,cpanel) GameMenu.wdoorway = Widget:Button("Doorway",280,y,80,30,cpanel) GameMenu.wwindow = Widget:Button("Window",370,y,80,30,cpanel) y=y+sep
-
One that I think would be a great one to implement. Is a global save and load script. That works similar to WorldUpdate(). To basically get the entire world state on save and then return it when loaded. And thanks heaps mate. I will definitely get use out of it. I will most likely continue to use it on new projects until a better system is implemented straight into the engine.
-
I have this working perfectly now. Soo Frigging Happy Thanks so much guys. Now It is setting a unique name each time it calls the save function. Here is what the code looks like in case anyone is wanting to do more with these scripts. You Just need to create a global called count1 somewhere with a value of 0. function Script:SaveData() count1 = (count1 + 1) txt1 = (tostring(count1)) System:Print(txt1) prefab = self.entity:GetKeyValue("prefab") self.entity:SetKeyValue("name", txt1) name = self.entity:GetKeyValue("name") pos = self.entity:GetPosition() rot = self.entity:GetRotation() local entityTable ={} entityTable.name = name entityTable.posx = pos.x entityTable.posy = pos.y entityTable.posz = pos.z entityTable.rotx = rot.x entityTable.roty = rot.y entityTable.rotz = rot.z entityTable.prefab = prefab System:Print(name..' Saved') return entityTable end function Script:LoadData(data) r1 = data.rotx r2 = data.roty r3 = data.rotz p1 = data.posx p2 = data.posy p3 = data.posz self.entity:SetRotation(r1,r2,r3) self.entity:SetPosition(p1,p2,p3) System:Print('Entity Loaded') end
-
Yeah breaking them up was the easiest option. Right now I am trying to figure out how to use ToString() properly. because txt1 = count1:tostring() That didn't work. With count1 being my global number.
-
So I fixed pos and rot using this set up. I still have yet to try the name thing. function Script:SaveData() prefab = self.entity:GetKeyValue("prefab") name = self.entity:GetKeyValue("name") pos = self.entity:GetPosition() rot = self.entity:GetRotation() local entityTable ={} entityTable.name = name entityTable.posx = pos.x entityTable.posy = pos.y entityTable.posz = pos.z entityTable.rotx = rot.x entityTable.roty = rot.y entityTable.rotz = rot.z entityTable.prefab = prefab System:Print("Object"..name.. "At" ..rot.x) return entityTable end function Script:LoadData(data) r1 = data.rotx r2 = data.roty r3 = data.rotz p1 = data.posx p2 = data.posy p3 = data.posz self.entity:SetRotation(r1,r2,r3) self.entity:SetPosition(p1,p2,p3) System:Print('Entity Loaded') end
-
I adjusted the code to look like yours above. And rot and pos keep throwing nil values.