nimos100's Forum Posts

  • Think you should be able to do it, by simply using the width of the screen. (This ofc depends on how you made it, so it might not work.)

    Here is an example of how to do it.

    Since you know that the screen is a certain size you can use that to decide the opacity of the image. In this example you can scroll the image from side to side and it will update the opacity from 40 on this sides to 100 in the center of the image.

    This might not solve you whole problem, but hope it can give you an idea of how you can do it.

    Opacity scaler

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

  • Ok I understand you now, the shaking of the object is due to you having to copy the imagepoint_1 to the other frames the way I told you in the first post. As I looked at it, some of the frames doesn't have imagepoint_1 and for some of them its not at the same position.

    The reason is that as your character goes through each frame, it will stay at imagepoint_1 as you told it, but if its not the same for all the frames, it will shake as it moves to the position of the imagepoint for that frame.

    So what you do to be more specific is you place the imagepoint where you want it on frame 0, when you are happy with that, you right click it in the list of imagepoints and tell it to copy it to the rest of the animation, its called "Apply to whole animation" then it will copy the imagepoint to all the other frames.

  • Not really sure what the problem is?

    Tested your capx and it seems to work just fine, the only thing I could find, which is not really relevant to your problem, is that you have to make sure that imagepoint 1 is copied to the other frames.

    You can do that by simply right click it in the image editor and choose copy to whole animation or something like that.

    But maybe I misunderstood what you meant regarding your problem.

  • Not being able to see your code, I am almost 100% certain that there are something wrong with your picking, when you destroy enemies. Either double check it, or post a screenshot and I think a lot of people in here can tell you where it goes wrong.

  • Problem Description

    Did some more testing, and it seems the problem is linked to "Pick lowest/Highest" when used with a family.

    So it doesn't seem to have anything to do with the names after all.

    The error messages are the same as shown beneath.

    [--DISREGARD--]

    After the bug with the family variable, and upgrading to r164.2 im experiencing some weird errors. My game is a tower defense game, and each turret have a type in form of a string. For instant "Gun", "Energy" etc. that are a family variable. After the bug and upgrading to r164.2 it wont accept some of the names anymore. Meaning that if I type the name "Gun" in the string variable the game crashes with the same error as in r164. I then found out that if I renamed it to "Gun1" then it worked. However its only some of the towers that have this problem, for instant the turret called "Energy" I didn't have to rename. I have also tried to just give the Gun turret the type of "Energy" and then it also works. Its only if its called "Gun", or one of the other turret type names I had to rename as well, it doesn't work. I thought...

    I found some code in the program that still relying on turret type to be "Gun" so to make it work again I renamed it to "Gun1" as I have done the other places, but now it crashes again with the same family error as in r164.

    And its really annoying since it makes no sense that it works, (Thought it worked) if it was called "Gun1" instead of "Gun". There are nothing special about this variable. The only thing its used for is checks like these:

    Turret.type = "Gun"

    To me it seems that the bug have somehow broken my game.

    Have anyone else had these problems?

    Description of Capx

    Just a turret defense game, using the turret function, nothing special.

    Steps to Reproduce Bug

      [1] Changing value of a variable.

    Observed Result

    Chrome:

    Nodekit:

    Expected Result

    -

    Affected Browsers

      Chrome: (YES)

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r164.2

  • Think you can do it like this, however this is just a theory so might not work correctly

    But I think you can do it by adding two checks.

    first you need to know the angle of the chassis, as its based on its angle to determine the limits of the turret.

    You need to calculate both limits. will call these High limit and low limit. Which simply means that high limit is the clockwise limit, and the low limit the counter clockwise limit.

    To calculate the high limit.

    Chassis.angle + 130 (Turret limit)

    This number you need to check if is more than 360.

    Chassis.angle + 130 > 360

    If that's the case you know that it have passed the 360 marker and will start to go from 0 and up.

    So to calculate that one, you have to do the following,

    (Chassis.angle + 130) - 360

    That will give you the high limit, if Chassis.angle + 130 is more than 360.

    Its pretty much the same for the lower limit.

    Chassis.angle - 130 < 0

    To calculate the lower limit if it passes 0 angle marker.

    (Chassis.angle - 130) + 360

    Will give you the lower limit.

    Example using real numbers:

    Chassis is moving upwards at an angle of 245 and the turret is just following along at the same angle.

    Lets assume that an enemy shows up at angle 60 (Somewhere behind the tank)

    So to see if the turret can actually hit it, we calculate the two limits.

    High limit (Chassis.angle + 130 > 360)

    245 + 130 > 360 = 375

    Since that pass the marker we calculate the following:

    375 - 360 = 15 High limit angle

    Low limit (Chassis.angle - 130 < 0)

    245 - 130 < 0 = 115

    Since this doesn't pass the 0 angle marker we can use the calculated angle as the lower limit.

    So the tank turret will be able to shoot at everything going from Low limit angle 115 to high limit angle of 15.

    So in this case it wouldn't be able to attack the enemy.

    Anyway its just a theory, I haven't actually tested if it works, but think it will

  • Not sure why I didn't just test it

    Anyway seems that it doesn't select a new one, and not really sure how you could do it, none of the functionalities seems to make it possible. Also connecting a new host, will not allow the current peers to communicate with the new one.

    Seems like the only options as of now, is to connect a Administrator host of some sort, that is just always connected.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Think you can solve it by making the tilemaps global, and if that doesn't work try to add the persist behaviour as well. But I would assume that making them global would be enough.

    You make them global by selecting them and in the properties mark it "yes" in global.

  • I don't seem to have any problem connecting to the signal server. "wss://multiplayer.scirra.com" If that is the one you are wondering about being down?

    However was wondering, since everything goes through the host.

    And the first person to join become host, does it automatically figure out to choose a new host, if that person leaves. Or do you need to constantly check to see if the host left or not.

    In the chat tutorial different groups are activated based on the person being host or not. But I don't see anything that would activate a new host if the current one leaves. Anyone know how that works?

  • Problem Description

    I added the sync instance variable and got these two errors when I pressed ok and then abort afterwards.

    Error 1:

    ---------------------------

    Construct 2 Check failure

    ---------------------------

    Check failure! This is probably a bug:

    InstanceVariable is NULL in condition/action parameter

    Condition: iv != NULL

    File: Projects\Parameters.cpp

    Line: 1151

    Function: void __cdecl SubstituteParameterString(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,int,const class EventParameter &,int,bool)

    Build: release 164 (64-bit) checked

    Component: Construct 2 IDE

    (Last Win32 error: 0)

    You are using a 'checked' release of Construct 2, intended for testing, which causes certain errors to be reported this way. Hit Ctrl+C to copy this messagebox - it's useful information for the developers, so please include it with any bug reports! Click 'Abort' to quit (unsaved data will be lost!),'Retry' to turn off messages for this session and continue, or 'Ignore' to continue normally.

    Error 2:

    ---------------------------

    Construct 2 Check failure

    ---------------------------

    Check failure! This is probably a bug:

    Object texture leak: a texture is still loaded when cleaning up an ObjectTexture, check all textures released properly

    Condition: gl_instances.empty()

    File: Projects\ObjectTexture.cpp

    Line: 33

    Function: __cdecl ObjectTexture::~ObjectTexture(void)

    Build: release 164 (64-bit) checked

    Component: Construct 2 IDE

    (Last Win32 error: 0)

    You are using a 'checked' release of Construct 2, intended for testing, which causes certain errors to be reported this way. Hit Ctrl+C to copy this messagebox - it's useful information for the developers, so please include it with any bug reports! Click 'Abort' to quit (unsaved data will be lost!),'Retry' to turn off messages for this session and continue, or 'Ignore' to continue normally.

    Attach a Capx

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

    Description of Capx

    The Capx is just a test of the multiplayer functionality, it allow two people to chat, and was trying to make a sprite sync between client and host.

    Steps to Reproduce Bug

      [1] Add sync instance variable to function "Sync unit" [2] Add Sprite as object in the Sync instance variable and leave everything as default and press Ok.

    Observed Result

    C2 crashed.

    Expected Result

    That it didn't crash

    Affected Browsers

    Not related to browser but to C2.

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r164

  • Thanks for that, can see it works in Chrome, at least my first tests so that's good.

    Just hope they add it so it also works in nodekit, as I hate testing in browsers, there are always something that doesn't look right

  • Have the exact same problem, how and what caused it, and keeps causing it I don't know.

    From disabling and trying different stuff, certain things seems odd.

    It seems that certain event run even though there conditions are not met.

    A very simple example is that I clear all rogue objects at the beginning of the layout, including all enemies.

    However if I enable a event like this:

    Enemy.Health <= 0 : Enemy.destroy

    The game crashes completely, even though there are no enemies on the map.

    This is the error I get:

    There was no problems in r163

  • 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.