nimos100's Recent Forum Activity

  • This is just speculations so might not work.

    But you could try to setup a virtual machine and run a version on that, and see if you can connect to it.

  • Hi have a question about the multiplayer functionality.

    I made the chat tutorial and added something similar to my own game, and there doesn't seem to be any problem connecting as host. However I was wondering if it is possible to start up several C2 and run several projects to test it locally. The reason I ask is because im not sure if it works correctly. When I do it, I can see that it register that someone connected, but it wont write the peer name for the peer client when it connect, however works for the host client, which can see the client name. Furthermore I cant send messages between them. Some times both client and host will show both names connected in the client list and sometimes they wont. (Mostly its the client that doesn't show the host)

    Im testing using the nodekit.

    So just wondering if its possible to even test it using several instances of C2 or is it expected to behave weird. If that's the case are there any good way to test if it works locally, using just one computer?

  • Ok ill try to explain it a bit clearer.

    Loops works fine inside events, but you have to understand how C2 execute code.

    When C2 reads it start from the top and go through each event and execute whatever it should.

    When it reaches a loop it will repeat the loop X amount of times, before moving on.

    The wait statement is a bit weird and think that might be what confuse you. The wait statement, doesn't store X amount of waits even if you repeat it 90 times. It will do it once when the wait timer is up.

    Here is an example.

    https://dl.dropboxusercontent.com/u/109921357/Loop%20test.capx

    The Text counter on the left, have a wait of 5 seconds where the right doesn't. As you can see, the left one only updates every 5 seconds, despite it being in the same loop as the Right one. Both of them works fine however the left text will only show the count every 5 second, where the other will update constantly.

    There are nothing wrong with using loops in conditions as long as you know how C2 handles them. Hope that makes it a bit clearer.

  • [quote:1301ywbs]That's wonderful if I want to do something "Every Tick". I don't want to do it every tick, I want to do it only 90 times and USING A LOOP INSIDE OF A CONDITION BEING MET. That is the topic of my entire post. I want to know how to structure it.

    I am basically asking everyone "Can a loop be executed inside of a condition being met?"

    I don't want to use a behavior, I don't want to call a function (tried both of those still couldn't). I simply want to know how to structure a loop that fires off only once a condition is met.

    Yeah you can run a loop if conditions are made, but what you are trying to do, is not possible the way you want to do it. Because a loop is not based on the time scale you are aiming for. To make what you are trying to do work, you would need to know how fast the loop is executed, as I understand you. Which would be near impossible to figure out as I see it.

  • Here is an example, that will rotate it 90 degree every 1 second, when you click the object.

    https://dl.dropboxusercontent.com/u/109921357/Rotate_test.capx

  • This works while the condition (Mouse On any Click) is Toggled to Disabled.

    Once I Toggle the condition to Enabled (not crossed through) it only moves 1 time not 90.

    What am I doing wrong here?

    The reason it doesn't work is because it not really a valid way of using the events. You repeat it 90 times every tick. But afterwards you have added a Wait 0.3 so even though it runs 90 times, it gets stuck at the 0.3, so you could change it to repeat 1 time, and it would be the same. The amount of times you repeat it are way faster than 0.3 second of wait time.

    The way you want to do it in your code is not based on a 1 second interval, but just on a random amount of time. The reason mine work is because its based on C2 running 60 ticks a second, Which means that it will run through your event sheet 60 times in a second.

    So dividing 90 degree with the 60 ticks, will tell C2 to rotate the object 1.5 degree every tick. And therefore after 1 second it will be 90 degree.

    In you example, try to change the repeat to an

    "Every tick"

    And remove the wait and move the rotate up, and type 90/60 as how much it should rotate, it will make it rotate 90 degree every 1 sec.

    "Every tick"

    Rotate object 90/60 degree.

  • It will use the ticks iteration of 60 automatically.

    What you can do is add a Boolean variable to the objects that you need to rotate, called "Rotating"

    In the event that rotate.

    Object.Rotating true

    Object.rotate clockwise = 90 / 60

    And then you set it to false again when its done rotating.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What you can do if you add it to a function is simple call the function with a random number. And based on that it will change the color.

    Input: Random number from 1 to 5

    On Function Change_Color

    If Function.parameter(0) = 1

    Set background color to Red

    If function.parameter(0) = 2

    Set background color to Blue

    etc.

    When you call the function you simply write.

    Call Change_color

    Parameter (0): int(random(5)+1)

    If you are not sure how to use functions, here is a small guide I wrote, They are fairly easy to use and a absolute must to learn if you want to make anything decent in my opinion - https://www.scirra.com/forum/viewtopic.php?t=97305&p=743528#p743528

  • A way you can do it I think, is to make a search bot kind of thingy like a google bot, in form of a check object. So if you add an object called "Checker". Which only purpose is to check each target to see if they are reachable and make the checker invisible, it should just run in the background.

    Then to the enemies you add a Boolean variable called "Reachable".

    As the checker goes through each enemy you changes this variable to either true or false. So if "Checker" found path to enemy you set "Reachable" to true, if it fails you set it to false.

    To your other objects, you can use the same code as you do now, but just add that it should only check enemies where "Reachable" is true.

  • I think you have to be a lot more specific, in what the problem is

    It sounds like you need someone to explain it from start to end, which would take several pages and then it might not even be as you wanted.

  • You have two actions for rotating objects.

    Rotate Clockwise

    Rotate Counter-clockwise

    They are under the Angle section in the action menu.

  • Not sure why you use an array?.

    You can do it like this without the array:

    Event:

    Set layer background color

    Layer: The name of the layer you want to change color.

    Color: RGB(int(random(255)), int(random(255)), int(random(255)))

    You can just put it in a function and call it every time you have to change background color.

    Also you have to make sure that the Layer properties are set correctly.

    Transparent = No

    Opacity = 100

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies