Jump to content

thehankinator

Members
  • Posts

    436
  • Joined

  • Last visited

Everything posted by thehankinator

  1. Training from Rick would probably help you most in the long run but if that isn't a possibility, we can go through some of this stuff one a time and create a tutorial like modification to the default scripts so that everyone can benefit.
  2. Are you looking to learn how to do these things yourself or looking for a volunteer? #1 Seems pretty straight forward. Are you using the default FPSPlayer script? #2 This is tricky, maybe translate to the side then rotate? #3 I have implemented very simple sneaking in the game I am working on. Basically I cast a ray (World:Pick) from the monster to the player, if it is unobstructed I measure the angle, I have mine check for ~120 degrees. If it is within that angle I set the monster to attack #4 This shouldn't be hard to do, if you are using the FPSPlayer script, you could take a look at the canUse variable. After the World:Pick, you could check a variable in the resulting entity to see if it is a note or something else.
  3. Seems unlikely but has anyone confirmed what update Josh has applied to VS2013 Express? Looks like they are up to Update 4 (soon 5). I just applied it and it did make changes to the windows SDK. https://support.microsoft.com/en-us/kb/2829760
  4. Would it be possible to somehow alert the user if you have a name entered that matches multiple entities? Maybe highlight the box in red or something. Could be a potential pitfall if someone doesn't know there is an entity with the same name or know this behavior.
  5. That's exactly it, thanks. Stupid copy paste.
  6. I've got the below code: local t = {} local e = {} local i = 100 e.val = i table.insert(t, e) for k,v in pairs(t) do System:Print(tostring(v.val == i)) if v.type ~= i then System:Print("false") end end The output is: true false I wouldn't have thought that I'd see the "false" print after a "true". Any idea what I am missing? It's got to be something simple...
  7. thehankinator

    What's Next

    Any idea what the start date for the summer tournament will be?
  8. This type of documentation problem isn't limited to the subject I presented in this thread. Take Context::DrawRect for example. It has an optional argument for style which is a 0 by default. What does 0 mean? I suspect there is a constant some place but without access to the C++ source I have no way of determining what style means or could be(without brute force checking every possible value). Same with the class id, these constants need to be in the API documentation for those who do not have (or want) access to C++ headers. Some things do have the constants defined like collisiontype argument for Entity::Pick but there is not a link or blurb of text that points the reader to the Collision class documentation. MSDN is a great example of how the API could be documented, each argument of a function that takes a constant has every acceptable constant listed and described. While it'd be nice to have that kind of detail I think it would be acceptable to simply have a link to the page that has all the constants defined(not the value but what the constant means) that apply to that particular function or argument. As someone who is a programmer by trade this has tripped me up more than once guessing how to test the result of a return value or possible values of an argument.
  9. Thanks! This is exactly what I was looking for. If the reference page wont be updated, someone should put this info in the comments section (It doesn't look like I have permission) or at least a link to that thread.
  10. Of course I figured it out soon after I posted this. It's missing from the documentation but apparently you can do something like: if entity:GetClass() == Object.SpotLightClass then blah blah end The lua example is somewhat misleading in that it uses a magic number of 2 to check for a model class. It'd be better if it used Object.ModelClass instead. Also maybe list these as members of Object so we know what class ids we could check for. Or maybe it's there and I am looking in the wrong spot?
  11. I'm looking at Object:GetClass() ( http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/object/objectgetclass-r19 ) I'd like to use this function to determine if an entity is a light. Is there a constant some place that these numbers are defined? I know I could find out what the magic number is for say a SpotLight but I have no way of knowing that the value for SpotLight would not change in a later release.
  12. shadmar: This is perfect! Thank you! I was able to load the animations from LE3 crawler then extract the frames that contained the walk animation as "Walk". This will fit my game so much better. I was using a zombie which just didn't fit the mood I am shooting for. beo6: It has a run animation but no walk. See attached screenshot
  13. Those pillows would make a great prize for some sort of competition...
  14. I found some old sites that talked about the crawler for LE 2 had one but what came with LE 3 does not. Anyone have one by chance? I tried ripping one out of the zombie DLC but that was mostly a disaster
  15. Not sure what happened but I got an update for game player and now it is no longer in debug mode, everything working perfectly!
  16. My game appears to be working however it is in debug mode. Is that by design?
  17. I've published The Hankinator's Fun House.
  18. I think I remember I had problems with Math:Random also. I ended up doing some thing like the below: In App.lua:Start(): math.randomseed(Time:Millisecs()) Where ever you need a random number: math.random(min,max)
  19. In the code below self.time_elapsed will contain the time in milliseconds from application start to when the item touched: Script.time_elapsed = -1 function Script:Collision(entity, position, normal, speed) if self.time_elapsed == -1 then self.time_elapsed = Time:GetCurrent() end end
  20. I have an object that detonates, when it does it applies force to all objects within N range. It seems like the force isn't applied to the player unless it is moving. If the player is standing next to the object completely still when the force is applied, nothing happens. Once I move the mouse or press a directional button the force is applied and the player gets pushed. I am using the stock FPSPlayer script with the below snippet for applying the force. Does a player come to a resting state or something when they stop moving? function Script:Detonate() if self.enabled and self.state < 2 then self.state = 2 local neighbors = GetEntityNeighbors(self.entity, self.radius, true) local self_pos = self.entity:GetPosition(true) local i = 1 while neighbors[i] ~= nil do if type(neighbors[i].script.Detonate)=="function" then neighbors[i].script:Detonate() else local neighbor_pos = neighbors[i]:GetPosition(true) local dist = neighbor_pos - self_pos local force = self.force * (1 - (dist:Length() / self.radius)) neighbors[i]:AddForce(dist:Normalize() * force) end i = i + 1 end self.entity:Hide() end end
  21. Damn, I had saved it after I got it working. I'll keep things around next time. How do you rebuild the dependencies?
  22. The player is the prefab that comes with LE(although I did add a weapon). I have deleted the pivot and created a new one then added the script. Thinking about all this, I tried deleting the player entity from the scene and re-adding it. This cleared up the issue! I guess I should have tried that hours earlier. Thanks again
×
×
  • Create New...