jangsy5's Forum Posts

  • Really confused but is this what you're looking for?

    say there's a player name "bob"

    Then what you're saying is that his name will be something like "{bob}" in your game. If that is so then using your method the tags are removed and is left with "bob".

    If so what you're trying to do is call a global variable global("bob"). Problem is I don't know if you already have a global variable "bob". Unfortunately I don't know how to create global variables in run time. I don't think you can. I can do it within python but that's separate from CS and will be some what a 'private' variable in essence.

    Global() is just a call function. If I miss understood and you already have a "bob" global variable and/or know how to implement it in run time I can only say: have tried adding quotation marks around r2.text? Like global('r2.text')?

  • Yes you can. If it doesn't you can convert the format to the right one. I haven't tried the 3D object in CS but it's likely using .3ds or something common.

  • I have no idea most of what is in the script but it works and I figured out how to control the menu. All I need to do now is know how to add the tick boxes in the menu and small windows forms to appear when you click those. I guess there's a doc or something like that right?

    I guess I'll try to find it and learn how the rest works. Man I regret not spending some time reading C++ book. Dang.

    #

    Just realized its in C... gah, back to past anyone?

  • ah ha. Thank you very much.

  • Trying to make a game that has a Windows menu bar but Construct Classic doesn't seem to have a working editor so I decided I would look into python scripts.

    Took me some time but I found PyGTK which seem to do what I want but the question is, is that the best/most relevant library to use? I mean there are tonnes of others out there but all I can find was this.

    Any suggestions of whether this is the right choice or is there a more suited one? Also I'd like to know how to import it into construct. Do I just place the relevant dlls into the right folder to enable me to import it into the scripts or is it abit more complicated than that?

  • I think your friend needs to install somethings but I forgot exactly what they are. It's the ones that you needed when you want to use Construct. I think it's DirectX 9 and C++ 2005 redistributable. Not sure though. Sorry if I'm not much of a help.

  • I had some problems with spawning objects in the edges of the layer (at random positions). I thought of making an array table that is given an appropriate random variable to allow the object to spawn in the correct position.

    I drew up a flow chart but was way to convoluted for my taste so I just learned some python for about 10 minutes and wrote this instead to server my purpose.

    def edgeplacement(o,l):
         i = random.randint(1,4)
         xx = 0
         yy = 0
         switch i:
              case i==1:
                   xx = 0
                   yy = random.randint(0,768)
              case i==2:
                   xx = 1024
                   yy = random.randint(0,768)
              case i==3:
                   xx = random.randint(0,1024)
                   yy = 0
              case i==4:
                   xx = random.randint(0,1024)
                   yy = 768
         else:
              xx = 0
              xy = 0
         newobject = System.Create(o,l,xx,yy)
         newobject.angle = random.random(360)
         return true
    

    All it does is take in the type of object to spawn and the layout it spawns. There are only 4 possible sides the object can spawn in, since the whole point is to spawn the object from the sides. Each 'case' represents a side. The parameter 'o' is the object. The parameter 'l' is the layer.

    I'm doing this without actually testing it because I'm at a public computer and it doesn't have dx9... well it says it doesn't when I run the exe but I'm pretty sure its just the computer blocking my access.

    So, is there anything wrong with it? Is there a much much much simpler way? I'm a complete novice here at python scripting so please tell me if I got something wrong. I need to learn from others not just from books.

  • Doesn't really solve my question but thanks anyway.

  • Is it even possible to wrap the screen when it goes out of bounds of a layout, seamlessly? Because I want to make a game that allows the player to walk in one direction and end up coming back from the other side.

    Few things that needs consideration is that the screen resolution is 1024x768 while the actual layout is 2500x2500. Also the screen itself follows the player, which I also need to know how to do.

    Simply. Tell me how to wrap the screen and how to make the screen follow the player.

    I might be able to make the screen follow the player by simple means but if there were to be some kind of button or a function that does that please tell me.

  • aw dang. Just when I found the money to buy win 7 I find out win 8 is going to come out...

  • I'm glad you handled well. I just learnt something :D <img src="smileys/smiley31.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Already implemented. Thanks for the feed back too.

  • Since there actually isn't an object that handles a list of highscore I devised a method to do so in my game. Please correct or simplify it if you can do so. Some of it is in code, other bits are just descriptions. I'm not a wiz at coding so if this is wrong please point that out too.

    Assumptions:

    hsnumb[1...11] = int.

    hsname[1...11] = str.

    score = int.

    name = str.

    hsnumb[z] corresponds to hsname[z] (score and name)

    there are 10 places in the highscore

    Code:

    /// for loop

    ///

    for(z=10;z>0;z--;){

    if(hsnumb[z]<score){

    hsnumb[z+1] = hsnumb[z];

    hsname[z+1] = hsname[z];

    hsnumb[z] = score;

    hsname[z] = name;

    }

    else

    break;

    }

    /// end of loop

    ///

    Description:

    So here's what I did. I initiated a for loop. It starts at 10 and finishes at 1, I hope. If the variable i is not greater than 0 it ends the loop.

    If the statement is true then it checks if hsnumb[z] is less than 'score'. If so then hsnumb[z] will be placed 1 below that of itself which would be hsnumb[z+1]. hsname[z] will also be substituted into hsnume[z+1].

    Then that same array is substituted by the new score and new name, that is, hsnumb[z] = score, hsname[z] = name.

    If the 'If statement' is not true then the whole loop ended since there is no need for it.

    Essentially this code systematically goes through the highscore list from 10 to 1 to see if the new score is greater than any one of them. It starts from the bottom since it seemed to be logical and less convoluted from starting from 1. It checks to see if 10th score is less than the new score. If it is true then 10th score is put into a non existing 'garbage' (11th place) which is not displayed nor saved, it is just there as a place holder in prevention of a logical error. After that the 10th place is replaced by the new score (+name).

    This code then loops to check the 9th place to see if the new score is greater. If so then substitutions similar to the 10th place mentioned above occurs. 9th score is subbed into 10th score (which was new score) and the new score now subbed into 9th.

    The whole process continually repeats until it reaches 1st place or the new score is less than the place it's currently being compared with.

    I assume this works in a C++ coded game but I don't know if it's fully possible in the event sheet of CC.

    If there's already a tutorial about this without a cap file then I shall initiate a face palm procedure. If you did not understand the code then learn Arrays and For loop.

    Please tell me if this is right because I don't want to think about this for any longer. I'm moving onto my highscore save methods.

  • Oh Jobs why must you exploit something that once protected your frail company. One day you will have an epiphany just like Bill and resign and give half your fortune to charity.

  • > If there's a simpler way then please do tell me.If not would using pv more manageable than the other ways? Or am I understanding this all wrong and infact hash tables and arrays are nothing like pv (I know arrays are different).I would probably use global variables for this. Although, I'm not sure if you are aware of, but there's an expression that returns the number of instances of an object (Get number of objects), so you don't need to create your own counter depending on the case. You just need to use a System "Compare" condition and put it like "Sprite.Count < SpriteMaxCount".

    Ah I was looking for that in the editor but had no success. Thank you people for enlightening me on this area of programming. I just got better at it.