Juryiel's Recent Forum Activity

  • Can't you just check the string values?

    Have a correct string, CString="R:G:B:Y", and each wire has some instance variable Var1 of either "R", "G", "B", or "Y".

    Test Var1 against tokenat(CString, N, ":"), where N is the (N-1)th wire being cut so if he's cutting the 3rd wire, N is 2.

    Haven't actually tested any of this but it seems like it should work.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would like to be able to check if a user is logged in. Can we get a condition for this? What I mean is, I want to check if a user is logged in, and if not, show him a button "Submit Score Online". That way, when the popup happens asking them to sign up to clay.io, they'll expect it and be more likely to do it. If they are already logged in I can then just have the score posted automatically without clicking the button every time. This gives them the option of playing without being bothered with signups, but can choose to do so if they want and then have scores automatically submitted conveniently.

    Also, I see this in your docs:

    ill in the forms

    Name will show at the top of the leaderboard

    Type, if set to incrementing gets a cumulative score per person (typically you won't use this)

    Unique Identifier is optional, but acts as an easy to remember ID for the leaderboard

    However the 'incrementing' option doesn't seem to exist

    In addition, when I post a score I want to specify the player name. It seems the Post Leaderboard Score action allows me to do this, but only if the user is already logged in. If not, the player specifies the name. How can I control what name shows up on the leaderboard if a player hasn't yet logged in when the Post to leaderboard action is called?

  • Is it possible to sort an array in C2 by values in another array (of the same size) without writing a custom sort function?

    Usually languages that make this functionality available do it by returning a vector of the sort index of array A, and allowing you to sort array B by a vector of indices. I'm not seeing anything like this in C2 but I thought I'd ask if there was some simple way I was overlooking without having to write my own sort function.

  • That's a neat idea though about clicking, I didn't think about it. I'll give it a try if I can't get the RTS behavior to behave correctly. Haven't worked on it in a while since I was stumped and have been working on a different part of the game.

  • I'm using the RTS behavior's "Move To Object" where the Object is the picked player.

  • So I'm trying to design a movement system using RTS behavior. The enemies are not very good at navigating around objects. What I mean is, if they are chasing the player, and the player is moving close to irregularly shaped walls, they will get stuck. I solved this problem by disabling collisions for the enemies and setting them to avoid wall objects. What this does is that although they will avoid walls, if they do get too close to an irregularly shaped wall edge, they will go through it. I know I'm not explaining this right but it works well and looks fine.

    Problem is, if I disable collisions I can't click on them :( Is there some way for me to accomplish that?

    Alternatively, is there a way to prevent enemies from getting stuck on irregularly shaped solid objects with collisions enabled? I tried messing around with the box size to no avail. Some way to maybe get them to slightly push off a solid object on collision?

    I also tried to use the On collision with "Solid" and Is overlapping "Solid" and then use a Push out, since the walls are solid but that didn't work. The conditions never triggered even when the enemies were stuck, though I'm not sure why. The 'walls' are one gigantic sprite that covers the entire level, and the 'open' areas that enemies and players can walk on are transparencies in that sprite, if that has something to do with it.

    Thanks!

    EDIT: Just to clarify, it's not that the space for the enemies is tight. It's wide open. The only reason they get stuck is because I have them chase me around, and I drag them across protrusions on the irregularly shaped walls.

  • Hmm the map function is giving me an IndexError :(

    EDIT: Nevermind, forgot to make the array global

  • Ok, I'll just transfer the {"NPCHatelist",str(SOL.Enemy1spawn.UID)} contents to a standard Array I suppose, then run the code on the array.

    Thanks guys :)

  • Here's my second attempt (actually using S and not arrays), but it fails on a syntax error on the first line. I guess I'm not using S correctly in python:

    AggroSortArrayPy = map(lambda k:S.n{"NPCHatelist",str(SOL.Enemy1spawn.UID,k), range(S.sule({"NPCHatelist",str(SOL.Enemy1spawn.UID)})))
    
    AggroOrderPy=sorted(range(len(AggroSortArrayPy)), key=lambda k: AggroSortArrayPy[k])

    EDIT: Updated it to use map function instead of loop. Still don't know how to properly access my S stuctures in python, let me know if someone does while I try to figure it out :)

  • On a related note, can I access Construct arrays in python in a standard way or do I have to assign their values to a python array?

    E.g. if I have an array SortArray in construct, can I do this:

    sorted(range(len(SortArray)), key=lambda k: SortArray[k])

    to get the indices of the sort, or will this fail? (For one, COnstruct arrays are 1 based and python are 0 based etc).

  • Does that work? I think I'm misunderstanding the algorithm. It seemed to me that it is based on having the array into which you insert a value already sorted.

    E.g. if I have these values 4 8 9 3 5

    If I have an empty array A into which these will be placed, then when I loop through, A = 4, and sorted since only 4 is there. Then on the next loop, A = [4 8] and sorted. THen when I try to put in 9, again, it's going into a sorted array A = [4 8 9] and so on and so on.

    With your suggestion, every value goes into a jumbled array, on the first iteration, A = [-1 8 9 3 5] = [8 9 3 5] and I'm trying ot put 4 into this unsorted array. This is why I'm confused. I can't tell whether the algorithm will work the same in both situations. My thought is that I need to have another Array B, and then do something like loop through all values of A, and sort them over in B (then copy B to A).

    Since you're busy and the python algorithm is good (I looked it up it compares favorably to most others) I think I'll go ahead and use that since it's really easy to use. Thanks for showing me how and figuring out what sort it is :)

  • Yeah I read the comments, and even though I sort of get the theory, I guess I was just (still am) confused as to how I would use this in a static array, I'll try to for a bit more to figure it out, and then I'll probably resort to python :) Thanks!

Juryiel's avatar

Juryiel

Member since 30 Sep, 2010

None one is following Juryiel yet!

Trophy Case

  • 14-Year Club
  • Email Verified

Progress

15/44
How to earn trophies