mordiaky's Forum Posts

  • Hello everyone!

    I am trying to rebuild some things into construct from game maker pro.

    I use lengthdir_x and lengthdir_y in GM for some functions in my code. How would I achieve this using construct 2?

    here is how gamemaker explains its purpose:

    Description

    This function seems confusing at first, but it's not really. It is used to get the x component of a position "len" pixels from the starting point and in direction "dir". Imagine a circle around your instance, then imagine a point anywhere on that circle. To move to that point we need to move the object so many pixels in that direction... so this function (when used with lengthdir_y) gets the position of that point on the circle to be used in code by the instance. See the image below for details:

    Source:

    Game Maker Docs

  • is there a way i can fill a array region with a value?

    so starting at 0,0 to the end lets say 100,100 I want everything to be filled with the number 10

    foreach xy element set value at (self.CurX, Self.CurY) to 10

  • if your talking about the viewport you can't in editor.you have to move the screen at load time. best way I found was a small sprite put it in the center of x,y location you want the screen and add a scroll too position, now on the onstart of layout, run the scroll to image. this will position your viewport to the center of that image.

  • Edit: a little searching does help, found the answer I was looking for in this thread.

    I have an idea how its done. I would be using arrays. what I was is something like a 1000x1000 pixel chunk. in that chunk I will spawn objects and such. I only want to load the chunk if I am near it (camera view) and remove all objects out of the chunk when I am not near it.

    for example:

    00000

    00000

    00000

    00000

    00000

    is my chunk array. from top left to right 0,0 0,1 0,2 0,3 0,4 0,5 next row 1,0 1,1 and so on.

    so what I want to do is if camera is in chunk 2,2 in the center of this array, it wall call all objects reaching out to the touching chunks.

    now like I said, I have an idea how this works and i could be way off and not even close to how a chunk works. so please tell me, am I close or is there a better method on how this works?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello all, I am currently looking into photon, but I was wondering is there a way/plugin that can join up to 6 players direct connect into one session? ofcourse this will be on local clients so trying to stay away from any sql, or cloud service at this time.

  • Bridge Officers: Version 0.0.1.1 Alpha

    Hello everyone. Here is what I have been working on with a total of 8 hours into constructing.

    The game in full design will allow up to 6 other players lan/wan to join you and fly one ship together as a crew. each crew member will have their own jobs such as Captain, Science officer, Tactical Officer, Helms Officer, Communications Officer, Etc. You will find random events in space from planet exploration to abandon ships floating in space. Every thing is procedural generated and no two games can play the same.

    There are other games like this already, I am building this to be ran in a browser with no client install needed. this way you can quickly invite friends with an IP or webaddress for fast connection and play ability.

    The state of the game at this point I am working on the Science officers console with a little Helm control for testing.

    All graphics are subject for changes, what you see now are placeholders at this time.

    the game doesn't do much at this state, you can fly around, scan each star, enter each star and check out the data as you fly around, random events will pop up on the screen in random locations at random times, but they do nothing right now.

    Capx: Bridge Officers

  • Not sure if this would be the right way, but you might need to save x, y locations of all objects, and objects UID in the array, and on game load, you would have your script to create objects based on the data in the array,

    for example:

    arrayData: 1,4,1

    Index: 1 (Object UID), (X Location), (Y Location), (Layer), etc......

    Edit: changed the If to a foreach

    so when game starts | foreach {arrayData.at(arrayData.IndexOf(object.UID), 1)} (CreateObject Object, SetPosition.X (arrayData.at(arrayData.IndexOf(object.UID), 2), SetPosition.Y (arrayData.at(arrayData.IndexOf(object.UID), 3), SetLayer (SetPosition.X (arrayData.at(arrayData.IndexOf(object.UID), 4)))

    now I am at work and do not have construct open, but this is what I see in my head right now. I could be way off as well.

  • OMG you are the best! I didn't even think of the order of creation, so simple too! I feel better now haha!

  • not sure why this is not working,

    with is blank and no checks it changes them all. when the check for the text "U" is only changes all the stars that are "U". If I select

    Pick nearest/furthest and set the exact coordinates of the star right bellow each text it works, but sometimes it will change other stars next to it, so not working perfect. do you have another idea to pick the right label with the right uid so only that object gets its text changed?

    so run the game, select the star with a U, scan it, and wait. the closer the star to the ship the faster the scan. just FYI for debuging

    here is the capx:

    https://app.box.com/bridge-command

    Its in the Main Event sheet. the code will take each text.uid and store it in an array next to the star.uid when created.

    "S"&starData.At(starData.IndexOf(Star.UID), 10) position

    the star UID is stored in a global var called starselected for each star you select. the text on the right of the screen if for debugging.

    Snumber = Charted Stars

    U = Uncharted ( percent will scale down to 1% change to spawn, set to 90% for debugging)

    Controls are:

    G = hide grid

    S = save state

    L = Load state

    mouse Scroll in or out to Zoom

    Left click to select

    if you enter coordinates in the textbox on top double click it when finished to move the ship in the angle of the direction you entered.

  • yeah I worked only on a could tutorials to get the grasp, I program in c#, powershell, and many others, for development and workflow, getting into game design and development,

    looking at my code structure on the capx i sent, does that look good and clean as a visual scripter ? first time really doing it like this LOL so its a bit strange.

  • will this allow me to move up in the layout for ever? with no boarders?

  • I will give this a try, never used the scrollto method. will need to look into this. sounds right in theory and might be what I been looking for!

    Thank you very much!

  • Well I tried many techniques and I can not get it. I am stumped!

    the goal is to make a seamless universe. my ship stays in the center of the screen at all times, when I tell my ship to move up, I want all the objects to shift down and generate new objects as they come into the screen.

    how can I achieve this goal? can I do it by family? Layer, Object, and how to I expand my layout as i travel and remove the layout that is not visible on screen? all data is stored in an array so when I revisit and area it can pull that data and re-create the objects in its location provided? any tutorials on how to make this happen or am I going to advance into this?

  • still stuck on this one, updated my capx file as well with more tools to play with,

    ship still can't move the way i want it to though, what are you r thoughts and how would you go about moving the ship?

    https://app.box.com/bridge-command

  • I would like my ship to stay in the center, I want the objects in layer 0 ( the star field and other objects) to move, giving the illusion my ship is moving.

    I am thinking I want the layer to move