R0J0hound's Forum Posts

  • This is also doable with events:

    http://dl.dropbox.com/u/5426011/examples/append2.cap

    req 0.99.84

    + Button: On Button clicked
      + File: File "dialog.txt" exists
      -> EditBox: Load file "dialog.txt"
      + System: Always (every tick)
      -> EditBox: Append text NewLine
      -> EditBox: Append text Name.Text & " :"&NewLine&NewLine
      -> EditBox: Append text """"&Dial.Text&""""&NewLine
      -> EditBox: Save file "dialog.txt"[/code:2lq13ftb]
  • [quote:jh4a8p41]As far as I know, there's no way to link Construct python scripts together. Like, if a python variable is defined in one script, you won't be able to access it in another.

    Not so, if variable is defined in one script, it can be accessed in a second different script. Basically the state of python (defined variables, functions,... etc) remains after the script is run.

  • You need to use conditions to pick (or select) one of the duplicates, or instances. Also it's good to note that after an object is created it is automatically picked.

    One way to pick only one instance would be:

    + Sprite: Pick one at random

    -> Sprite: Set animation frame to 1

  • You need to enable "3d layering" in the layer properties.

  • Instead of using different objects per remote player, use just one :"players".

    if data['player'] != System.globalvar("myPlayer") :
       for w in players:
          if(w.Value("player") == data['player']):
             w.SetPosition(data['playerx'],data['playery'])
             break[/code:303ifi0x]
    
    But until "pick.Value("player")" works use the function object to get the private variable:
    + Function: On function "PVplayer"
    + players: Unique ID is Function.Param(1)
    -> Function: Set return value to Sprite.Value('player')
    
    and the code would become:
    [code:303ifi0x]if data['player'] != System.globalvar("myPlayer") :
       for w in players:
          Function.AddParam(w.UID())
          Function.Call("PVplayer",0)
          if(Function.Return == data['player']):
             w.SetPosition(data['playerx'],data['playery'])
             break[/code:303ifi0x]
  • Here's a fairly simple way to do it using a hash table. The hash is used to map the obj names and the object type's OID. The OID or object ID is different for each type of object. Different instances of the same object type will have the same ID.

    Example: Pickbyname.cap

  • Use the System->Compare condition with the "Sprite.Count" expression

    + System: Sprite.Count Equal to 0
    -> You win[/code:23cjhi1o]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:3urh9hhc]But why did you move Forest to Start of layout? So it only runs once? In this case is I think it is not necessary but was that for better form or future problem solving?

    Yea, I moved it so that it is only run once otherwise it will be run every frame. It's trivial in this case, but with large projects it's good practice and reduces the number of events evaluated per frame.

  • Hi Wetasaurus,

    [quote:3q3643ym]So is the player/terrain moving or is it more like a carpet being pulled beneath the object to imply motion?

    The player is moving like normal when it's X position is between 200 and 440, and when the player passes either of those boundaries he is kept from moving and the terrain is moved (like a carpet as you say).

    [quote:3q3643ym]What is this TimeDelta concept?

    TimeDelta is the difference of time from one frame to another.

    [quote:3q3643ym]I'm not used to the "." between events - is that merely a separator in the line or is that fundamental code?

    Fundemental code. See "Object expressions" in the wiki http://sourceforge.net/apps/mediawiki/construct/index.php?title=Expressions

    [quote:3q3643ym]Terrain: Set X to Terrain.X-player[Platform].VectorX*TimeDelta

    Player: Set X to 440+player[Platform].VectorX*TimeDelta

    I'm using the simple formula "rate X time = distance".

    The first line moves the terrain at the same speed but opposite direction as the player. And the second moves the player to the boundary plus any any movement the player was going to avoid jitter. Try setting the second line to just 440 to see the difference.

    Cheers.

  • <img src="http://img267.imageshack.us/img267/8660/temp.gif">

    Else only works with conditions at the same level. Eliminate most of the condition nesting. I also moved the comparison condition for the global 'terrain' to under start of layout, as it only needs to be done once.

  • Works for me here. Although running in debug mode does give me a black screen, but if I remove the Advanced Camera then it display's correctly. I'm using Construct 0.99.84 and Advanced Camera 0.92b.

    Drule what version of Advanced Camera are you using?

  • Well as you probably understand, logging into your bug tracker account, performing a search to see if your bug has already been submitted, writing an elaborate description of the problem and then providing a .cap file reproducing the error is a pretty big hassle when you encounter a glitch every 15-30 minutes of your game making session.

    That makes for good bug reports. The devs work on construct in their spare time, and the current system saves them time. The time and hassle needed to submit bugs to the trackers helps reduce the time needed for the devs to isolate and fix the bug. Also nothing is preventing you from posting about bugs on the forum, but any bug should be ultimately submitted to the tracker. Otherwise like Ashley said, the problem might not get looked at.

    Cheers!

  • yeah in order to use private variables in python the plugins that use them need to be recompiled. Until then they don't work... I'll see if I can get the necessary plugins recompiled before the next build.

  • Here's an example using overlapping at offset:

    http://dl.dropbox.com/u/5426011/examples/gridmovement.cap

    Made with 0.99.84

  • Is it broken? From your description you are trying to do something like this:

    + Text: Value 'var' Equal to 0 or 1[/code:2svbv8u7]
    
    When read it makes sense, but in construct and almost every programming language out there it is read like this:
    The expression "0 or 1" will be computed as "1".  So the event will always be read as:
    [code:2svbv8u7]+ Text: Value 'var' Equal to 1[/code:2svbv8u7]
    Which is not the desired condition. 
    
    Here is a correct way to use "or" with the System -> Evaluate condition:
    [code:2svbv8u7]+ System: (Text.Value('var')=0) or (Text.Value('var')=1)[/code:2svbv8u7]
    
    If I misunderstood, please clarify.