[Plugin] jcw_trace (raycast)

  • Just tried using infiniti for an end point on a line trace.

    It didn't go so good.

  • made a wolfenstein 3d engine with this (:

  • made a wolfenstein 3d engine with this (:

    That looks pretty awesome Follder22! It would be cool to see in motion.

  • Will you try to add support for multiple arrays? I know you can do it by create multiple Trace objects. But I am trying to create hit-scan weapons, and with guns like a shotgun, to is very inconvenient to create up to 10 different Trace objects.

  • Will you try to add support for multiple arrays? I know you can do it by create multiple Trace objects. But I am trying to create hit-scan weapons, and with guns like a shotgun, to is very inconvenient to create up to 10 different Trace objects.

    How so? It sounds to me like you just need 1 trace object and a for loop. Or is there a reason you need to keep information about a trace after you apply damage and effects?

  • How so? It sounds to me like you just need 1 trace object and a for loop. Or is there a reason you need to keep information about a trace after you apply damage and effects?

    While I could create one weapon with a loop, I plan on having multiple enemy's, all also using hit-scan weapons. I believe this could not be done with a loop.

  • >

    > How so? It sounds to me like you just need 1 trace object and a for loop. Or is there a reason you need to keep information about a trace after you apply damage and effects?

    >

    While I could create one weapon with a loop, I plan on having multiple enemy's, all also using hit-scan weapons. I believe this could not be done with a loop.

    I think it could be done easily with a loop. Easily enough that I decided to throw together a little test:

    https://dl.dropboxusercontent.com/u/207 ... _test.capx

    Since I used the turret behavior's shoot trigger, I didn't even need the loop! So, just for kicks, I made 4 of the turrets have a 'shotgun' weapon (which required a loop).

  • A trace behavior sounds like a good idea.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Johncw87 Is it possible to pick a single instance to trace? I have two tilemap duplicates, one created at runtime, for handling solids differently to the background tiles, and the minute that is created, the tracer sees all the tiles as obstacles. Can I just have the tracer use the instance with the solid tiles removed?

  • Johncw87 Is it possible to pick a single instance to trace? I have two tilemap duplicates, one created at runtime, for handling solids differently to the background tiles, and the minute that is created, the tracer sees all the tiles as obstacles. Can I just have the tracer use the instance with the solid tiles removed?

    If you are using the plugin in 'Solid' mode, it will ignore any instances where the 'Solid' behavior is disabled. But why are you using the same tiles in the foreground and in the background? Don't you think that would get confusing?

  • > Johncw87 Is it possible to pick a single instance to trace? I have two tilemap duplicates, one created at runtime, for handling solids differently to the background tiles, and the minute that is created, the tracer sees all the tiles as obstacles. Can I just have the tracer use the instance with the solid tiles removed?

    >

    If you are using the plugin in 'Solid' mode, it will ignore any instances where the 'Solid' behavior is disabled. But why are you using the same tiles in the foreground and in the background? Don't you think that would get confusing?

    It's for tiles that are non solid and tiles that are solid, can't have both on he same tilemap so I had to duplicate. Actually, ray cast doesn't ignore a seperate instance of the same object that has different solid settings, I tried for hours over the weekend, picking instances of the tilemap, delaying functions to debug the problem and if I have a second tilemap instance of the same object, this time with the solids disabled, it instantly adds all of the new tiles to the tracer.

  • *quote snip*

    It's for tiles that are non solid and tiles that are solid, can't have both on he same tilemap so I had to duplicate. Actually, ray cast doesn't ignore a seperate instance of the same object that has different solid settings, I tried for hours over the weekend, picking instances of the tilemap, delaying functions to debug the problem and if I have a second tilemap instance of the same object, this time with the solids disabled, it instantly adds all of the new tiles to the tracer.

    I just tested it, and it works fine.

    https://dl.dropboxusercontent.com/u/207 ... lemap.capx

    This is the same test project shown in the OP, but with a second instance of the tilemap. This second instance has 4 tiles, none of which affect the reflecting laser due to its 'Solid' behavior being disabled.

  • >

    > *quote snip*

    >

    > It's for tiles that are non solid and tiles that are solid, can't have both on he same tilemap so I had to duplicate. Actually, ray cast doesn't ignore a seperate instance of the same object that has different solid settings, I tried for hours over the weekend, picking instances of the tilemap, delaying functions to debug the problem and if I have a second tilemap instance of the same object, this time with the solids disabled, it instantly adds all of the new tiles to the tracer.

    >

    I just tested it, and it works fine.

    https://dl.dropboxusercontent.com/u/207 ... lemap.capx

    This is the same test project shown in the OP, but with a second instance of the tilemap. This second instance has 4 tiles, none of which affect the reflecting laser due to its 'Solid' behavior being disabled.

    Here's an example, sorry I used 5 traces, it's just for a experiment, but as you can see, the second instance with the solids disabled still affects the trace: https://www.dropbox.com/s/0p6rkii91i8e4 ... .capx?dl=0

  • *quote snip*

    Here's an example, sorry I used 5 traces, it's just for a experiment, but as you can see, the second instance with the solids disabled still affects the trace: https://www.dropbox.com/s/0p6rkii91i8e4 ... .capx?dl=0

    Well, I would like to look at your project, but you've got these other plugins in it.

    [quote:1wm6j8r0]

    MagiCam

    Simulate key event

    Platform Plus

    While I doubt another plugin is causing a problem, it's still a good idea to keep other 3rd party plugins out of a .capx when you are reporting a bug. But most importantly, I'm lazy and don't want to hunt down and install these plugins <img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing">

  • >

    > *quote snip*

    >

    > Here's an example, sorry I used 5 traces, it's just for a experiment, but as you can see, the second instance with the solids disabled still affects the trace: https://www.dropbox.com/s/0p6rkii91i8e4 ... .capx?dl=0

    >

    Well, I would like to look at your project, but you've got these other plugins in it.

    [quote:18dg7400]

    MagiCam

    Simulate key event

    Platform Plus

    While I doubt another plugin is causing a problem, it's still a good idea to keep other 3rd party plugins out of a .capx when you are reporting a bug. But most importantly, I'm lazy and don't want to hunt down and install these plugins <img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing">

    Sorry, forgot about those! Here's a cleaned version: https://www.dropbox.com/s/62rf3cy1y7ukn ... .capx?dl=0

    As you see with the delayed function, the added instance causes the tracer to find the obstacles.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)