Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 14 Votes - 2.93 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Challenge Threadᆦ ᆦ ᆦ
Author Message
Homicide13 Offline
Senior Member

Posts: 323
Joined: Nov 2010
Reputation: 14
Post: #151
RE: [CHALLENGE THREAD]

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 >_> ). Sad

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. :/

(This post was last modified: 04-27-2012 12:04 AM by Homicide13.)
04-27-2012 12:02 AM
Find all posts by this user Quote this message in a reply
nemesis567 Offline
Posting Freak

Posts: 879
Joined: May 2011
Reputation: 10
Post: #152
RE: [CHALLENGE THREAD]

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.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
(This post was last modified: 04-27-2012 12:45 AM by nemesis567.)
04-27-2012 12:21 AM
Find all posts by this user Quote this message in a reply
Homicide13 Offline
Senior Member

Posts: 323
Joined: Nov 2010
Reputation: 14
Post: #153
RE: [CHALLENGE THREAD]

Does Angelscript not support private class functions? Sad

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?

(This post was last modified: 04-27-2012 01:39 AM by Homicide13.)
04-27-2012 01:29 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,474
Joined: Jul 2011
Reputation: 234
Post: #154
RE: [CHALLENGE THREAD]

(04-27-2012 01:29 AM)Homicide13 Wrote:  Does Angelscript not support private class functions? Sad

http://www.angelcode.com/angelscript/sdk...ivate.html

Tutorials: From Noob to Pro
04-27-2012 02:17 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Homicide13 Offline
Senior Member

Posts: 323
Joined: Nov 2010
Reputation: 14
Post: #155
RE: [CHALLENGE THREAD]

The private functions seem to have to be of the "void" type though. My code
PHP Code: (Select All)
    private string GetOtherEnt(string sCurrentEnt)
    {
        if(
sCurrentEnt == Ent1.sEntity) return Ent2.sEntity;
        else return 
Ent1.sEntity;
    }
    
    private 
string GetAttachedTo(string sAttachedEnt)
    {
        if(
sAttachedEnt == Ent1.sAttachedEntity) return Ent1.sEntity;
        else return 
Ent2.sEntity;
    }
    
    private 
int ABS(int i)
    {
        if(
<= 0) return (-i);
        else return 
i;
    } 

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.

(This post was last modified: 04-27-2012 03:51 AM by Homicide13.)
04-27-2012 02:31 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,474
Joined: Jul 2011
Reputation: 234
Post: #156
RE: [CHALLENGE THREAD]

(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..._prop.html

Tutorials: From Noob to Pro
04-27-2012 03:49 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Homicide13 Offline
Senior Member

Posts: 323
Joined: Nov 2010
Reputation: 14
Post: #157
RE: [CHALLENGE THREAD]

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 Smile ). So if anybody knows anything about the first two problems, I would be very interested in your knowledge.

(This post was last modified: 04-27-2012 04:07 AM by Homicide13.)
04-27-2012 04:06 AM
Find all posts by this user Quote this message in a reply
nemesis567 Offline
Posting Freak

Posts: 879
Joined: May 2011
Reputation: 10
Post: #158
RE: [CHALLENGE THREAD]

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.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
(This post was last modified: 04-27-2012 02:00 PM by nemesis567.)
04-27-2012 01:56 PM
Find all posts by this user Quote this message in a reply
Homicide13 Offline
Senior Member

Posts: 323
Joined: Nov 2010
Reputation: 14
Post: #159
RE: [CHALLENGE THREAD]

(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.

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.
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 Sad ).

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-priv...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. Sad

04-27-2012 04:24 PM
Find all posts by this user Quote this message in a reply
Apjjm Offline
Super Moderator

Posts: 481
Joined: Apr 2011
Reputation: 48
Post: #160
RE: [CHALLENGE THREAD]

(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.

http://www.mediafire.com/?qslxd2a7ir0r563
That meets the specification Smile. 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
  • I used SetMoveObjectStateExt in my solution iirc
  • MoveAxisSize is "OpenAmount" in the model editor.
  • It's fine if the bridges move up/down by different amounts, provided the ratio of the speed matches the ratio of up/down movement between bridges (and this ratio is constant - e.g. 2:1).

04-29-2012 09:29 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)