R0J0hound's Recent Forum Activity

  • I think a good way to go about it is to use the path behavior on a separate object and when the enemy doesn't have LOS of the player then move to the path.

    Here's a modification of your example:

    http://www.box.net/shared/l570zit850

  • In python no difference whatsoever, they both use the same action.

  • here's how to make it work:

    System.Create("Sprite",1,100,100)[/code:250y764g]
    Notice the quotes.
  • One way to do this would be INI files.

    I started making a quick example but got a little carried away.

    So here you go: InIdialog.cap made with 0.99.84

  • a)

    + System: Timer is Equal to 1000
    -> System: Create object Sprite on layer 1 at (400, 300)
    -> System: Create object Sprite2 on layer 1 at (Sprite.X, Sprite.Y)
    [/code:3napcu8k]
    Or if you will always be creating those two objects together, put both into a container so when one is created they will both be created.
    [code:3napcu8k]+ System: Timer is Equal to 1000
    -> System: Create object Sprite on layer 1 at (400, 300)
    -> Sprite2: Set position to object Sprite (image point 0)
    [/code:3napcu8k]
    
    b)
    [code:3napcu8k]+ Sprite: overlaps Sprite2 : offset (40,0)
    -> Sprite2: Flash for 2 seconds with 0.1 seconds interval
    [/code:3napcu8k]
    
    c)
    [code:3napcu8k]+ Sprite: Value 'color' Equal to Sprite2.Value('color')
    -> Sprite: Flash for 2 seconds with 0.1 seconds interval
    -> Sprite2: Flash for 2 seconds with 0.1 seconds interval
    [/code:3napcu8k]
    
    Hope that helps
  • That example was made with version 99.84.

    Here are the events I used

    + MouseKeyboard: Mouse is over Box
    -> Sprite: Set position to Minimap.MapToLayoutX(MouseX-Minimap.X), Minimap.MapToLayoutY(MouseY-Minimap.Y)
    
    + System: Start of layout
    -> Box: Make Invisible
    -> Box: Attach to object Minimap with 0 padding[/code:cmyymoiz]
  • The problem is that clicking on minimap doesn't work. The solution is to use a hidden object that can be clicked on, (box works well for that).

    Here's a quick example:

    http://www.filedropper.com/minimapclick

    PS: I forgot my box.net password, now where did I write it down.

  • Thanks for the cookies. As for requests, the short answer is no. But as I get more familiar with construct's code I will be able to do more, time permitting.

  • Python

    - [FIX] Script editor action names now better match the runtime (R0J0hound)

    - [FIX] Crash accessing private variables from Python (R0J0hound)

    - [CHANGE] 'global' system expression changed to 'globalvar' since 'global' is a reserved keyword in Python; allows access to global variables by name and index (R0J0hound)

    Runtime

    - [FIX] Crash drawing Sprites on non-SSE2 processors (R0J0hound)

    - [FIX] Incorrect sprite rotation when setting a corner filter (R0J0hound)

    hmm... After a few tests none of these seem to be in there. They're in the SVN, revision 151 but the changes don't seem to be in this build.

  • Well it's finally all committed to the SVN.

    Had to rework some of the fixes, but now they're working good now.

    All that's left to do now is wait... or fix more stuff.

    cheers

  • Python access to global or private variables is currently broken, but here's a few related fixes that hopefully can be put into the next release: http://www.scirra.com/forum/viewtopic.php?f=7&t=5921.

    In the mean time you can use a hybrid method like this:http://www.box.net/shared/981crp7jvh

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have several more fixes here:

    #1

    Problem: Rotation is accelerated when using corner filters on sprites.

    Example: http://www.box.net/shared/565m9reptj

    Fix: "Runtime\RenderLayer.cpp" (line 213) "angle" was not converted to radians.

    	//quad q((r - hotspot).rotate_to_quad(angle, r.topleft()));
    	quad q((r - hotspot).rotate_to_quad(cr::to_radians(angle), r.topleft()));[/code:9dbubh4w]
    
    [h2]#2[/h2]
    [b]Problem:[/b] When using python many of the actions in "System" are different in the IDE editor than at runtime.  The "action" names as listed in the IDE are defined in "IDE\Structure\SystemObject.cpp" and the "action" names used at runtime are defined in "Runtime\System.cpp"(lines 209-265).
    
    [b]Fix:[/b] I tweaked the files so that the names match.
    Here's the modified  "IDE\Structure\SystemObject.cpp" file: [url=http://www.box.net/shared/uce9q0xxj6]SystemObject.cpp[/url]
    and here is the section of code to replace "Runtime\System.cpp"(lines 209-265): [url=http://www.box.net/shared/mggln3dmon]fixSystem.cpp[/url]
    
    [h2]#3[/h2]
    [b]Problem:[/b] I didn't modify any of the expression names in "IDE\Structure\SystemObject.cpp"(line 694-788) as it looks like they are the names used it construct itself outside of python.  In "Runtime\System.cpp" (lines 436-512) the runtime uses the same expression names as the IDE but in all lowercase.  Which is fine except for "global" on line 444.  "global" is a reserved name in python.
    
    [b]Fix:[/b] change "IDE\Structure\SystemObject.cpp"(line 444) to:
    [code:9dbubh4w]	{"globalvar", &SystemObject::eGlobalValue},[/code:9dbubh4w]
    
    [h2]#4[/h2]
    [b]Problem:[/b] Accessing private variables in python don't work and cause crashes.  Global variable are accessible but only by an integer.  It seems that for private variables the parameter type is checked and only works if the type is "EXPTYPE_VARIABLENAME" otherwise it uses "-1" as an index, which explains the crashes because python will never return a "EXPTYPE_VARIABLENAME" and "-1" is out of bounds.
    
    [b]Fix:[/b] I made it so variables can be accessed via vaiablename, integer or string.
    Outline of changes: [url=http://www.box.net/shared/ruecof4lqp]variableFixes[/url]
    I added 2 functions to simplify: 
    [i]GetVariableIndexFromName[/i]: which is just an overloaded function of the same name but takes takes CRunObjType instead of CRunObject as a parameter. 
    [i]getGlobalVarIndex[/i]: to group the type checking for global variables in one place.
    
    PS:
    I hope this is easy enough to follow, but if it isn't let me know.  Also is there a better or preferred method to submit fixes to construct's source code.
R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound