Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter conditionInverted always true for object's conditions #13

Closed
victorlevasseur opened this issue Aug 30, 2014 · 6 comments
Closed

Comments

@victorlevasseur
Copy link
Contributor

Hi,

When I'm trying to use that special code-only parameter, my function always get "true" even if the condition isn't inverted. Notice that it's an object's condition (not like the standard collision condition which is a free condition).

@victorlevasseur victorlevasseur changed the title Parameter conditionInverted always true Parameter conditionInverted always true for object's conditions Aug 30, 2014
@victorlevasseur
Copy link
Contributor Author

I've found how to change that in GDCore/Events/EventsCodeGenerator.cpp but I wonder if the condition need to invert itself the result if the "conditionInverted" is used in it.

@4ian
Copy link
Owner

4ian commented Aug 30, 2014

For objects conditions, the predicat (=the expression inside the if) used to pick objects is simply negated (by adding a ! in the generated code). What is your object condition for which you need to do something special? Why does the default behavior is not satisfaying?

@victorlevasseur
Copy link
Contributor Author

If the condition is inverted, I need to pick the object that are not colliding with the tilemap : that's a very specific condition : a bit like the collision condition. Maybe I need to make it free ?

@4ian
Copy link
Owner

4ian commented Aug 30, 2014

I think that the condition is better as a free condition indeed. (Note that if you're dealing with two list of objects, as classical conditions collisions, you may take a look at ObjectTools.cpp. It has a TwoObjectListsTest function that launch a function on each pair of objects in the list and that you should reuse. But this is only if you deal with two objects list, that's maybe not your problem here :) )

@victorlevasseur
Copy link
Contributor Author

I saw that function (which seem quite conplicated inside) but I need to
pass 3 integers to the "test function" but there is only 1 "extra
parameter" (row, columns and layer of the Tile).

2014-08-30 17:34 GMT+02:00 Florian Rival notifications@github.com:

I think that the condition is better as a free condition indeed. (Note
that if you're dealing with two list of objects, as classical conditions
collisions, you may take a look at ObjectTools.cpp. It has a
TwoObjectListsTest function that launch a function on each pair of objects
in the list and that you should reuse. But this is only if you deal with
two objects list, that's maybe not your problem here :) )


Reply to this email directly or view it on GitHub
#13 (comment).

Victor LEVASSEUR
victorlevasseur52@gmail.com

@victorlevasseur
Copy link
Contributor Author

I'm currently working on a solution to let the dev pass as many extra params as he wants. ;)
Will soon post a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants