Juryiel's Recent Forum Activity

  • I did try a bunch of

    try:

    except:

    combinations with server and client. The issue is the myserver.Pump() command in the new layout to which I'm switching for sure. If I put that in a try/except block, the popup error goes away, though I still cannot communicate between server and client any more.

    The error message in particular is:

    Traceback (most recent call last):

    File "<string", line 1 in <module>

    File "PodSixNet\Server.pyc", line 39, in Pump

    File "asyncore.pyc", line 143, in poll

    File "asyncore.pyc", line 80, in read

    File "PodSixNet\Channel.pyc", line 52 in handle_error

    File "asyncore.pyc", line 470, in handle_error

    File "PodSixNet\Channel.pyc", line 59, in handle_close

    File "<string", line 28, in Close

    File "<string>", line 6769, in_getattr_

    File "<string>", line 6782, in _getitem_

    IndexError

    The function Network_disconnected under the client also runs when this happens, so I guess somehow the connection is being lost or cut.

    Also, is there no way to not even acknowledge incoming connections after I've gotten one player connected? I'm not sure it's ideal to have the server bother processing new incoming connections and sending error messages back. It'll work if that's the only way but I'd rather not even acknowledge any more connection attempts after a player has connected.

  • So I've been messing with this and have been able to get it working and to pass the data I want back and forth Thanks for the awesome tutorial.

    One thing I don't get is, how can I limit the number of connections? I don't actually know how this works, just how to manipulate it to change it to pass the data I want around, so I'm not sure how to turn off the listening for new connections without disconnecting everything.

    Right now the way it works is that the client and server are teh same cap, and a player chooses to either Host or Join (it's p2p). When one player joins, I want to stop listening for other players.

    Edit: I seem to be having another issue as well. When the server and client change layouts (since its p2p both of them do this at the same time) sometimes the connection drops. I can't tell when or how to reliably reproduce it but it seems to happen often enough and not sure what causes it. Any ideas on whta I could try?

  • Oh I see. Is that construct-specific? If so, is there a good Construct Python documentation available? I checked the wiki and there's not a whole lot there.

  • So I tried this code:

    SOL.Sprite.Value('Home')=System.globalvar("tempHome")

    and I get the message:

    SyntaxError: can't assign to function call

  • Thanks!

  • So if I create an object with events, say, Sprite, I can immediately do Sprite.Value('Var')=stuff, without doing any additional picking since the created object is picked.

    Is this the same with System.Create("Sprite") in python? If not, is there some way to pick the object?

  • Does this tutorial work under the latest construct? It seems the pythonLib event sheet is empty in all of the caps I open.

    EDIT: Ah my bad, I had another cap open and it was opening the wrong event sheet even though I was in the layout of the tutorial caps. But now I see it's there

  • Yeah I've been trying to do something similar with UID. I guess syntax like Sprite.index() won't work? And I'm curious, what exactly is in Sprite.SOL? or for that matter, what's in py.SOL and py.SOLi? I got these from a thread abbout the python picking plugin and I see how they're being used but not sure what they contain. E.g. how can you do while py.SOL as in that thread?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've tried to look through some tutorials but haven't figured this out yet so I thought I'd ask:

    1. Is there a way to get the array indices for the list of Sprite (instances of the object Sprite) in the SOL?

    2. Will those indices always be the same if I create and destroy Sprites the same way? E.g. if i run two instances of the same program and do the same stuff in them, will the Sprite indices always be the same or is there some random factor involved? (I'm pretty sure they should be but just making sure)

  • I'd like the ability to make construct render a frame whenever I choose instead of only at the end of the event stack.

    Then I can do things like this more easily:

    While Var <=5
         Grow Object
          Render Frame
          Wait X ms
          Shrink Object
          Render Frame
          Wait X ms
          Var=Var+1[/code:2enbwzx9]
    
    Right now it seems if I want to update the display I have to wait for all the events to run.  In the case where I want events to not run until the display updates in a particular way (e.g. shrinking and growing an object repeatedly as a priming effect) I'd have to turn groups off and on and use variables to check what state I'm in (grow vs. shrink state etc) and it gets more complicated with more complex display updates.  Basically, I think if this is easy to add it would be nice to be able to stay inside a sub-block of events with some sort of loop yet still be able to update the display without having to resolve the entire event stack first.
  • Got the timer to work for a single delay. I guess if I can only have one timer per object, that means I need to use variables in conjunction with the On Timer command?

    It's wierd that just getting the program to halt for a preset amount of time is nontrivial, considering all the complex things I can do by just clicking a few things.

  • So I got this to work but now have another issue that probably has to do with similar misunderstandings of how construct works as previous ones I made in the thread. First, here's how I implemented it:

    I made 2 groups, "Main Game Events" and "Animate Movement"

    "Animate Movement" Group has teh following code (+> denote subevents/conditions -> denote actions)

    EDIT: Replaced code with image

    <img src="http://dl.dropbox.com/u/30864403/Untitled.png">

    That all works great. However, I want to put a Delay action before the Units: Move 3 pixels at blah blah blah. The reason is that I want to do some sort of priming effect to grab the player's attention to the unit that is about to move (so I'd put the actions for that effect right before the Units: Move action so something like, resize unit, delay, resize unit back, delay, Units: Move, etc etc).

    When I put in a delay, even if it's 1ms, it breaks everything, and causes ALL the units move not to the grids objects corresponding to them, but to grid objects in order from 1 to whatever number of units I have, and ALL units move together. To me this suggests that my picking for both Units and Grid is somehow broken by that delay, and it's just picking the first objects created by UID, etc. Why, and how can I fix it? Thanks again

Juryiel's avatar

Juryiel

Member since 30 Sep, 2010

None one is following Juryiel yet!

Trophy Case

  • 14-Year Club
  • Email Verified

Progress

15/44
How to earn trophies