Phobos002's Recent Forum Activity

  • hi there !very coolman

    did you make this work with an array ? can you explain to me how ?

    im triyng to make a weapon database like you that i can just select the weapons from, but i cant see how

    I have the array setup as a 10x4, but I'll only go over the first 2 y values as they're the more importaint for weapon selection:

    Cx1 = Weapon Name (Helps control actions when firing, like what bullets to use and how many, how much ammo to reduce, etc.)

    Cx2 = Weapon Ammo (How much ammo is left in inventory. You can use global variables if you want to have a common type of ammo to be used by different guns, however.)

    The 'C' stands for your current weapon, which you can increase or decrease by using the mouse-wheel. Doing this picks a different weapon in the array, first making sure the weapon you picked isn't "0" and ammo is greater than 0 (Otherwise skip to the next weapon and check that) and presto!

    If you need more help let me know, I'll do my best to explain it further. ;)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A Motion Blur effect would be tons of fun to use!

    I found a WebGL/Javascript demo made by 'shurcooL' and copied the shader info from the HTML source:

    <font size="1">#ifdef GL_ES
         precision highp float;
         #endif
    
         uniform vec3 tri0v0;
         uniform vec3 tri0v1;
         uniform vec3 tri0v2;
         uniform vec3 tri1v0;
         uniform vec3 tri1v1;
         uniform vec3 tri1v2;
    
         varying vec4 verpos;
    
         struct Line3
         {
              vec3 Origin;
              vec3 Direction;
         };
    
         struct Triangle3
         {
              vec3 V[3];
         };
    
         bool IntrLine3Triangle3_Find(Line3 line, Triangle3 triangle, out float TriBary[3])
         {
              // Compute the offset origin, edges, and normal.
              vec3 diff = line.Origin - triangle.V[0];
              vec3 edge1 = triangle.V[1] - triangle.V[0];
              vec3 edge2 = triangle.V[2] - triangle.V[0];
              vec3 normal = cross(edge1, edge2);
    
              // Solve Q + t*D = b1*E1 + b2*E2 (Q = diff, D = line direction,
              // E1 = edge1, E2 = edge2, N = Cross(E1,E2)) by
              //   |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))
              //   |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))
              //   |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)
              float DdN = dot(line.Direction, normal);
              float sign;
              if (DdN > 0.0)     ///Math<float>::ZERO_TOLERANCE
              {
                   sign = 1.0;
              }
              else if (DdN < -0.0)     ///Math<float>::ZERO_TOLERANCE
              {
                   sign = -1.0;
                   DdN = -DdN;
              }
              else
              {
                   // Line and triangle are parallel, call it a "no intersection"
                   // even if the line does intersect.
                   ///mIntersectionType = IT_EMPTY;
                   return false;
              }
    
              float DdQxE2 = sign * dot(line.Direction, cross(diff, edge2));
              if (DdQxE2 >= 0.0)
              {
                   float DdE1xQ = sign * dot(line.Direction, cross(edge1, diff));
                   if (DdE1xQ >= 0.0)
                   {
                        if (DdQxE2 + DdE1xQ <= DdN + 0.03)     // Low precision fix hack
                        {
                             // Line intersects triangle.
                             ///float QdN = -sign * dot(diff, normal);
                             float inv = 1.0 / DdN;
                             ///lineParameter = QdN * inv;
                             TriBary[1] = DdQxE2*inv;
                             TriBary[2] = DdE1xQ*inv;
                             TriBary[0] = 1.0 - TriBary[1] - TriBary[2];
                             ///mIntersectionType = IT_POINT;
                             return true;
                        }
                        // else: b1+b2 > 1, no intersection
                   }
                   // else: b2 < 0, no intersection
              }
              // else: b1 < 0, no intersection
    
              return false;
         }
    
         bool IntrLine3Triangle3_Find(Line3 line, Triangle3 triangle, float tmax, vec3 velocity0, vec3 velocity1, out float ContactTime)
         {
              float TriBary[3];
    
              if (IntrLine3Triangle3_Find(line, triangle, TriBary))
              {
                   ContactTime = 0.0;
                   return true;
              }
              else
              {
                   // Velocity relative to line
                   vec3 relVelocity = (velocity1 - velocity0) * tmax;
    
                   Triangle3 triangle1;
                   triangle1.V[0] = triangle.V[0] + relVelocity;
                   triangle1.V[1] = triangle.V[1] + relVelocity;
                   triangle1.V[2] = triangle.V[2] + relVelocity;
    
                   float ClosestContactTime = 2.0;
                   {
                        float TriBary[3];
    
                        {
                             Triangle3 tri;
                             tri.V[0] = triangle.V[0];
                             tri.V[1] = triangle1.V[0];
                             tri.V[2] = triangle1.V[1];
    
                             if (IntrLine3Triangle3_Find(line, tri, TriBary)) {
                                  ClosestContactTime = min(ClosestContactTime, TriBary[1] + TriBary[2]);
                             }
                        }
    
                        {
                             Triangle3 tri;
                             tri.V[0] = triangle.V[0];
                             tri.V[1] = triangle.V[1];
                             tri.V[2] = triangle1.V[1];
    
                             if (IntrLine3Triangle3_Find(line, tri, TriBary)) {
                                  ClosestContactTime = min(ClosestContactTime, TriBary[2]);
                             }
                        }
    
                        {
                             Triangle3 tri;
                             tri.V[0] = triangle.V[1];
                             tri.V[1] = triangle1.V[1];
                             tri.V[2] = triangle1.V[2];
    
                             if (IntrLine3Triangle3_Find(line, tri, TriBary)) {
                                  ClosestContactTime = min(ClosestContactTime, TriBary[1] + TriBary[2]);
                             }
                        }
    
                        {
                             Triangle3 tri;
                             tri.V[0] = triangle.V[1];
                             tri.V[1] = triangle.V[2];
                             tri.V[2] = triangle1.V[2];
    
                             if (IntrLine3Triangle3_Find(line, tri, TriBary)) {
                                  ClosestContactTime = min(ClosestContactTime, TriBary[2]);
                             }
                        }
    
                        {
                             Triangle3 tri;
                             tri.V[0] = triangle.V[2];
                             tri.V[1] = triangle1.V[2];
                             tri.V[2] = triangle1.V[0];
    
                             if (IntrLine3Triangle3_Find(line, tri, TriBary)) {
                                  ClosestContactTime = min(ClosestContactTime, TriBary[1] + TriBary[2]);
                             }
                        }
    
                        {
                             Triangle3 tri;
                             tri.V[0] = triangle.V[2];
                             tri.V[1] = triangle.V[0];
                             tri.V[2] = triangle1.V[0];
    
                             if (IntrLine3Triangle3_Find(line, tri, TriBary)) {
                                  ClosestContactTime = min(ClosestContactTime, TriBary[2]);
                             }
                        }
                   }
    
                   if (2.0 != ClosestContactTime)
                   {
                        ContactTime = tmax * ClosestContactTime;
                        return true;
                   }
                   else
                   {
                        return false;
                   }
              }
         }
    
         void main()
         {
              // Shade all the fragments behind the z-buffer
              /*gl_FragColor = vec4(sin(verpos.x*50.0), sin(verpos.y*50.0), 1.0 + 0.0*sin(verpos.z*5.0), 1);
              return;*/
    
              /*Line3 line; line.Origin = vec3(verpos.x, verpos.y, -1); line.Direction = vec3(0, 0, 1);
              Triangle3 triangle; triangle.V[0] = tri0v0; triangle.V[1] = tri0v1; triangle.V[2] = tri0v2;
              float triBary[3];
              if (IntrLine3Triangle3_Find(line, triangle, triBary))
              {
                   gl_FragColor = vec4(triBary[0], triBary[1], triBary[2], 1);
              }
              else discard;
              return;*/
    
              Line3 line; line.Origin = vec3(verpos.x, verpos.y, -1); line.Direction = vec3(0, 0, 1);
              Triangle3 triangle0; triangle0.V[0] = tri0v0; triangle0.V[1] = tri0v1; triangle0.V[2] = tri0v2;
              Triangle3 triangle1; triangle1.V[0] = tri1v0; triangle1.V[1] = tri1v1; triangle1.V[2] = tri1v2;
              float ContactTime;
    
              /*gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
              if (IntrLine3Triangle3_Find(line, triangle0, 1.0, vec3(0.0), vec3(triangle1.V[0] - triangle0.V[0]), ContactTime))
              {
                   //gl_FragColor = vec4(1.0 - ContactTime, 1.0 - ContactTime, 1.0 - ContactTime, 1.0);
                   gl_FragColor.g = 1.0;
              }
              else gl_FragColor.r = 1.0;
              return;*/
    
              bool col = IntrLine3Triangle3_Find(line, triangle0, 1.0, vec3(0.0), vec3(triangle1.V[0] - triangle0.V[0]), ContactTime);
    
              if (col)
              {
                   float t0 = ContactTime;
    
                   if (IntrLine3Triangle3_Find(line, triangle1, 1.0, vec3(0.0), vec3(triangle0.V[0] - triangle1.V[0]), ContactTime))
                   {
                        float t1 = ContactTime;
    
                        //gl_FragColor = vec4(1.0 - t0 - t1, 1.0 - t0 - t1, 1.0 - t0 - t1, 1.0);
                        gl_FragColor = vec4(0.8, 0.3, 0.01, 1.0 - t0 - t1);
                   }
                   else
                        //gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
                        discard;
              }
              else
                   //gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
                   discard;
         }
    
         /*void main(void) {
              gl_FragColor = vec4(0.8, 0.3, 0.01, 1.0);
         }*/</font>

    Not sure if that is the motion blur effect, but it was the longest one, so I assumed it was. I tried to use this on its own, but I get an error message: "Assertion failure: Error linking shader program: Fragment varying _verpos does not match any vertex varying" I'm not a GLSL expert or novice even, so I have no idea what it's talking about.

    Thoughts? (Oh, and if we do get this working, we should ask him if we can use it, right?)

  • Oh christ, I just realized my horrendous mistake. This works, but I had a an issue with setting variables in the pData array at the start of the layout, so I didn't have any weapons to cycle through. Oops!

  • Hello! My problem is that I am trying to allow the player to select different weapons via the mouse-wheel. While loops are dangerous bastards, because if you do it wrong, your game will lock-up in an endless loop. That is what happens when I try doing this:

    <img src="https://dl.dropboxusercontent.com/u/21499454/screenshots/support/howto_selectweapons.png" border="0" />

    cWeapon = Current Weapon

    I had this working at some point, but it has stopped now. Is there a better way to do this? Or if not, how can I get this to work?

    Thanks in advance! ;)

    Here is the capx: -SNIP-

    EDIT: I forgot to mention that the loop has condition checking, so it skips over weapons you don't have yet. It works after I get a shotgun, but then I cant get the pistol back. Again, a better way to do this would be appreciated!

  • Awesome! I assume you're exporting via node-webkit? Do you need to implement some sort of DRM through IndieVania?

    What? I'm not using Construct 2 to make it. I'm using Construct Classic. :)

    And no, you do not need any DRM!

  • I'll check out the tutorial, but I did add a link. It's just that whenever I try to hyperlink anything, it always takes me back to the forum post. It's really annoying, although I'm not sure if you fixed it yet or not.

    Here is a hyperlink to Vanity on IndieVania

    EDIT: AHA! THE CURSE IS LIFTED!! I AM FREEEEE

  • Vanity on IndieVania

    This game is the project I have been working on for a few months, and I finally got it to a state where I can sell it in IndieVania! Although I still wish to expand on it, hence the beta status.

    I published it on April 1st, but I haven't gotten a single sale. I wanted to ask someone like NerdCubed to try it out, to promote the game and get feedback from him as well on what to add or fix. But I'm not sure if he would listen to me or how to get a proper contact with him (Besides the business email that I haven't gotten a reply to) Not sure how I'm going to handle that in a manner that doesn't make me look like a massive tool. ;)

    What should I do now?

  • A very important bump, because the game is now purchasable on IndieVania!

    indievania.com/games/vanity

    I don't know how I can promote the games existence very well. I was gonna ask NerdCubed to try it out, but I am unable to get a hold of him by any easier means.

    I also want to use IndieVania to get funds for Steam Greenlight, and get reviews on what I should improve on in the game in order to make it worthy for steam.

    Thoughts?

  • Oh uh, I have the latest version on IndieDB: indiedb.com/games/vanity

    It's probably fixed, but also some of the buttons aren't finished yet. They are in R14, but I wanna talk to Desura about publishing and stuff first.

  • I second this motion. I'm confused with using AJAX, so an example would be nice.

    ...Unless an API is already being made, then I will just wait for that ;)

  • Yeah, the game plays much better when you download it.

    Heres a link from the gamejolt page: gamejolt.com/games/rfe/download-distribution/11696

    Also, why is hyperlinking broken? Whenever I click a hyperlink on the site, it practically just refreshes the page. It's weird!

  • This is my entry to the GameJolt 'Chaos' Contest, where you must make a game themed around Chaos.

    I think this is chaotic enough. ;)

    gamejolt.com/games/arcade/rfe/12969

    The music was made by a friend named 'Pitfall', who makes some really good techno/chiprock music!

    Let me know how it is! ;)

Phobos002's avatar

Phobos002

Member since 7 Jun, 2010

None one is following Phobos002 yet!

Trophy Case

  • 14-Year Club
  • Email Verified

Progress

15/44
How to earn trophies