Challenge Threadᆦ ᆦ ᆦ - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +--- Thread: Challenge Threadᆦ ᆦ ᆦ (/thread-14681.html) |
RE: [CHALLENGE THREAD] - Homicide13 - 04-27-2012 as in AddEntityCollideCallback("ent1","ent2","MyClass::MyFunction", ... )? I tried that, and it didn't work. Neither do AddEntityCollideCallback("ent1","ent2","myClassVar.MyFunction", ... ) and AddEntityCollideCallback("ent1","ent2","MyClass.MyFunction", ... ) (this last one doesn't make much sense, but it was more of a desperation move >_> ). EDIT: If it means anything, the AddEntityCollideCallback functions are being declared within the namespace of my class (as a part of a class method), but I also tried all of these things in the global namespace as well. :/ RE: [CHALLENGE THREAD] - nemesis567 - 04-27-2012 You're not going to use that with a class. I think it's about it. Here is my solution. I don't have time to explain it and I'm with a terrible headache. Also, bridge_1 might clip trough the tubes. I had to edit the function I used so it wouldn't go that far down since I followed the ground plane altitude and I wasn't aware of these tubes. Anyway, I can arrange that tomorrow or another time because I really am not in the mood now. http://www.mediafire.com/?qslxd2a7ir0r563 Time: 4 Days 11 Hours 13 Minutes Also, I might have totally misunderstood the challenge. If I did so, I apologize and forget about it. RE: [CHALLENGE THREAD] - Homicide13 - 04-27-2012 Does Angelscript not support private class functions? Also: how do I find/edit the "MoveAxis size" of an object? I can't find it for the life of me. :/ or is the MoveAxis size just the size (x y or z depending) of the model? RE: [CHALLENGE THREAD] - Your Computer - 04-27-2012 (04-27-2012, 01:29 AM)Homicide13 Wrote: Does Angelscript not support private class functions? http://www.angelcode.com/angelscript/sdk/docs/manual/doc_script_class_private.html RE: [CHALLENGE THREAD] - Homicide13 - 04-27-2012 The private functions seem to have to be of the "void" type though. My code PHP Code: private string GetOtherEnt(string sCurrentEnt) gives me 3 "ERR : Can't return value when return type is 'void'" messages when I try to run it in game. I suppose I could get around this by using reference parameters but I'd rather just do it normally... Also, the bridges seem to move up and down at different speeds - does anybody know why? Well other than the question I had before, my problem with private functions, and the last question stated above, my solution is completely done. It provides a "BalanceSystm" module that allows the programmer to implement a balance system with any two vertical move objects by adding only 3 lines of code (also provided they have the move entities are the same and that the user provides another invisible entity similar to the one Apjjm provided for the challenge named "<MoveEntName>Collider"). There are a couple of limitations (ie it can only detect one kind of weight, etc.), but other than that it's completely portable. RE: [CHALLENGE THREAD] - Your Computer - 04-27-2012 (04-27-2012, 02:31 AM)Homicide13 Wrote: gives me 3 "ERR : Can't return value when return type is 'void'" messages when I try to run it in game. I suppose I could get around this by using reference parameters but I'd rather just do it normally... I suppose you can get around the issue using get and set accessors: http://www.angelcode.com/angelscript/sdk/docs/manual/doc_script_class_prop.html RE: [CHALLENGE THREAD] - Homicide13 - 04-27-2012 Ah I actually ended up using only void functions in the private section after all (I ran into a problem where either returning a custom datatype didn't return properly, or didn't correctly assign to another custom datatype (of the same type), so I completely changed the way that part of the function worked). So now it's just a matter if figuring out how move objects work and making the bridges move up and down at the same speeds, figuring out how to change/figure out what the MoveAxis size is, so I can make the module easier to implement for other move objects, and adding the option to include a movement sound (which won't be very hard ). So if anybody knows anything about the first two problems, I would be very interested in your knowledge. RE: [CHALLENGE THREAD] - nemesis567 - 04-27-2012 Have you tried to use a friend function for that callbac problme of yours? I totally forgot about that. Making them move at same speed just requires you to use the exact same values for each. Except that you should use the negative value for state in one, something the other must have in positive order. Also, about the void, make sure you're accessing private functions via class functions. Other than that just check if you the declaration of the class(in case you separated implementation) has the function without void. I'm not sure if I understood your problems well though. Also, I need Apjjm to confirm my solution. You can and should check it to understand how to make it move exactly the same for both sides also, it would be easier than explaining it. RE: [CHALLENGE THREAD] - Homicide13 - 04-27-2012 (04-27-2012, 01:56 PM)nemesis567 Wrote: Have you tried to use a friend function for that callbac problme of yours? I totally forgot about that.Well as for my first problem, I got it to work but it requires the user implementing the module exercise an extra step beyond just declaring the BalanceSystem object and Initializing it. (I think i solved it by doing what you mentioned (if i understand what you mean by a friend function), but it still requires this extra step ). About my problem with private functions, apparently it was actually a bug in the version of Angelscript that FG used to make the game. ( http://www.gamedev.net/topic/624101-private-class-functions-that-return-a-type-other-than-void/ ) And the problem I had with the movesment seems to be comming from the fact that I'm using SetMoveObjectState instead of SetMoveObjectStateExt. Even then though, I can't see why the bridges would move at different speeds. Also, the "MoveAxis size" is supposed to be distance which one open represents (well depending on the settings in the model but). So in other words, SetMoveObjectState("entity",1) should move the move object in the "open" direction by (1 * MoveAxisSize). But I cannot find any similar value anywhere in the model editor. RE: [CHALLENGE THREAD] - Apjjm - 04-29-2012 (04-27-2012, 12:21 AM)nemesis567 Wrote: Here is my solution. I don't have time to explain it and I'm with a terrible headache. Also, bridge_1 might clip trough the tubes. I had to edit the function I used so it wouldn't go that far down since I followed the ground plane altitude and I wasn't aware of these tubes. Anyway, I can arrange that tomorrow or another time because I really am not in the mood now.That meets the specification . All that is required now is to make sure it doesn't clip through the tubes, I haven't really had time to look at the implementation to see if you did things a similar way to me, but yes, that behaviour looks good. Some other general hints / answers
|