|
Guys, I know the object was deleted . When I read about them at first, I thought it was like I created the prefab as an asset, and could just use it like a template. Then I found out that apparently any component that I want to use to instantiate a prefab needs to be given it as an actual GameObject. I'll say I'm not entirely convinced I'm doing this right. After having slept on it, I'm just assuming I was using the original handle for everything when I should have been using the returned one from Instantiate.Onion Knight posted:If you're got a GameObject with a component holding your ItemClass instance, on collision pass the instance to your inventory List and destroy the GameObject. I have the actual inventory management with containers all complete. There is no problem here. The issue is in the object lifetime: 1. Create original GameObject that gives itself to the player when they collide. 2. When given to itself, it provides a interface of itself as an item so that the game can have it do its then when told to use an item, and how it would be drawn as an inventory item. It also includes something about what to do when the player drops it. 3. When the player drops it, it regenerated itself as a GameObject. I was doing this by trying to retain the original GameObject and have that regenerate, but I deleted it when I removed it on the initial collision. dizzywhip posted:There are a lot of ways to tackle this, but if you just want to temporarily remove the game object and put it back later, use the SetActive method to disable and re-enable it as needed instead of destroying it. I didn't know about that method, so I will try that one tonight. That would dodge the Instantiate/Destroy problem.
|
# ? Nov 20, 2014 18:02 |
|
|
# ? Apr 25, 2024 12:37 |
|
I think I can clarify really that inventory management itself isn't the problem. I think my problem is with the limitations and usages of prefabs. I could restore the item as a drop in the world by building it up from scratch and stuffing all the components back in; I might as well just make a dedicated method for doing that. They were just making prefabs out to be some magic to get that out of the way. All it really looks like to me is a GameObject in my assets that I can drop into components at startup. So when I first heard about the, I thought they were doing something like being a template builder that I could use to poop out copies of the GameObject.
|
# ? Nov 21, 2014 17:23 |
|
Set it to enabled = false or whatever, it'll become invisible and stop updating, then turn it back to enabled = true.
|
# ? Nov 21, 2014 18:05 |
|
Rocko Bonaparte posted:So when I first heard about the, I thought they were doing something like being a template builder that I could use to poop out copies of the GameObject. You can do this, you just feed Instantiate() the prefab and use the GameObject copy it returns. It's kind of a pain in the rear end because you either have to find the prefab you want (potentially a huge pain) or make a public variable and set it in the inspector to point at your prefab (a smaller pain). Or I supposed if you want to clone a specific GameObject that still exists, you could use that, but that doesn't sound like your situation.
|
# ? Nov 21, 2014 18:32 |
|
What's a good way to manage a largeish AI? Specifically in Unity. Most of the AI/enemy scripts in my game are simply just the one script that ultimately inherits from MonoBehaviour. But I've finally gotten to the point of designing the end boss and it will have several attacks and abilities most of which will, while they're active, require lots of book keeping variables and it seems like it'll be an error prone mess to just throw that all into the one script. I could make each attack its own script and that would be much cleaner and easier to follow except each attack needs to have access to most of the member variables of the core boss script. I don't like the thought of making them all public and passing them back and forth as often as necessary would quickly become a pain in the rear end. If C# had friend classes I could use that but it doesn't. So I'm left unable to think of a solution I don't hate. Either one giant mess of a class, make most of the variables public, or pass a large amount of data to each state when it's started. Are there any better options I'm missing?
|
# ? Nov 21, 2014 18:58 |
|
Just uploaded a new Mono for Unreal Engine buildquote:* Fixed hot-reloaded classes not getting garbage collected I also uploaded a sample too. I have no idea how it works... but hey, the download is a-okay . If you already signed up, you can download it from the same link you got in your email. If not, sign up here
|
# ? Nov 21, 2014 23:49 |
|
Hi Spek. I think you should go for the big mess option, and then refactor until it isn't a mess. Obviously I have no idea what your game is, but unless your class definition is thousands of lines of code I wouldn't worry about it to much. If you do want to break it up a bit more consider using a struct to wrap all your bookkeeping data and passing that to the state. Also partial classes may suit the same needs that you would be using friend classes for.
|
# ? Nov 22, 2014 08:31 |
|
Spek posted:If C# had friend classes I could use that but it doesn't. Nested classes should work. It's unrequited friendship but I've used it before for splitting up large classes in Unity.
|
# ? Nov 22, 2014 10:29 |
|
What arguments are there for using UnityScript instead of C# in Unity?
|
# ? Nov 22, 2014 22:36 |
|
Boz0r posted:What arguments are there for using UnityScript instead of C# in Unity?
|
# ? Nov 22, 2014 23:31 |
|
Boz0r posted:What arguments are there for using UnityScript instead of C# in Unity? "I want to give myself brain damage."
|
# ? Nov 23, 2014 00:35 |
|
Drastic Actions posted:Just uploaded a new Mono for Unreal Engine build Thanks, do you still build from the 4.4 source following the same instructions?
|
# ? Nov 23, 2014 00:41 |
|
Stick100 posted:Thanks, do you still build from the 4.4 source following the same instructions? Yeah. The version that gets uploaded there will only *technically* supports 4.4 (Nothing stopping you from trying with newer versions though, just not supported), so those instructions stay the same.
|
# ? Nov 23, 2014 02:27 |
|
nye678 posted:Also partial classes may suit the same needs that you would be using friend classes for. Flownerous posted:Nested classes should work. It's unrequited friendship but I've used it before for splitting up large classes in Unity. Thanks, a mixture of partial classes and nested classes is working perfectly for me.
|
# ? Nov 23, 2014 03:48 |
|
Spek posted:If C# had friend classes I could use that but it doesn't.
|
# ? Nov 23, 2014 05:35 |
|
https://www.youtube.com/watch?v=dsrZgmv23Yc Epic's put out the 4.6 preview video, which includes experimental 3D (world space) UMG widgets. They're moving so fast I barely recognize the UI system from six months ago. Also, built in demo recording via network traffic!
|
# ? Nov 23, 2014 10:50 |
|
Thats very exciting for me because I've got a 3D UI in my UE4 game but it's kinda poo poo because it's me just placing the meshes in the level and moving them in front of the camera every frame. Not that it doesn't work but it seems to lag behind the camera every frame or so and go jittery. Also I found 2D UMG to be confusing as hell (3D is unlikely to be easier) but find placing meshes with BP very straightforward and flexible My dream situation would be a separate 3D world with a transparant backdrop that was rendered on top of the game world
|
# ? Nov 23, 2014 18:56 |
|
echinopsis posted:My dream situation would be a separate 3D world with a transparant backdrop that was rendered on top of the game world
|
# ? Nov 23, 2014 18:59 |
|
I'm not sure how I would render the 2nd camera's "goods" on top of the game world e: Actually late last night I discovered "Movement components", I had no idea what they are and still have little idea. If they can be used to place an actor they might be more effective than simple setting the world location/rotation, as far as being tied better into the sequence of events of the game echinopsis fucked around with this message at 19:20 on Nov 23, 2014 |
# ? Nov 23, 2014 19:04 |
|
echinopsis posted:Thats very exciting for me because I've got a 3D UI in my UE4 game but it's kinda poo poo because it's me just placing the meshes in the level and moving them in front of the camera every frame. Not that it doesn't work but it seems to lag behind the camera every frame or so and go jittery. I have no experience with UE4, but to me that sounds like each frame you're moving the UI elements before moving the camera.
|
# ? Nov 23, 2014 19:20 |
|
BabelFish posted:which includes experimental 3D (world space) UMG widgets. I've just realised this means the 2D UMG widgets in the game world, not using 3D meshes in UMG Peewi posted:I have no experience with UE4, but to me that sounds like each frame you're moving the UI elements before moving the camera. Yeah, but I have no idea how to change this order. I tried to use a sequence so when the BP_Update_Camera function return node is called on the CameraManagerBlueprint (the official way to place/point a camera) that a sequence node 1st goes to the return and then calls a function on the HUD actor to move/face where it should, but beyond that I have no idea. I've even tried averaging out the location over a few frames but it makes it lag too much.
|
# ? Nov 23, 2014 19:23 |
|
I don't know anything about ue4 but in unity it's as simple as setting the order index on a camera, and setting the cameras each to only render the world / ui individually.
|
# ? Nov 23, 2014 20:26 |
|
Boz0r posted:What arguments are there for using UnityScript instead of C# in Unity? I originally learned Unity with UnityScript and I didn't really want to start over but I decided C# would be more useful to know. It took a couple hours tops to transition. A couple things take a little extra code but I think it's generally easier to write and troubleshoot C# by a large margin. I've probably saved dozens of hours by switching and now I'm actually familiar with a great language. So none. If someone presents an argument for UnityScript, it's probably wrong.
|
# ? Nov 23, 2014 23:19 |
|
I've been taking a class where we've been working in Unity. So far I think 60% of all of my debugging problems originated with Unity in some way shape or form. I think I spent 30 minutes figuring out why for some reason the X axis is shared for both analog sticks for the gamepad for instance. Or that my state controller can't seem to handle simultaneous states (spinning and moving). Though enough complaining, I have a question, if I have some sort of effect that I made in blender such as say a transparent sphere that emits a little or has some special effect, but Unity doesn't seem to wanna import it straight up. I assume I need to write a shader for that material right? Is it just Create C# Script > Write the shader > drag and drop onto the material in the inspector somewhere? The Unity docs seem bafflingly shallow on workflow.
|
# ? Nov 24, 2014 07:17 |
|
roomforthetuna posted:"I know Javascript, I don't know C#, and I would rather learn a smaller amount." This is the theory that I used, but it doesn't really transfer in practice. I found myself constantly having to look up or figure out the Unityscript way of doing things. It got maddening and I ported my whole project over to C#. It didn't take long, and suddenly I was able to use C# reference from anywhere, not just Unity-related docs. It's not quite the same for me, I already knew Java, but since Unityscript pushes you down that road, I'd say it makes more sense to go for C# every time.
|
# ? Nov 24, 2014 09:42 |
|
Raenir Salazar posted:I've been taking a class where we've been working in Unity.
|
# ? Nov 24, 2014 10:54 |
|
SupSuper posted:There's an explicit "Create Shader" option. If you already understand shaders, this should help you with the Unity-specifics: http://en.wikibooks.org/wiki/Cg_Programming/Unity/Minimal_Shader Thanks man, for the most part I do as I roughly know Opengl and did shaders did, although obviously recreating the effect might take a great deal of work.
|
# ? Nov 24, 2014 13:10 |
|
Maybe someone can help me get my head around event dispatchers in UE4 Until now I've done all my inter-BP communication with interfaces and casts (I mainly used interfaces before I realised a cast was often sufficient) But I am stuck in a position where I cannot cast, it's inflexible because I have a child actor component but I can't call any events on it (usually I can cast to the class and it works easily, but something about it being a child component (even though it's a BP) prevents the casting) And an event dispatcher will probably work but I just need a bit of help figuring out what goes where. The situation is that I want to call an "event" when the player gets a new ship (from the ship BP), so that the HUD can update itself. Do I set up the dispatcher on the HUD (the receiver) or the ship (the sender)? And then, how do I call it from the ship? If I create the dispatcher in one BP, I don't know how to reference it from another (isn't that the entire point?) IDK why but the documentation seems to be making some assumptions and I can't work it out echinopsis fucked around with this message at 11:17 on Nov 25, 2014 |
# ? Nov 25, 2014 11:13 |
|
If Event Dispatchers are meant to only be used within one BP I think I get them now. I was hoping what they were was a global event call, and all BPs would receive the event. Anyway, turns out I just needed to "get" the actor component of the child actor and then my casting worked as it always did. I was trying this eariler but I was getting it as a class not an object.. BOOM
|
# ? Nov 25, 2014 11:25 |
|
Generally event dispatchers come in handy when you're doing actor<-->level blueprint communication, since it allows the objects to be portable between levels. You'd set up the dispatchers in the actor blueprints then call/bind to them in the level or actor blueprint as appropriate. An example I normally give is: I've got a door and N number of lights. When I open the door I want all the lights to turn on. The door is one blueprint, the lights are several instances of a second BP. The door gets a dispatcher that is called when the door opens (player runs into the collision volume or whatever). The light gets a custom event that does everything we need to turn on the light, then on BeginPlay that event is bound to a dispatcher. In the level BP, you'd create a custom event, bind the custom event to the door's dispatcher, then inside the custom event call the dispatcher on all the light actors. As far as HUDs go, back in the old days of non-UMG slate I tended to route things through the player controller, since it offered easy access to the player HUD object, might not be applicable to you, since if I remember rightly your HUD is actually an actor. BabelFish fucked around with this message at 03:01 on Nov 26, 2014 |
# ? Nov 26, 2014 00:09 |
|
I have another question, suppose I have a game objects and one set of scripts to define its behavior, the statecontrollerscript and statelistenerscript. These work and have say, three different actions they have (shoot blue bullets, red bullets and mauve). Now I want to have a second or more model, but have them do a different action. I had tried setting a public variable so that I could test the behavior and pass 0 to one and one to another and two for the third but they all end up doing the same exact action at the same time. What's happening here? The game objects are dragged and dropped into the game with the two scripts attached and then I try writing 0 or 1 or 2 based on what behavior I want them to do.
|
# ? Nov 26, 2014 00:31 |
|
BabelFish posted:Generally event dispatchers come in handy when you're doing actor<-->level blueprint communication, since it allows the objects to be portable between levels. You'd set up the dispatchers in the actor blueprints then call/bind to them in the level or actor blueprint as appropriate. My HUD is now a ChildActorComponent of my PlayerCameraManager, all I needed to do to make it work like a normal spawned actor was "get" the actor from the ChildActorComponent. Before I was trying to cast to it while it was ChildActorComponent which is why it was't working so with the dispatcher, I'm confused about the terminology, "gets a dispatcher".. In a actors you create a dispatcher, and its there in the component list. is this the BP that calls the dispatcher (so the events fire on this BP) or the actor calls the events, so that OTHER actors receive the events. Either, in other actors I don't seem to be able to find the events. Unlike say, if I create an interface, and then I can call the functions/events I created with the interface from any actor (it shows up in the context specific menu) and I just need to link it to an actor to make it work THis is confusing without a diagram
|
# ? Nov 26, 2014 03:33 |
|
I'm not sure of a better place to post this so I'll post it here. I'm working with the X-Ray engine (Stalker series) and need a C++ programmer to help me out with a few features. I'm willing to pay $50 this Friday to anyone who can implement the following two things for me: 1) Give the ability for shotguns with tri_state_reload the ability to have a separate animation for when reloading a shotgun with an empty magazine vs. a full one 2) I want certain guns, such as the Abakan, to have a different fire mode depending on what fire_mode they are using. For the Abakan, it should fire at 1,800 RPM in 2-round bursts, and it's normal RPM selected in the weapons' lua file the rest of the time. Requirements: Visual Studio 2008 SP1 (I could upgrade the source, but I won't, as this is what I work with) Knowledge of game engines The reason I'm paying so little is I know that for any decent C++ programmer this should not be a challenge. Email me at matthew.w.swartz at gmail if interested and I'll provide the source code to work with, and upon successful verification that these two features work I'll send you $50 via Paypal (or another service that is reasonable). There is also the opportunity to make more money after this as there are other features I may need coded and cannot do myself.
|
# ? Nov 26, 2014 04:03 |
|
re: LibGDX Why does it never remember my android sdk directory?
|
# ? Nov 26, 2014 05:46 |
|
Swartz posted:I'm not sure of a better place to post this so I'll post it here. So you estimate this would take less than 2 hours worth of effort?
|
# ? Nov 26, 2014 05:47 |
|
echinopsis posted:This is confusing without a diagram Here's a super fast example: Light Blueprint: Door Blueprint: Level Blueprint: The level binds a custom event to the door's "ED_OnDoorOpen", which turns around and calls the dispatcher "ED_TurnOn" in an array of light actors. As long as you have a reference to the actor, you can use event dispatchers in either direction.
|
# ? Nov 26, 2014 06:21 |
|
KoRMaK posted:So you estimate this would take less than 2 hours worth of effort? $50 is not enough compensation for two hours of work and two hours isn't enough time for somebody to become familiar with a game engine.
|
# ? Nov 26, 2014 06:25 |
|
I really want to use libgdx, but the tutorials don't seem to be accurate. Everytime I launch the game creator it forgets my sdk directory. Here is the command I use code:
e: I set my ANDROID_HOME directory and now its picking that up. KoRMaK fucked around with this message at 17:03 on Nov 26, 2014 |
# ? Nov 26, 2014 06:40 |
|
pseudorandom name posted:$50 is not enough compensation for two hours of work and two hours isn't enough time for somebody to become familiar with a game engine.
|
# ? Nov 26, 2014 06:53 |
|
|
# ? Apr 25, 2024 12:37 |
|
LIBGDX question - I can't set the default directory for projects via command line, what gives? I do code:
|
# ? Nov 26, 2014 17:04 |