Posts by Netflyer165

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.

    No, wait, sorry, I didn't explain it right from the start, Either being true needs to force another number generation but BOTH will never be true at the same time. I have it working but with two events, is there a way with one? That's why I thought OR should work.

    I'm trying to code, if X = Y or if Z=A then etc..

    Ok, one more thing, if you guys are still following this thread. I want to add another condition, I want it not equal to the animation frame number and also not equal to the ABS(value(counter)-superjump) ... I for some reason can never understand the OR logical or filtered but it seems I should be able to just do an OR... instead using King_Cools example I just added another event
    On Loop Checknumber
    if counter <> Abs(value( "TheSameTester" )-SuperJumpanimationframe) then stop loop and generate another random number. Isn't there a way to put that in the same event with an OR as the counter = superjumpanimationframe

    I guess what I"m asking is the proper syntax to

    On Loop Checknumber
    counter = superjumpanimationframe
    OR
    counter = abs(etc.)

    then stop checknumber and run generate number again.

    But the Or never works for me so I used another event. What's the best way?

    Ok, I'm convinced there is always a better way, and especially with the way I do things. Ok, the task here is to have the keyboard commands change based upon which animation frame is randomly generated by an object.

    Platform game.

    So, I have a square with 12 different animations. Each one is obvious like Apple, Orange, Tree, etc. The user (young student) must know the first letter of the picture to use the keyboard key that corresponds to that letter to initiate an action for the character. So, the character collides with a magic square and the active object becomes visible with the randomly generated frame showing. The user then acquires the new ability, let's say Super Jump (the ability to jump during a jump) only when they hit the keyboard key that corresponds to the first letter of that graphic. SO, if it were the Apple graphic that randomly came up the key for Super Jump would be A, the first letter of the word Apple. Ok, I have this working great, different randomly generated graphics are then mapped to different keys for the attacks. The user has a control panel and an icon of the random animation shows on the ctrl panel with the name of the attack, so the user sees an apple on his control panel and the word Super Jump above it, then they know to press A for super jump. If an Orange had come up they would press O for super jump, etc. SO, it forces them to know the first letter of pictures to play the game essentially and the pictures change often. A sneaky way to teach kids to begin to read... anyhow, here is what I'm doing to make this happen, and I'm SURE there is a better, easier way and considering I've only programmed two of these randomly generated abilities which change the attack keys, a better way would be great before I program 26 of them :)

    Ok,

    If you collide with the special marker a number between 0 and one less than the number of animation frames is randomly generated and the active object with X number of animations frames becomes visible with the generated frame number showing.

    This sets a global SuperJump equal to the generated frame number and activates a group called Super Jump.

    This is where I think a more elegant (instead of my hacked up) solution can present itself I'm sure.

    The now active group has a check for each possible value of SuperJump
    If SuperJump = 0 then activate the A group
    If SuperJump = 1 then activate the B group
    etc.

    So, I then activate the group that corresponds to the letter A
    It starts with 'Repeat while 'A' is pressed and then proceeds to do all the stuff I need the character to do to 'Super Jump'

    I have a B, C, D, E, F, etc group that I activate if SuperJump = 2, 3, 4,5,6, etc. Each with the proper 'Repeat while 'B' is pressed, Repeat while 'C' is pressed, etc... each group has the proper keyboard key that corresponds to the animation frame value activated so that the user can now use the first letter of the graphic to make the Super Jump work.

    So all this works but it is a huge number of tests to activate one of many many subgroups. If I could 'Repeat while (parse in my string) is pressed' I could cut out all those subgroups, for one... and there is probably a better way to assign the activation of the subgroups than by using a separate event for each possible value of SuperJump.

    Is there a better way do this? I want the keyboard key that sets off my action to be reassigned based upon the animation frame number of a graphic that has that number randomly generated :) I got it working and it is really cool, but clunky :)

    Thanks for help!

    Wow, I just got it all working fine with King_Cool's solution, and now a more elegant solution presents itself... Wow, I bet there is a much more elegant way to do a lot of the stuff I'm trying to do, I suppose I should post more questions and get more elegant code as a result... Thanks so much guys!

    Ok, sorry I have to ask since my loop experience is void.

    So my ultimate goal here is to set a variable called SharpAttackAnimationFrame to the number that is randomly generated that is NOT the same as superjumpanimationframe (sorry about the long variable names but I'm stupid and forget variables unless I'm uber clear)...

    So, then the last command block On Loop CheckNumber, the + means (if) right? So, if counter, the counter that has just been randomly generated equals superjumpanimationframe then generate another number... right? So then if NOT equal to superjumpanimationframe I want sharpattackanimationframe = counter ... so do I use an ELSE somehow on that last command block, else sharpattackanimationframe = counter? Or, what is the best way to assign the final number that I want to sharpattackanimationframe?

    Hi people,

    I need to generate a random number but if it equals another number generate it again until it doesn't equal the other number.

    So, until random(11) <> superjumpanimationframe try again

    So if superjumpanimationframe is 3 I want a random number between 0 and 11 that is not 3

    How would I do that?

    I'm just learning this stuff so if you provide an example it will stop me from asking you the standard follow up question, "And, er, so, how do I do that" :)

    Thanks!

    Ahhh, I see, from your example I used upon pressing a key instead of repeating the key... that fixed it.

    So I assumed you could do this w/out repeating cause the example I was following had Joystick 'pressed fire' and not repeated... so I assumed you could use 'press a key' just like pressed fire. I was using the default keyboard key, shift to make that command work and it worked fine. So I figured I could but If Y pressed and then limit it to 1/50 like with the joystick command and it would work, it doesn't.

    While Y is repeated and the limit works perfectly though. If you add to your example an event that tests if Y is pressed, not repeated with the 1/50 restriction it will add about 3 or 4 to the counter and then cease to work..

    Thanks for the example!

    Question: Why if I use fire button 1 (shift) and restrict actions to 1/50th and upon firing it creates and object perfectly again and again but if I change fire button 1 to any assigned keyboard key, like Y for instance, it will create about three objects and then no more?

    So
    If firebutton 1 and restrict actions to 1/50 create object works like a champ, press press press press an object is created each time.

    If Press Y and restrict actions to 1/50 create object will create about 3 objects and then no more.

    why? If I remove the limit it works fine btw... as soon as I put any limit in there to stop the user from creating too many objects in a short period of time it will only create 3 objects :)

    Thanks

    I got it, I was creating new one's and not assigning them to the clickmovement extension after each creation, I just assigned it once at the start of the frame, not a good idea... so it needs to go like this:

    Create Object with Vector mvmt and assign it as the object on that event, then I set a flag.
    On flag reset flag, turn gravity vector to whatever direction I want and then Start the movement via the object, not the extension...

    So I was creating objects and wanted to control each with the ext. object, have to assign it to each created object after it is created rather than the original object at the start of the page. Makes sense but wasn't obvious :)

    I did... the object needs to have vector movement to begin with right? Then set that object to the ct movement ext... and it should power it... doesn't do it... So no matter what my initial settings are on the object with vector mvmt I can't change them programatically...

    Ok, I'm having a hard time controlling the vector movement with code. I dropped in the CT movement controller but still no luck... So I have an object that has vector movement, I'm using it as a projectile, I create it and it goes in whatever direction I set the vector to in the properties pallet. But I want to change the vector direction based upon my character's direction... So, I can test for my character's direction but I can't change the direction from 0 right to 180 left. I set the projectile to vector with gravity 2000 dir 0 intial's are 0 0 and move at start is not checked, animation dir is... but no combination allows me to change the dir to 180 or 'left'... So I put the movement controller in, set the object to my projectile, set everything for 180 degrees and the thing still goes right or 0 angle... the only way I can get it to move 180 is to set up the object intially moving at 180... Any idea how to program an object with vector movement to change direction? Thanks! I mean I could make another object and create it when my character is going in the other direction angle 180 and just create the vectored object that I need for each direction but that seems silly, there has to be a way to control a vectored object's direction at runtime... I tried before I put in the movement controller just making the object move in a dif. direction but that didn't change anything either... I also realize there is angle direction and movement direction and not entirely sure how the vector movement uses angles and not normal click directions but I suppose cause it's a vector object ;p

    Thanks for any help!

    Ahh, it seems they are in extension view... but the sound generator and sound player are actually called Advanced sound generator, and Advanced sound player... I hate when the extensions are named different than the icons/app... makes it confusing ;/

    Wow, King, you have a ton of audio extensions! Hey, considering I haven't taken that plunge yet, which one will let you play a given note? I'm writing a music based educational game and I recorded samples from my keyboard (piano) of each note but looking at your extensions I'm guessing, and I figured as much, some extension could generate a given note on call. True? So if I wanted A 440 (middle of the piano A) which extension can output that easily?