grossd's Recent Forum Activity

  • Hello,

    I am writing some code that receives a websocket message from an outside source that is then parsed by a JSON object.

    Once parsed additional processing is handed off to other functions, which are called and refer to the same JSON object.

    I started to wonder if this is all reentrant -- i.e. when during the processing of one websocket message another one arrives, whether the second set of calls are done via an new JSCON instance, or whether the same is reused / overwritten.

    Tagged:

  • I now noticed Redis and a node.js redis client. Perhaps, a more robust connection to peers is via such an infrastructure.

    Can Redis be used in construct3 via node.js?

    I guess, one would need to import node.js and then install into it the redis client -- can this be done in construct 3.

    And, then i guess I would write some interface functions to use within the game code.

  • Hello,

    I have been connecting a game with a peer system using websockets. However, I now noticed that websockets is purely asynchronous, and at times the peer system needs to request data from the game -- and best if its synchronous request, so that the peer obtains the requested data immediately.

    WebSockets doesn't support that -- i would need to code a synchronous "fetch" via coordinated asynchronous calls.

    However, I then thought that a construct 3 game could in fact run a web server as well, and then a web request could be submitted?

    Can this be done?

    Is there another way to do this?

  • I guess that's how it works -- you always have to do the picking as part of the event condition -- you can't pick as part of the action.

    This means that either event conditions must be parameterized -- somehow -- or event conditions must be duplicated to account for all instance identification cases.

    The latter isn't good because it fixes the number of instances assumed existing.

  • Thanks for asking.

    Instances have instance variables defined. One variable is name, which is a string holding a given, unique name on an instance.

    All instances have a unique name predefined.

  • Hello,

    After a long while I am restarting C3 coding again.

    I have an object (say a car) with a moveto behavior, and want an instance of the car to move to an instance of another object.

    The car is named, and the first car instance is selected by having in the event a condition that picks the car instance by name.

    This worked, and I managed to get the first car instance selected after an event, based on the instance's name, but i don't know how to use the MoveTo command to let car move to a first target object instance.

    it seems the only way to do so, is to add another condition to the event that picks the first location by name, which is then "handed" to the moveto ...

    For convenience I don't clone object types but have many named instances in the layout of both cars and named locations they can drive to.

    Is there a way to decouple the selection of the target object instance from the event condition -- so,once an event is received (e.g. start game), then via some lookup a first target instance name is retrieved which is then used to pick the target instance to move to?

    Your help is very much appreciated,

    thank you,

    Dan

  • Looks like physics and bullet have overlapping functionality -- i like gravity that it enables creating an impact force ... which bullet doesn't have ...

    But, only bullet has on step ...

    oh well ...

  • Thanks!

    I will check out the stepping.

    I didn't want to "fall back" onto drawing lines because it would take away from the smoothness of the curve and hence its "real" nature

  • Hello,

    I am shooting a bullet up at -45 angel and let it fly with gravity and am plotting a parabola of its trajectory on a canvas.

    at every tick i am creating 1 pixel line at the location of the bullet -- and it indeed traces the flight path -- however, i notice that the trace is discontinuous -- many disconnected dots in particular as the bullet accelerates further ...

    Is there a way to actually create a smooth path -- looks like the redraw algorithm is more detailed than each tick.

    thanks,

    Dan

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thank you.

    Yes, i started to suspect that dropbox is the culpit after installing remote image plugin and noticed it works fine unless i put in the dropbox url.

    What is odd is that dropbox allows sharing the link and everyone with the link can view it -- so it views in my browser but doesnt in the opened runtime browser of C3.

    too bad dropbox is more convenient than say google drive or one drive.

  • thanks.

    I now tried two approaches and neither worked:

    1. use the load image method for sprite, to load a URL of the image in the dropbox.

    2. use nw.js to load binary data from a URL -- such a method exists, and its loaded into a binary data object --

    and then, upon read event completed load the sprite with a URL of the binary data generated by the binary data object's method get URL ...

    Also, this didn't work.

    The sprite remains unchanged, upon loading the layout ...

    Not sure what the problem is ... the URL works in the browser to retrieve the image from the dropbox.

    I am missing something ...

    Dan

  • Thanks.

    My apologies, I wasn't clear.

    I want to load the image into a sprite and i don't want to save it for loading again.

    Instead, when i (somehow) sense that the image was replaced in the folder with a new image, then i want to load the new image into the sprite.

    And, as mentioned, the simplest case i am looking at right now is that there always only exists one image in the folder which is displayed on screen.

grossd's avatar

grossd

Member since 4 Feb, 2014

Twitter
grossd has 1 followers

Trophy Case

  • 10-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies