exedys's Recent Forum Activity

  • Hello

    I am trying to open an old construct 2 capx which contains a plugin that I no longer have downloaded and cannot find. It was called 'Cordova Dialog' by cranberrygame. Does anyone have it or know where to find it? If not how can I open the capx without using the plugin?

    Thanks

  • Yep in the condition you need to pick the instances. Weapon held but if there is only one weapon then fair enough and also the weapondrop object. So I guess you would use player is overlapping weapondrop or something similar.

    EDIT: I added a parameter to the function where it would take the UID of the weaponDrop the player swaps with and used 'Pick by UID' in the swap and now it works properly! Thanks a lot!

  • There is only one weapondrop instance in the game? Are you sure? Looks like weapon is being assigned default values from a weapondrop instance instead of one you have selected and then the others update as expected, weapon stats to variable and then variable to weapondrop.

    There are multiple weaponDrop instances but there is only one weapon instance. Would I have to specify what weaponDrop instance I am referring to in order to stop it from updating to the default values?

  • The bit about it triggering once is also important or you're going to see constantly swapping variables. What does the start of the event look like ?

    This is the start of the function.

  • You are not picking the currently held weapon in the condition, you need to do this to set those values to the temporary variable. Then when you use weapon.id etc it will relate to the currently held weapon. Also make sure it's a trigger once event on a key press or similar and not running constantly.

    There's only one weapon object in the game at any time and it already only occurs upon swapping weapons so I don't think it is to do with not picking the right weapon.

  • I have an object for the player's currently held weapon and for a weapon on the ground. When the player swaps weapons all of the stats in the currently held weapon get transferred into a temporary variable (e.g: Set tempAccuracy to weapon.accuracy). All of the temporary variables are local static variables. After this the currently held weapon gets the stats from the weapon on ground and weapon on the ground gets the original stats from the held weapon.

    Here is a picture of this part of the event sheet (zoomed out as far as I could while making it legible):

    However, when the weapons are swapped the stats do not carry over correctly:

    Before the swap

    After the swap

    Does anyone know how I can make this work? (and possibly more efficiently than an event that is dozens of actions long)

  • You want to avoid checking a boolean and then checking the inverted value. If you follow the code, if lockedOn is true, it is set to false THEN the very next line checks if it is false, (which it is, because you set it to false), and sets it to true again. You want to use ELSE in this situation so you only check the value once, and react to it. As it happens, a simpler solution is to toggle the boolean!

    Thanks alot! This works perfectly!

  • Locking on works, but getting rid of the lock doesn't.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do not have permission to view this post

  • So can I just setup the integration like normal without adding the java script origins?

  • Basically just the title. I want to be able to control my platformer character, with standard animations but I want ragdoll physics as well as that. If I need to I can animate my character using physics as well.

  • Trying to integrate for Android.

exedys's avatar

exedys

Member since 26 Jul, 2017

None one is following exedys yet!

Trophy Case

  • 7-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies