RomanCenturion's Recent Forum Activity

  • [quote:lhqhdp1s][quote:lhqhdp1s]

    In my game, I use the OID of sprites a lot. However, Construct has for, some reason, given two sprites the same OID. Is this normal?

    It is normal, OID is unique for each object type, so two instances of the same type will have the same OID.

    Sorry, I didn't clarify. They were two different objects, not different instances of the same type. I don't think it could have been a mistake since it worked before, but I'll never know now since I got rid of the OID part of my project and converted it in private variables.

    [quote:lhqhdp1s]You want to use UID, it is unique for each object, so no two objects will ever have the same UID.

    Thanks, I think this will help with an issue I'm having of choosing which instance of the object.

    Edit: Is there a limitation on how many lines of script you can have?

    I got up to 65 and nothing after line 65 gets executed.

  • [quote:2qbexcfc]I'm not exactly sure how you want to create, change and use the values.

    I don't know if this will clear things up, but I'll try to.

    at 1,2,1 value = something
    at 1,2,2 value = something else
    at 2,1,1 value = something else
    etc...
    if object clicked:               #what would this be?
    x = 1
    avar = 3
    if object clicked:
    x = 2
    avar = 3
    etc...
    #y and z would be determined by other factors
    if avar == 3:
    text.SetText(value at x,y,z)
    avar = 2
    [/code:2qbexcfc]
    In my game, I use the OID of sprites a lot. However, Construct has for, some reason, given two sprites the same OID. Is this normal? Also, Construct gives the sprites a different OID each time. Is there a way to influence Construct so that OIDs will be at least different from each other each time? I know a way I can work around this, but I'm just wondering why it did this? On a side note, can OIDs be made so that they're always greater than 0? I've tried Sprite.OID + 1, but it seems to cause bugs.
  • For some reason this way of setting global variables wasn't working.

    System.SetGlobalVar('menunum') = 2[/code:aylto7xh]
    Instead I had to use this.
    [code:aylto7xh]System.SetGlobalVar('menunum',2)[/code:aylto7xh]
    [quote:aylto7xh]#" is how you make a comment in Python, not "//"
    
    ya, I know, I get the comment sign mixed up with other programming languages. I believe "//" is java, right?
    [quote:aylto7xh]you might be able to save sometime by using a dictionary
    
    That's probably a good idea. Could this be used to substitute for an array? I wouldn't be using it to save the game, but it would store values with 3 keys (ex. (x,y,z) or (1,2,1)).
    
    This brings me to my final two questions:
    How do you get the oid of an object using python?
    Is there a place where I could have found this information at?
    
    Edit: Solved oid issue. Instead of object.OID, I used Object.OID.
  • Thanks! There's not a lot of posts about python in the forums which can make it difficult to learn it. Using this should make my list of 40 or more things take less time to make.

  • I'm pretty new to python(completely) and I was wondering how to make an object at the mouse position and if this small script would work. I apologize in advance for all the errors in it. Like I said, I have no experience with python.

    if System.global('action') == "Build":
    	System.global('menunum') = 2
    if System.global('action') == "Gather":
    	System.global('menunum') = 3
    if System.global('action') == "House":
    // how do you create and object at mouse position?
    [/code:k2idk6u4]
  • First of all, it would be easier to determine the problem if you posted a .cap.

    Okay, so I'll try and run through how to make a simple selection and de-selection .cap.

    First create sprites sprite1 and sprite2, box dragbox, and mousekeyboard

    Next, give dragbox the selection box behavior, and sprite1 and sprite2 the RTS behavior

    Thirdly, create the private variable for both sprite1 and sprite2 called selected with the text value "no"

    Then add the following to the event sheet:

    on left clicked on sprite1 -> sprite1: set 'selected'(the private

    variable) to "yes"

    on left clicked on sprite2 -> sprite2: set 'selected'(the private

    variable) to "yes"

    pick all sprite1 in selectionbox | sprite1: set selected to "yes"

    (from dragbox behavior) _____ ->

    pick all sprite2 in selectionbox | sprite2: set selected to "yes"

    (from dragbox behavior)

    on right mouse button clicked -> sprite1: set selected to "no"

    sprite2: set selected to "no"

    on left clicked

    Sprite1: Value 'selected' is -> Sprite1: move to mouse (RTS

    equal to "yes" behavior)

    on left clicked

    Sprite2: Value 'selected' is -> Sprite2: move to mouse (RTS

    equal to "yes" behavior)

    Sorry for the rough formating. Hope it helps.

  • Comparing your screenshots to what I'm getting, I think somethings wrong with what I see. All I see is a black background, gray circle and an orange circle getting bigger, then smaller, bigger, then smaller(orange cirlce only).... I tried pressing all the controls you mentioned, but the only thing I can do is move the gray cirle within a certain area. If you used pixel shader, it might explain it since my computer doesn't support pixel shader 2 (I think, it has problems with it anyway).

    Anyway, here are my suggestions though I can't play your game(sorry if they are already included in your game):

    Menu with following options

    -Play Game

    -Instructions or Tutorial

    -High Scores

    -Quit(maybe not necessary since they can click x in corner?)

    Play Game could go to a submenu screen where the player could pick a level with the terrain, graphics, difficulty, etc. that they wanted.

    You could give a short tutorial in the game to explain all the controls and some objects in the game.

    Obstacles and objects that will fall and kill the miner if he/she removes blocks from under it.

    Tunnels collapse after a certain amount of time has passed.

    Supports that extend the amount of time before a tunnel collapses, possibly infinently depending on the level of difficulty.

    On easy difficulty, make adaptable difficulty. For example, if a person gets killed so many times within a certain time period by aliens, decrease the stats of the aliens (Those were aliens in your screen shot, right?).

    Just giving you some ideas, I hope they help.

  • It's awesome

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm wondering if there is a bug with construct 0.99.91. Basicly, the following code doesn't work:

    C: On Left Clicked on mutesprite

    Inverted C: Master is Muted (an XAudio2 function)

    A: Set Master Muted (an XAudio2 function)

    A: mutesprite: Set animation to "Animation 1"

    C: On Left Clicked on mutesprite

    C: Master is Muted (an XAudio2 function)

    A: Set Master Unmuted (an XAudio2 function)

    A: mutesprite: Set animation to "Default"

    C = Condition

    A = Action

    It works as long as you use any keyboard condition except for the left mouse click. Any ideas as to why? If it is a bug, will someone report it onto the bug tracker for me since I don't have a sourceforge account. Thanks.

    BTW-Why isn't there a condition for seeing if the Master is muted? Also, would it be "a XAudio2" or " an XAudio2"?

    Edit: The problem seems to occur whenever the keyboard condition for both events is the same. For example, replace both left mouse clicks with m and you have the same problem.

  • I think that if you don't have it compressed as a .rar file you might get some help. I know that in order for me to uncompress it I would have to pay some money. Making it so that it could uncompress itself would be a lot of help.

  • Okay, I know how to make your units be unselectable. I just need to know which version of construct you are using. If you are using 0.99.85, then here's a cap that will show you how I made units selectable and unselectable.

    http://www.box.net/shared/iejy4lon9s

    I'm sorry, but I haven't gotten to making units stop at a waypoint and am trying to figure it out for myself as well.

    By the way, don't create another unit until you have moved one unit of Team1 away from the spawn point. Also, read the comments to understand all the controls because I didn't use the same ones as you.

  • Thanks. I'll try out these methods and see if they work.

RomanCenturion's avatar

RomanCenturion

Member since 6 Apr, 2010

None one is following RomanCenturion yet!

Trophy Case

  • 14-Year Club

Progress

14/44
How to earn trophies