Page 1 of 1
If reference direction loc has a selected Property?
Posted: Mon May 07, 2018 1:38 am
Having a problem with a specific Player Move restriction expression, i want to check it referenced direction location has a property selected
Code: Select all
I've tried ="true" instead of =1 but this doesn't work either.
What have i got wrong?
Re: Check if reference direction loc has a selected Property
Posted: Mon May 07, 2018 2:55 am
It looks like this type of expression cant be used exactly like this, so i have used the param # %location% method instead and this did the trick, where in the second task i can use the dropdown menu to query if location has property x.
However i still am faced with a problem, I have a specific player movement task that i want to kick in only if the location the player is in has a specific custom property. By using the param method to get around the limitation of the expression required it means having no restriction which means this specific task will override Player Movement.
Any ideas how to work around this?
Im trying one method to have another specific task to run 'before' the other specific player movement task, which if the task that the location was passed to does indeed have the property then it completes. So the first Specific task now has a restriction, if the task checking the location does have a property will be my flag. However the 2nd specific task even though has a higher priority that the first one doesn't run at all.
That explanation might sound confusing but i have a demo. The property in the demo isn't the same as in my game im working on. I could instead of using properties use groups, but i would need to write an expression for restriction to see if locationTo etc location is in a group. Not sure how to write that.
But i am curious to know how to try and solve this problem in the method as per my uploaded demo, with having a specific task run before another one to trigger a flag.
Note: This problem i face in my current project for a GameJam it is the same prob in nature, but it involves tasks/flags that trigger events (which works fine) not merely outputting text as in this little demo. Its the same nature of method and intent that i want to find a solution for. Hope that makes sense.
Re: If reference direction loc has a selected Property?
Posted: Mon May 07, 2018 5:00 am
I have found a work around since the expression i wanted to use only works in like this <#if%Player%.Location.LocationTo(%direction%).Property=1,"true","false")#> not inside a restriction expression.
%Player%.Location.LocationPropertyKey=1 works fine.
The work around modifies default Player Movement, moves an object as a marker to where player is BEFORE moving and then moves player as per usual.
A custom task is run next from within Player Movement action as well to check if players location has a property and if so the Player gets moved back to where the marker object was placed. (Only thing that is noticeable is if the location hasn't been discovered before it will show of player gets forced back to original location. In this demo all locations are revealed at the start).
You can do the same thing without the more simplified expression i used see 'Check is new location too steep', by clicking on Location must have property Location is too steep.
See updated demo below