tulamide's Recent Forum Activity

  • How we can improve this expression ?

    clamp(angle(gun.x, gun.y, mousex, mousey), corps.Angle-30, corps.Angle+30)[/code:28xqihdm]
    
    

    Avoiding any own math like modulo etc, you have to split it to two subevents and use the 'AngleDiff' expression and the 'Angle is clockwise of' condition.

    + System: Always (every tick)
    -> gun: Set position to object corps (image point 0)
    ++ System: Angle angle(gun.x, gun.y, mousex, mousey) is Clockwise from corps.Angle
    -> gun: Set angle to clamp(AngleDiff(angle(gun.x, gun.y, mousex, mousey) , corps.Angle), 0, 30) + corps.Angle
    ++ System: Else
    -> gun: Set angle to clamp(AngleDiff(angle(gun.x, gun.y, mousex, mousey) , corps.Angle) * -1, -30, 0) + corps.Angle[/code:28xqihdm]
    
    Download:
    [url=http://www.mediafire.com/file/9zt9y0v1d44vyg4/rotation%20is%20limited2.cap]rotation is limited2.cap[/url]
  • I dont feel comfortable to post the cap. I've been working on this game for a few months now and would not want someone coming along and steal my work.

    That's absolutely ok and understandable. But most then create a new example cap that shows the error. Helps a lot when several aspects come together that you are not aware of when trying to help.

    I have found the Event that's causing the problem When an enemy=<0 a set of events is run to check if the enemy drops an item then destroys the enemy.

    The event basically calls a random value then checks what item it should drop.

    I haven't implemented this fully in the game (I also would like to reedit this event) so the only true option right now is the else at the end that just destroys the enemy. This is whats causing all the enemies to destroy themselves.

    I'm going to rework the event group to fix it. Although this does not explain the abnormality(else destroying all objects).

    This for example: I don't see the exact event. Basically, using 'else' can explain it.

    When it comes to the action destroy, 'else' seems to not pick anything (not picking the opposite as one would expect). And if nothing is picked, Construct always refers to all instances.

    Enemy's health <= 0 and Already dropped = 0 -> do something
    else -> destroy[/code:242yuwix]
    Such a construct does not pick anything on the 'else' part and therefore destroy any enemy
    
    [code:242yuwix]Enemy's health <= 0
         Already dropped = 0 -> do something
         else and Pick by enemy('health') <= 0 -> destroy[/code:242yuwix]
    Such a construct would first make sure that any enemy with health <= 0 will drop and then destroy any enemy with health <= 0
    
    But as I said, I don't see the exact events, so I don't know why 'else' is used. It isn't needed to let them drop and destroy them. This can be done in one step.
  • If this thread is just about other game creation software, there are tons of finest products out there. Here are a few:

    Esenthel

    Professional engine that easily compares to Unreal Engine 3 or Cry Engine 3 and beats Unity in nearly every aspect.

      Licenses: Free, Personal(150$), Company(750$) and Professional(4000$+11000$) Scripting: C++, EsenthelScript, visual scripting soon to come IDE Platforms: Windows Game Platforms: Windows, Mac, iPhone, iPad, iPod Touch Homepage: http://www.esenthel.com/

    Panda 3D

    Professional engine originally developed by Disney, now now developed jointly by Disney and Carnegie Mellon University's Entertainment Technology Center.

      Licenses: Free (Modified BSD License) Scripting: C++, Python IDE Platforms: Windows, Mac, Linux(Debian, Ubuntu, Fedora) Game Platforms: Windows, Mac, Linux, Web (any browser via web runtime) Homepage: http://www.panda3d.org/

    NeoAxis Game Engine

    Professional engine with focus on Windows.

      Licenses: Free, Indie (95$), Commercial (395$), Source (9800$) Scripting: .NET (scripting on any .NET language), Mono Runtime IDE Platforms: Windows Game Platforms: Windows, Web (any browser via web player) Homepage: http://www.neoaxisgroup.com/

    Delta3D

    Open source game engine with dependencies to other open source tools.

      Licenses: Free (LGPL) Scripting: C++, Python, Qt IDE Platforms: Windows, Linux Game Platforms: Windows, Linux Homepage: http://www.delta3d.org/

    Crystal Space 3D

    Open source game engine.

      Licenses: Free (LGPL) Scripting: C++, Python, Perl, Java, CEL IDE Platforms: Windows, Linux Game Platforms: Windows, Linux, Mac Homepage: http://www.crystalspace3d.org/

    AGen

    A hardware accelerated 2D game engine.

      Licenses: Free (for non-commercial), Commercial (200$, one time fee) Scripting: LUA IDE Platforms: Windows, (Mac version announced) Game Platforms: Windows, (Mac version announced) Homepage: http://www.2dengine.com/
  • Never used it before but after trying now, I see that you're right. It isn't working (as well as 'Bring to top')

  • Depending on what you try to achieve, you may also want to play around with Color Fusion (Masked)

  • basically i just want to add force where ever the sprite is pointing at.

    So you just don't know how to calculate the x/y-components from an angle?

    That's what the trigonometric functions 'sin' and 'cos' are for. cos(45) returns the x-coordinate of 45? on the unit circle (value between -1 and +1), sin(45) returns the y-coordinate of 45?. Just multiply this with the strength you need.

    + MouseKeyboard: On key Up arrow pressed
    -> Sprite: Add force (cos(45) * 100, sin(45) * 100)
    [/code:7ph4ap5x]
    
    You get the angle of your object using the expression 'Get Angle' (Sprite.Angle)
    [code:7ph4ap5x]+ MouseKeyboard: On key Up arrow pressed
    -> Sprite: Add force (cos(Sprite.Angle) * 100, sin(Sprite.Angle) * 100)
    [/code:7ph4ap5x]
  • I don't know what happens (seems like python isn't aware of instances of the text object), but while looking at your cap I thought I should say this:

    It seems you want to test for the absence of the file when the game starts. There is a system condition for events that need to be executed only once at start. You just create subevents to this one, and all those will only be executed once, when the layout starts:

    + System: Start of layout

    ++ File: [negated] File "gmdat" exists

    -> call the function

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • All event sheets are executed per tick in a loop, yes. (And the python scripts also)

    This thread might help you further understanding the workflow: http://www.scirra.com/forum/viewtopic.php?f=8&t=6880&p=53876#p53876

    EDIT: Ah, and before newt hops in, I have to tell you, that in case you will never again need the textbox again but really only once, you may also use the system condition 'trigger once' instead of the variable. The advantage of the variable use is that you can set that variable to 0 again at any time to let the text create again.

  • I'm extremely confused and bewildered and on and off with Construct, so once again I have a question. Is there a way to have a function run once? I honestly assumed that they did run once (since they are functions). I may be missing something, I do not know.

    Basically, I have been trying to make a message box that would appear once and be called anytime. Basically I have an event sheet that holds the functions for the game.

    On page 1 (The layout that sets stuff up), I have this

    > File "gmdat" does not exist:
    My function: Add parameters (The parameters for the message box)
    Call function: myfunction (Forget picked objects)
    [/code:3p8a5rqj]
    
    On my page that contains the functions, one being for the message box,
    [code:3p8a5rqj]
    System: Create the Infobox object at params (3), (4) (x and y)
    System: Create a second instance of "Text" at Infobox's pivot point (Now there are only two instances of text, or there should be).
    Text: Set height to param(5)
    Text: Set width to param(6) - 30
    Text: Set text to param(7)
    [/code:3p8a5rqj]
    
    In theory, I should be able to then do this in Python:
    [code:3p8a5rqj]
    Text[1].Text = "This is a test."
    [/code:3p8a5rqj]
    ...since only one additional instance is made (I was forced to do it by the editor just to have it a global object that I can pull up anytime). The python script is in a sub event.
    
    Now here is where the problem comes in. When I put line of script in, anything above Text[0].Text did not work and gave me an error. I looked at the debugger and also saw that the game was creating an infinite amount of instances of "Infobox" and "Text".
    
    So I must ask, is there any way to have a function to run once (or is that impossible)? Also, why is the Python not grabbing other instances beyond the first?
    

    A function is executed when you call it. If you call it once, it will be executed once. Events are checked on every tick. If its condition is true, the event will be executed.

    If 'File "gmdat" does not exist:' means that you check for the absence of a file then this condition will be true on every tick unless a file "gmdat" is created.

    Tick 1: Does the file exist? No. Call function

    Tick 2: Does the file exist? Still no. Call function again

    etc.

    To prevent calling the function more than once, create a global or private variable and use it as a switch. Set it to 0 when creating, then in your 'File "gmdat" does not exist:' add the condition my variable = 0

    and add the action 'add 1 to my variable'

    Now the event will only become true the first time it is checked and the function will only be called once.

  • With C2, we're aiming to build the best game creator in the world.

    If this goal is reached I'm a customer

  • Chris,

    Is there any way you could make this app go both ways? For example, making it possible to turn animations into spritesheets that are compatible with xna? Gamemaker 8 exports spritesheets, but I'm not sure about its compatibility with C# and xna. I've just started using xna and this would be so helpful, and I know a lot of xna users that are REALLY wanting this.

    I'm not working with XNA, but isn't there already some tools?

    For example, Sprite Sheet Packer comes with an XNA exporter "which exports an XML file in XNA Content format" (quote from the description of the tool)

  • I'm having issues when running photoshop parallel. Never had distorted sprites though, but crashes that don't occur if I start the computer and use Construct without running photoshop. It wasn't enough to just exit photoshop, it needed to be not started at all.

    I mention it because there's photoshop running in your screenshot, but probably this is not related to your problem.

tulamide's avatar

tulamide

Member since 11 Sep, 2009

Twitter
tulamide has 3 followers

Trophy Case

  • 15-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

17/44
How to earn trophies