nimos100's Recent Forum Activity

  • nimos100

    But anyway, now I understand that this first method of "1= true and everything else = false" is the methoted that Asmodean presented to my on his .capx exemple. Right?

    Yeah pretty sure that was the idea behind it.

    [quote:2tttmvz9]But how about the other method? It's still unclear to me how could I store the uid for the specific object on the circunstances that I need. And despite the solution that I already have, it's always good to understand the options and really learn about stuff instead of just copying... Of course if you could take your time again and try to explain it

    The reason you can do it, is because as you create an object you have already picked it. So you can store the UID. Simply by doing "Stored_UID = Object.UID" So in this case you can say that the condition for the picking is that, its the last object created.

    Compared to a "normal" condition like "Object.Name = James" would pick all objects which name are "James". This would just store the UID of the last object created, and you can then pick it later on using this.

    "Object.UID = Stored_UID"

    Which would be the same as doing "Object.Last_created_Object = true" but when using the UID you don't have to change "Last_created_object" to false all the time, because there can only be one last created object at the time. So you know that the "Stored_UID" will always be the UID of the last one created.

    [quote:2tttmvz9]By the way do I need to close this topic or something? I don't really know how to do that.

    You don't need to close topics it will "close" by it self when no one answer to it anymore

  • I do have a few questions though, to see if my plan is feasible:

    1. Would my pool of labor be limited to people who are already familiar with C2? Could any old programming freelancer pick up my project and do what I need, or would I have to look for help specifically within this community?

    2. How much would such a thing cost? How long should it take for the freelancer to complete his task?

    3. Is there any big hole in my plan that I'm not seeing here? Like I said, I don't have a background in this type of thing, I'm kinda feeling my way through the dark here.

    This ended up being pretty long. Sorry about that.

    Thanks for any help!

    1. I would assume that you are best off with getting someone that knows C2 or at least have a fairly good understanding of it and then someone that knows how to work with web content in general, to avoid running into security problems with account information, buying content etc if you plan on having a website as well.

    2. Well that's a difficult question to answer as the full scale of the game are not know, but only a rough overview. But wouldn't assume that its cheap.

    3. I think its fine that you wonder about this. But if I were you I wouldn't spend to much time on this at the moment until your game is closer to being finished. Because as you work on it, you might get enough experience that you can actually make it yourself.

  • Hi all. I've recently decided to start selling animated characters and effects on the Scirra Store and I have a quick question. What size do you like to get your art in?

    You don't really have to make the graphic the power of 2, its mostly due to older graphic cards, where the power of 2 were faster than using some odd numbers and some cards needed that scale. But most graphic cards today will handle it just fine as they have a dedicated GPU, memory and of course better in general.

    However it used to be that you made graphic in the sizes of 64x64, 128x128 etc. Because the graphic was converted to these dimensions anyway, as far as I know. Which means you don't save any memory anyway and might cause worse performance If not the power of 2. but anyway not 100% sure about whether that still the case with newer graphic cards. Would probably need Ashley to explain how it works, to be certain. But personally I wouldn't worry to much about it.

    Also regarding sizes, its generally a good idea to make the graphic the correct size so no scaling is needed. Regardless of whether you scale up or down, it will hurt quality. But in general its always better to scale down than up in my opinion.

  • Hi Community,

    I am working on a Quiz project that needs to work with 1000's of sounds (i will not be able to import all these sounds for obvious memory and loading time reasons). Since this quiz game will be played on iOS devices, the "streaming audio plugin" or "play by url"option will not work due to the playback delay caused by safari when you stream outside audio. My best option would be to first import select sounds ON RUNTIME AND INTO the game and play them as standard imported local audio.

    Ashley, newt, How would i be able to achieve this?

    Thank you in advanced for the assistance.

    There are no good way to do this as far as I know as you can't access the source of audio object for some weird reasons. So you need to make some workarounds to make it work.

    The only way I have figured out to do this, is to setup a variable path in the audio object and then you use this as the path to your audio files.

    However since the source requires a non extension path meaning the file can't be "sound.ogg" for instant, as C2 wont accept that it needs to be just "sound". So you need to make a functionality that extract the filename without the extension and then you add it together with the rest of the path so you get the complete path to the file.

    So the source when you are done should look like this:

    Path = "C:\Sounds\"  <--- Variable where you store the path to the files.
    Filename = "Sound1"  <--- This being the filename with the extension removed.
    
    In the Audio object source you add it together:
    Source: Path & Filename   <--- Read as (C:\Sounds\Sound1)
     [/code:50wmquii]
    
    So every time you want to load an audio file you have to update these two variable or just add it all in one depending on what you prefer. Its not really elegant but can't see any other way to do it.
  • 4 players assigned to a single object that differs only by instance variables have to control each one with their controller and/or keyboard. You'll need the following code:

    > Function "Move Left"
    Function "Move Right"
    Function "Jump"
    
    // Function Param 0 on all of them is instance variable "Player"
    //Then you'll need to call these functions for each Player, so you either have to do it manually
    
    Get "Object" with "Player" = 0
        On Gamepad "0" Button "D-pad Left"  Pressed
            OR
        On Keyboard "A" Pressed
            -> Call function "Move Left"
        On Gamepad "0" Button "D-pad Right"  Pressed
            OR
        On Keyboard "D" Pressed
            -> Call function "Move Left"
        On Gamepad "0" Button "A"  Pressed
            OR
        On Keyboard "Space" Pressed
            -> Call function "Jump"
    
    // Then repeat 3 more times for the other players
    // Or use a Loop
    
    For each "Object"
         On Gamepad "Object.Player" Button "D-pad Left"  Pressed
            OR
        On Keyboard "A" Pressed
            -> Call function "Move Left"
    // but oh, it doesn't work...
    // First we're assigning key button A as "left" for all players, so if we really want to go with this approach we still need to use an array and call "left" by Object.Player as X and keyboard key codes as Y
    // Second and to be fair more importantly, you cannot have triggers inside a loop, so the whole idea is out the window
    [/code:1hxotwd5]
    
    I think you're missing the point that every gamepad key has a key on the keyboard that mimics it. You CAN do it manually, but it will be a lot of repeating code and if something needs to be change it'd be a headache.
    
    I really need to take a break...    I'll leave everything for the weekend or even a whole week and come back to it with fresh mind later. Thanks @nimos100 for the great suggestions!
    

    Im not sure I fully understand the issue. Because does it matter which player is using which device? If I understand you correct. There are 4 players in total, 2 players are using the keyboard and 2 are using gamepads?

    But since the keyboard and the gamepads use different inputs, i don't really see what the problem is. You make a control set for each of them, sort of like you have done already. Controller 1 to 4.

    Group Controller 1 and 2 will always be keyboard

    Group controller 3 and 4 will always be gamepads

    But whether a player presses A on the keyboard to move left or a gamepad they use the same action right?

    But you are correct that you will need 4 groups for the controlling of the players to figure out which type of input is getting used. That being keyboard or one of the gamepads. But you will only have to set this up once. All the functions etc can be reused. But you already have this in your current design so why is that any different?

    [quote:1hxotwd5]First we're assigning key button A as "left" for all players

    This confuses me a bit, all players can't push the same button at once or what do you mean?

  • There is a rotate towards position I think its called, you can add the X,Y position of the picked object in here. Also Angle(X1,Y1,X2,Y2) will give you the angle between two objects. But sounds like the first option is what you might be looking for.

  • nimos100

    You are right. But I don't think the problem comes from the "Controls" group/function. I really don't think that it is that complicated. Just pull inputs from devices and store them in an array.

    It's the "Player" function (yes there were 2 conditions that didn't do anything - leftovers from previous testing). I think it's not comparing enough stuff and needs more conditions, that's all.

    Look at this (it's the exact same function, but Player0 and Player1 branches are split and it works just fine):

    As I said it was just my advice to you. Of course you can make it whatever way you think is best and it will most likely end up working.

    The reason I gave you that advice is because as your project grows, you are really not interested in "complicated" solutions, you aim for the most simple, optimized solution that you can make, because it makes it so much easier to troubleshoot, add and change later on when you might not have focused on the controlling parts for a while. So you want to be able to quickly go back and read the code and quickly find out where you have to change things. As I wrote in the first post, I think you are making a very complicated solution and its even hard for you to troubleshoot it, so imagine someone having to do it, that don't know the thoughts behind it.

    Looking at the screenshot to give you an example:

    You call the function "Player" which then calls another function called Control, so I assume that you aim to add something else to this function such as Shooting etc? Because otherwise it would be better to simply call the function "Controls" directly from where you call Function Player.

    You then depending on the Player parameter (0,1,2,3) duplicate the same functionality, only difference is whether the passed parameter is (0,1,2,3). But before that you call the function "Controls" which doesn't really handle all the controls, but only part of it, the actual control is done in Function Player depending on a value in the array.

    But in each of these events (Value at (Function.Param(0),0) > 0) etc. You have the simulate behaviours. But your code doesn't make sure that for instant (Value at (Function.Param(0),0) > 0) and (Value at (Function.Param(0),20) > 0) and (Value at (Function.Param(0),21) > 0 can't all be true at the same time. So if the array screws up then the movement will bug as well.

    So what im saying is if you for instant have a function called "Player Move Left", then already at this point you know what the function does. Its doesn't handle anything else. So to make it work you just need to pass the correct Player and all of them can use the same code.

    Function Player Move Left
    Pick Platformer.Player = Function.Param(0)
    Platformer Simulate Pressing Left
    [/code:3l9nmrgh]
    
    This would be able to handle left movement for all players. So the only thing you have to do, is to add events like:
    
    [code:3l9nmrgh]
    On key press A
    Function.call("Player Move Left", <Player nr, that is linked to this control>)
    [/code:3l9nmrgh]
    
    And that would be it. No need to store anything in arrays or anything, its very easy to read the code and it does exactly what you would expect. 
    
    I can read your code, but going through all the values stored in the array, following all the function calls. Making sure that the value in array actually match what it should etc. Just take to long time that I think you are making things a lot more difficult for yourself than it needs to be, you have to troubleshoot and track so much code to figure out where it goes wrong. 
    
    Ps. You don't need a Trigger once in functions, as it will automatically only trigger once, when you call it. But anyway, its not causing the problem, its just that it makes no difference whether its there or not.
  • To understand the problem run the capx and do this: "if you press A a couple of times you'll see Player0 moving a few pixels to the left. If you repeat this with the LeftArrow the Player1 will do much of the same. However if you hold on A and press the LeftArrow Player1 will go left as if the "trigger once" does not exist." This should not happen. It means that while Player0 button is pressed the function continues to return TRUE and Player1 instead of moving a pixel to the left and stopping is shooting through the screen.

    I think your have a picking problem some where, so the players get mixed up. However I can't seem to figure out where it goes wrong. Anyway you have some code in your program that doesn't really do anything.

    Function Parameter 0 = Function.Param(0) I assume this should compare towards the function "Control"? However you never return any value from this function. In case its not that function, then you might as well remove the check as it doesn't do anything.

    But overall, I would strongly consider redesigning the way you want the control system to work. The way I would do it is something like this:

    1. Make a separate event for each direction or button. So one for Left, Right, Up, Down whatever you need.

    2. Make a function for each direction/button, that requires the Player_number as input and in these function you apply the actual functionality. Like Platform.Simulate Pressing Left etc. Which is to avoid problems and confusion with function return values etc. Which aint really needed. Its a lot easier to work with simple functions that handles very specific things rather than making functions taking care of a lot of things.

    All this will be a lot less code than you currently have and doesn't require an array. My guess is that unless you need the array and to make the controls the way you are for some very specific reasons. You are causing a lot more problems for yourself than you have to and there is a big chance if you need to change it later on for whatever reason, you might run into some huge problems. Besides that redesigning it, will most likely be faster than solving the one you currently have set up, and a lot easier to maintain.

    Anyway think that the best advice I can give you.

  • I know it has something to do with the way the Player function is designed and/or called, but I really have no clue where.

    Any ideas?

    Not really sure what the problem is. but I downloaded the Capx and is a bit confused as it must be the most complicated control setup I have ever seen

    What exactly are you trying to achieve?

    Why do you store all the activity in an array?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why do events only run on one core?

    Think its a good explanation, even though its never really been an issue for me personally at least. But none the less you write this under the sequential logic section:

    [quote:3mo2a70m]Running part of that workload on a different core doesn't help at all, since the tasks must still be done in order, one after the other - the same as on a single core.

    Construct 2's event sheets run in top-to-bottom order, conditions are evaluated top-to-bottom, and actions are run top-to-bottom. Anything an event refers to could have been changed by previous events

    Which of course is true. But was wondering when you add an event like "-> On object destroyed" these are triggered even though they might not be the next event or even on the same event sheet. So at some point these are executed before the next line of code right? Even though the object is not actually destroyed before the next tick. Can you elaborate on that, meaning does C2 jump to this event and destroy it, keep the object in memory, until next tick and then continue from where it were destroyed, or does it strictly follow the top-down order here as well?

    Anyway just wondering.

    EDIT:

    Nevermind that, since you are not referring to triggers, cheers

  • nimos100 Here you go. Going to sleep on this before I try and fix it.

    https://drive.google.com/folderview?id= ... sp=sharing

    Can't seem to be able to download all files at once. And there is a lot of files so wont bother with that <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    However as Kyatric suggested, I would use functions a well. Because you can simply organize the function to work based on a parameter that you pass to it.

    So if you make a code like this for instant:

    [Dialog][Step]

    This would make it possible for you to track which dialog you are working with fairly easy. So in this example, you could for instant pass D002S03:

    And you would know that the first 3 numbers refer to the overall dialog also indicated by the D and the last two which specific step in that overall dialog it is, indicated by the letter S:

    So passing D002S03 to your function would be Dialog 2 and the current step is 3

    Anyway just an example, you of course would have to make a code system that would work with your game. But at least that way you don't have to copy/paste, activate/deactivate a lot of groups.

  • Collision object

    This is not a functionality in C2, so its more of a suggestion.

    The idea is to be able to add an empty invisible collision object instead of having to use sprites, which is the normal way of doing it now as far as I know. But doing this uses a lot of memory for no good reason. So what this object would do, is to make it possible to specify an area kind of the same way you would set up a collision mesh on a sprite, but this would be done in the layout, instead of in the graphic editor. The object would work in the same way as a sprite would when it comes to collision detection, but wouldn't be able to hold any form of graphical information, thereby making it possible to use more complicated collision solutions that wouldn't eat up memory for storing empty sprites.

    So basically the object simply keep track of a collision mesh, maybe with the ability to manipulate it at runtime and whatever other functionality could be found useful.

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