Jump to content

MisterGravity

Members
  • Posts

    88
  • Joined

  • Last visited

Posts posted by MisterGravity

  1. Please note, I'm still very new at the Lua scripting. I'm trying!

     

    Using nate066's Jump-Pad tutorial script located here, I tried to use some skills I learned from Rick in his Teleportation tutorial located here.

     

    Specifically, once Rick implemented the teleporter pads, he created a couple of Pivots in the scene to hold the Noise.lua scripts. I learned that a function Script:Whatever could be called in the Flowgraph Editor to call outputs, like this:

     

    self.component:CallOutputs("TriggerEnter")
    

     

    Which would let him use it in the Flowgraph Editor, like this:

     

    tumblr_mzdjp3VfXA1qk5t55o1_400.jpg

     

    So what I did was, I tried to use that knowledge to edit the Jumppad script to also be able to call a similar Pivot when the collision occurred. The problem (and it's not really a problem, it just wasn't conducive to what I wanted to do,) was that the JumpPad's action was all happening in the function Script:Collision area of the code. My assumption was that I could remove what made it work and put it in it's own function instead, and then use a "CallOutput" to be able to use it in the Flowgraph Editor too.

     

    This was what I was hoping would work, but does not.

     

    tumblr_mzdjwtk8Rt1qk5t55o1_400.jpg

     

    And this is the code as it was when I altered it:

     

    Script.JumpForce = nil --vec3
    Script.SelectiveCollision = false --bool "Selective Collision"
    Script.ColObj = nil --Entity "Collision Object"
    
    function Script:Start()
     self.source = Source:Create()
    end
    
    function Script:Collision(entity, position, normal, speed)
     if (self.SelectiveCollision == true and entity == self.ColObj) then
    	 self.source:Jump()
     elseif (self.SelectiveCollision == false) then
    	 entity:AddForce(self.JumpForce)
     end
    end
    
    function Script:Jump()
     self.component:CallOutputs("Jump")
     self.ColObj:AddForce(self.JumpForce)
    end
    

     

    Does anyone have any thoughts on this? And nate, this was not intended to sidestep you or go over your head. You and I had talked together on trying to encorporate sound directly into it, but I thought I'd take it public since I'm now trying to add in pieces of Rick's project as well.

     

    Thanks everyone!

  2. Yes, in the script link in your gun/hand and add before and after render() .., something like this :

     

    gun:Hide()
    App.world:Render() -- render to buffer your pivots matrix
    gun:Show()

     

    Yep, I bet that is going to do it. Before you give me any answers on how to link in my gun/hand, let me try to figure that out on my own. I'm getting better at Lua by the minute. :)

  3. Hey dude THANKS! Love fast replies and this reply makes me feel confident. My goal is to make an open world survival game. I know there are quite a few out there but hey you never know if I can make it work! Do you think this engine can handle making a HUGE world, probably the size of an elderscrolls type game? Im going to start off with small maps first, with a good set of quests just for the first test run of a game. Once I make a few games that last about an hour long each then will I moveo n to bigger deals. Have to start off small. But yeah, I really do want to get this engine, Unity seems like it will break my wallet and that I wouldnt use all that it offers or idk. I honestly have no idea. I just want to make video games. XD

     

    I'm glad that helped you. I had similar questions right before I purchased the engine a few days ago. I didn't particularly ask about a game the size of Elder Scrolls, but I did have questions about replicating the ideas behind a Serious Sam game, which of course uses VAST areas with ENORMOUS numbers of enemies on the screen at a time.

     

    Feel free to read the conversation I had on Steam here:

     

    http://steamcommunity.com/app/251810/discussions/0/630800447046789935/

     

    Additionally, this is what Leadwerks can do for example with a large number of characters on the screen at a time:

     

  4. I can't answer all your questions, I'm still a 4-day old myself at this engine. One thing you're going to need is the drive and motivation to learn it. I'm pestering the **** out of everybody on the forum to figure things out, but hopefully they think I have decent questions in my quest for clarification.

     

    That being said, everything requires a learning curve, and this engine is no different. There are indeed tutorial maps included in the engine that teach you things like drawing rooms, making elevators, a couple of kinds of doors, moving platforms, buttons and switches, timed events, etc. Most of those things don't require programming or coding in themselves.

     

    After you get the basics of map design down, you'll start watching more complex tutorials that do involve some coding. Every video I watch teaches me something new. Just today in fact, I learned how to disable the camera that comes prebuilt with the fps player script and use my own, giving me more options with the camera effects. I learned that you can edit scripts, make your own, and pretty much code anything you can figure out. Don't like the options with an included script? Think it needs more options? ADD THEM, CHANGE THEM. This engine has all the potential in the world to make the game you want.

     

    So will it teach you how to code? Not directly. But can you learn by having something you want to try? Absolutely. Like I said, 4 days into it, and I'm so much farther ahead than the day I started it's unreal. I can scarcely imagine what I'll know 4 days from now.

     

    That's all the information I can offer you. I haven't gotten into models outside the engine yet, so I'll let someone else pick it up from here.

    • Upvote 1
  5. I'd be interested in seeing your implementation.

     

    I'll make a video and or write out exactly what we did. Rick is a brilliant, brilliant guy. Josh, now might be a good time to BEG you for a "point to" feature. As in, this light should point to that spot. Or that pivot should point to that spot. A simple static point to would be fantastic. A dynamic following pointer would be the bee's knees. All this guess work on in a three-dimensional plane is exasperating.

     

    You know, now that I think about it, is there a way to get the x,y,z coordinates of a location, like where your mouse pointer is, and then put that in a "point to x,y,z" of a light or pivot? Is there already an easier way than the rotate buttons, test, try again, test, try again...etc.?

  6. You only want 1 camera ever in your scene (for the most part). This script will take your camera, move it to the pivot, take a "snapshot", then restore where it was all before you know it even did it.

     

    Okay, I'm soooo almost there. I replaced the camera I placed in the scene with a 2nd pivot, and when I run it, I see what "I see", as in my first person camera on the screen. How can I point the camera/pivot if it doesn't have a cone like lights and cameras do?

  7. For the tracking pivot variable, just place a pivot in your scene. The pivot has a position and direction (you can rotate it). The position & direction the pivot is pointing, will be where the camera gets placed so it's what the camera will see. You'll probably have to play around and trial and error get get the perfect direction it's pointing at.

     

    The main camera is the camera. Place a camera in your scene and drag it to this parameter

     

    RenderToMaterial can be any material. I believe whatever is used in the material as the texture gets overwritten anyway.

     

    I got that far, but the thing is, when I bring a new Misc / Camera into the scene, it becomes what I see all the time when I run the game. I lost my first-person-camera eyes when I walk around. How do I get that back, but keep the rest of it working? (The camera I placed IS displaying what it sees on the screen I setup, I just lost my own first person viewpoint.)

  8. To be fair Shadmar made that script smile.png

     

    Do you think Shadmar or anyone has an example project I could download on this? The script is a little vague on the first three variables.

     

    Well wait a minute now, I've been playing with it and I what I've done is point a camera straight down over an area, and then display that on a screen. Unfortunately, I can't see my first person camera anymore. I just see my hands carrying a gun around from a top down view, which is a little weird.

     

    How can I still see what I need to see first person, but the camera view be the one I've setup?

  9. So I have an invisible brush being my collision trigger when I walk into a room to play a certain sound, but as long as I'm "in" the trigger, it's starting over and over and over immediately. I need it to call the sound, and immediately stop being a trigger... forever. NOTE: I need to stop the trigger, not the sound. The sound may be more than 1 second, it may be a short 30 second music interlude.

     

    I've attempted to do this, but it doesn't work:

     

    tumblr_mzav87k8qI1qk5t55o1_500.jpg

     

    This doesn't work either. There's a timer in between the collision trigger and when it disables the collision. Anyway you look at it, I can't seem to stop the collision trigger.

     

    tumblr_mzav87k8qI1qk5t55o2_500.jpg

     

     

    Ideas?

  10. In case anyone was wondering how it was finally accomplished, here it is for future reference:

    • You can use the elevator floor itself as the "parent" object in the Scene tab, so choose these options once you've drawn the elevator floor.
      • Physics Tab:
        • Physics Mode: Rigid Body
        • Shape: Box
        • Mass: 10.0 (or greater than 0)
        • Collision type: Scene
        • Swept collision: False
        • Nav obstacle: True

        [*]Script Tab:

        • File: SlidingDoor.lua
        • Enabled: True
        • Move speed: 2.0 (or greater than 0)
        • Manual activate: False

      [*]For the walls of the elevator, (or anything else attached to it,) the trick is to give it a script, even an unimportant one, so it does not become "part of the scene" when the game is run, therefore causing it to become invisible.

      • Physics Tab:
        • Physics Mode: Rigid Body
        • Shape: None
        • Mass: 0.0
        • Collision type: Scene
        • Swept collision: False
        • Nav obstacle: False

        [*]Script Tab:

        • File: Noise.lua <-- This is giving it any script at all to work properly

    • Upvote 1
  11. I think the door script is more convenient, if they are just going between two points.

     

    That's what I was thinking too, I just wondered what most people did. Thanks for the clarification.

     

     

    I love your little elevator switch. I don't know what the second one did,

     

    So I took the elevator to the outer part of the map and jumped off the map (more like flew off) when jumping to the other room. I looked at your jump force and it was at 28. It made me giggle.

     

    I wasn't expecting that

     

    Lol, glad you had fun. Actually, the high jump rate and "take no damage from fall" was so I could quickly jump around and look at things. The second switch pushes the barrel out of the way of the elevator to get rid of the "trash" entirely. I added a lot more to that switch, and through a series of "pushes", well... you can see what happens.

     

    • Upvote 1
  12. Traditionally this is done by just moving one, non collider, brush along an origin - the lift etc. is then added as a sub model e.g. the model itself which does contain collision's.

     

    Sorry, let me see if I can break that sentence down for someone who's only had Leadwerks for 3 days...

     

    Traditionally, this is done by just moving one "non collider", (as in the floor of the elevator which has no collision? [even though it needs collision?]), brush along an origin (what is an origin?), the lift etc. is then added as a sub model (parent/children in the Scene layout,), e.g. the model itself which does contain collisions (the parts of the elevator.)

     

    So what I'm hearing is that aside from the 4 pieces of the elevator, (the floor, the 3 walls,), I need a fourth piece that has the collision of NONE, and each of the pieces of the elevator are children of that? And that fourth piece with colllision of NONE is the one with SlidingDoor.lua script attached to it, but nothing else is?

     

    If that is true, does the no collision piece wrap around the other four pieces like a box, or can it be just a little 1x1 block doing the "parenting"?

  13. First off, your map is really cool. I'm really super happy to see this level of interactivity so early, it's really encouraging.

     

    When bushes are loaded in a map, the engine collapses them down into merged static geometry, if certain conditions are met. If the brush has 0 mass, no script attached, and some other things, it is assumed the user wants it collapsed. In your case, of course, this was wrong.

     

    Rather than keep guessing, and having to add more and more conditions in the future, I should probably add a checkbox in the editor so the user can control whether it gets merged or not. I'm sorry this slowed you down. Your map is pretty interesting to explore already.

     

    One thing you could do immediately is add an empty script to each child brush. This will prevent the brushes from being merged, but won't add any behavior to them.

     

    First, thanks for responding Josh.

     

    But, that was kind of clear as mud. Let me see if I even have a vague idea of what you mean. What I did was, under Assets, Scripts, I created a new script called "Nothingness", and deleted all the base code out of it. Then, I attached Nothingness.lua to each of the pieces of the elevator, and gave them mass. Of course since they are still child objects of the original object, they're script isn't "sliding door" so they should just slide WITH the parent object. But, they don't. In fact when I run the map, they vanish off the screen. They're there for a split second, but they then vanish.

     

    One thing I really loved about Hammer was it's "Group" function. Grab any number of objects in a scene, hit Group, and BAM, done. They're all one item now. I have been fighting for HOURS to simulate that in Leadwerks, and even after your response, I don't know how to fix it.

     

    Bottom line, how do you get multiple objects to move at the same time? I see it happening one of three ways.

    1. You draw several objects, and your trigger activates ALL those objects separately, but at the same time. This is what I was doing before I had this problem, but as indicated above, they get out of sync. Literally, they move at the same speed and do the same things, but if you watch them, this wall is faster than that wall. It defies comprehension.
       
    2. You draw one object, like the floor of your elevator, then you add 3 walls as children to the parent (floor). The children have no mass, they have no script, and behave just like the parent because they're attached. This seems simple to me, and yet this is the idea I've fought with all day.
       
    3. You grab several objects and click "Group", (just like Hammer), and then that single glued-together item has a script attached to it. Unfortunately, this does not seem to be possible.

    Maybe I'm making it harder than it really is?

     

    Maybe I'm oversimplifying it so much it's not clicking. I just... don't... get it.

     

    By the way... thanks for complimenting the map. While I was waiting on a response to the elevator issue, I added something completely useless to the map. Without further adieu...

     

×
×
  • Create New...