jangsy5's Recent Forum Activity

  • GIMP and Paint.Net

    Both do almost similar things but the layouts are slightly different. I prefer GIMP though.

    I still don't get how people can use a mouse to draw awesome drawings. I'm perfectly fine with a mouse to click or drag but never to draw. *sigh.

  • Thanks heaps R0J0hound. Just knowing how to retrieve names and attributes helped a lot. If only there was some more in depth tutorial of the integration of python and CC or at least a descriptive reference table. I might make one once I master the basics.

    I'll digress. I have been wondering how I could make a sprite object appear near this object called 'player'. I wanted to make a proper range limit to it, as in randomly spawn in a circular area around 'player'.

    So here's what I've come up with. Using some basic Pythagoras Theorem to randomly spawn objects in a circular area relative to 'player'.

    from random import random,randomint,choice
    from math import sqrt,pow
    
    def SpawnNearPlayer(o,l,rangeMin,rangeMax):
         objectN = o.__class__.__name__
         playerN = player.__class__.__name__
         
         rads = randomint(rangeMin,rangeMax)     #distance from 'player' object
         xside = randomint(1,rads)*randomint(-1,1)     #randomising x-axis
         yside = sqrt(pow(rads,2) - pow(xside,2))*choice(-1,1)     #randomising y-axis to fit x-axis and distance
         
         #create the object relative to 'player'
         System.Create(objectN,l,
              int(xside)+getattr(SOL,playerN).x,
              int(yside)+getattr(SOL,playerN).y)

    I know there must be a more clean or better way of doing this but with only couple of weeks total experience in programming I'm still a newb.

    Also there is another problem. The function I just wrote will definitely create objects out side the screen too (outside the game boundaries). This may cause some issues and I was wondering is there a way to cut out the area that is outside the screen?

    I mean to say is there some kind of method that takes into consideration the boundaries of the game so my function won't choose a vector there?

    I must learn more but the official python manual is a pain to read through. All I need to know is things that are slightly advanced than beginner's (since I attempted to learn C#).

  • The only thing I can come up with is something like an object canvas that has alpha effect and draws on 'white'(that will be transparent in alpha) on a black background which will reveal the sprites behind the canvas. Never tried and possibly never be able to do it myself.

    Sorry but just an idea.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

jangsy5's avatar

jangsy5

Member since 17 Aug, 2011

None one is following jangsy5 yet!

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies