Jump to content

lxFirebal69xl

Members
  • Posts

    333
  • Joined

  • Last visited

Posts posted by lxFirebal69xl

  1. Is this more about sound than visual? A decent way to handle this could be using http://www.leadwerks.com/werkspace/page/api-reference/_/world/worldforeachentityinaabbdo-r66

     

    Use the players AABB which there should be a function in the Entity part of the documentation and then just add to it's values to make it larger when running/walking and smaller when sneaking. The function itself will return all entities in the bounding box you provide it. You can then loop over all entities and if one of them is a monster alert it.

     

    The thing is we are giving you basic ideas and not typing the code for you. Are the basic ideas all you need or do you need actual code typed because you find it hard to translate a design we tell you to actual code?

     

    I kind of understand what you're saying with the AABB thing, but just like I told hankinator, I have no clue how to actually use the code, I can see where you going with it, but I think I would much rather have the script written down for me, otherwise I will never get past this anytime soon :P

  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.

     

    Both really, I want to get into scripting, but I'm only able to do simple stuff at the moment, that's why I started this thread, to hopefully get help from people, I mean, if someone wants to just make a script for any of these things for comunity use, that would be cool too. Because the problem is, while I do understand what you're trying to say for all of the mechanics I'm trying to implement into my game, I have no clue how to go about it.

    But thank you anyways, for giving me another perspective on them.

  3. Ok, so the purpose of this forum thread to to get some general help with any type of mechanic a user with bad programming skills might need for their game, think of it as an add-on to the tutorials :)

    I myself have been having a bit of trouble with a couple of things. As you might know I'm in the process of making a game called "A Demon's Game", it's a horror game so it needs some mechanics that I myself haven't been really able to work out that well which are...

     

    1)Battery system, seriously, I have been battling this for the longest time and I can't figure out a good way to make a system whereas the user has a bar, or a countdown number that indicates how many seconds the flashlight has left, then it shuts off and can't be turned on untill another battery is picked up. Any help with this would be amazing.

     

    2)Leaning/peeking, this one shoulnd't be too hard to make, all it is is camera manipulation whenever the user presses Q or E. But alas, I'm too dumb to figure out this for myself :(

     

     

    3)Sneaking, yea, this one is a though one, imagine sneaking from thief or dishonored but in a more simple way, whereas the player crouches and the monster's visibility is lowered or something that would do the same effect.

     

    4)Something that is really simple, if you've played vectronic, you would notice the reticle when you're playing looks like these 2 lines that used to form a square but with a slice down the middle, I would like to make something similar to that, a reticle, maybe even have it change depending on what the player was looking at, for example if the player looked at a note, the reticle would change to a magnifiying glass and when the player looked around normally it would go back to the default one.

     

     

    Sorry if I seem a bit hopeless with this post, but programming is the only thing that I'm not good at, so I would greatly appreciate some help!

    Cheers!

    • Upvote 1
  4. You can create a database for all those variables. Sqlite 3 for example..

    Or if you are working in c++ you can use mssql or something like that

     

    You saying that gets me nowhere because it's the same if someone spoke chinese to me :P

    I am not working in c++ though.

  5. One more thing. If you want to save a list of different points into a file you can make it like this:

     

    first points=12

    second points=25

    another points=72

     

    And then when you read the files to get points you can find equal sign and split string by it. Use default Lua functions like this one for that: http://www.lua.org/manual/5.3/manual.html#pdf-string.sub

    It will be like this: you open a file, read a first string, get this value: "first points=12". Then you loop through all symbols in the string looking for "=" and take everything after it. And it will be your first points value.

    I do it like this for stats of weapons stored in a file.

     

    Thanks for the in-depth look at the files and how the work

  6. Allright, so I think I got everything set up.

    Now, how do I make so that either when the player finishes a level or picks an item up, a texture is drawn with text on top of it saying (example) "Notes found 2/4"

  7. I had a similar idea recently from playing all your guys' games. Like, having a standard display at the end of the game that shows secrets found, enemies killed, etc. Sounds fun and it adds to replayability.

     

    Josh knows what's up! This is exactly what we need!

  8. I think global values won't be deleted when you change the level as they are not tied to any entity in the world. So what I wrote should work across levels. If you want to store points between game launches, then you can write it to a file. Do you want that?

     

    Yeah, pretty much...

  9. what's the problem?

    
    

    Script.points=1 --int "points"

    function Script:Use()

    points=points+self.points

    end

     

    The problem is that I want it to be across all levels tongue.png

    I figured out this much myself.... XD

  10. I've recently been battling this one and I think it would be awesome to do and then put it out there for everyone to use, I mean, a point system is common in a lot of games, and while I still haven't been able to do it quite like I want it to be, I do have some ideas as to how I want it to look.

     

    It should work in a simple way, you click the object and the number of points show up before disapearing, then showing a total of how many points you have at the end of the level.

     

    Example:

    1YgkbRy.jpg

     

    Help would be appreciated :P

  11. That is caused by the fact that the script is trying to run the "Attack1" animation and your animation is named "Attack 1". So it doesn't find the animation and just hangs. Also the default script will randomly choose between multiple attacks, so rename all of the attack animations as "Attack1", "Attack2", etc...

     

    This updated script that uses the sequence name is a great improvement over the previous one that used the sequence number in my opinion because I think this makes it obvious what animation you are trying to set, but perhaps the default script needs a way to perform a check to see if the animation actually exists prior to setting it.

     

    Thank you very much, that fixed it!

    • Like 1
  12. Allright, I got him running at me correctly, thank Macklebee for the help!

    But there's another thing, whenever the monster touches the player the game freezes and I have to terminate it. What's up with that?

    • Upvote 1
  13. Have you built a nav mesh?

     

    If I hadn't, the crawler woulnd't chase me on the video :P

    mosterai.lua calls animations by name, like "Run", "Idle", "Death" and "Attack"

    I think you might have to rename your sequences or edit the script to match the sequences.

     

    Most of the animations already have that name, check the picture. But the real issue is that NOTHING happens, even if the animations don't play, the monster should chase me, but he doesn't. That's the real issue here.

  14. I think even without the animations something should happen. In the script dropdowns is he set to Team Bad? It looks like he might be set to neutral or same as player Good.

     

    He is in team bad.

     

    I don't use lua, but can't you just change the sequence to the one you want

     

    Or do you need a one shot animation?

    That's not the issue, the issue is that his animations aren't changing because he isn't recognizing the player. In the video, both monsters have the same script, so why do they behave differently?

  15. So, today I finally got an animated model in leadwerks. It looks good and the animations play without a problem. So I thought, "I'll just put the MonsterAI.lua script on him and see what happens". Well what happens is that he does the Idle animation on an infinite loop. And I for the life of me cannot figure out how to fix this.

     

    Yes, I've extracted the animations and everything, it's just that I can't wrap my head around this. Any help would be greatly appreciated!

     

     

    Both monsters in this video have the same script unchanged.

    I also remember that the Monster AI script needs to have the animation names set in correctly, but I have no clue how to see if they're right or not, I just named the model's animations exactly like the "Crawler" animations and hoped for the best.

     

    post-13811-0-34818600-1426629829_thumb.png

×
×
  • Create New...