### Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Messages - hankster112

Pages: 1 2
16
##### Ask a Question / Re: Raycasting Help
« on: January 17, 2021, 01:29:11 pm »
The camera for the scene in question is static; that shouldn't be affecting anything in this instance.

17
##### Ask a Question / Re: Raycasting Help
« on: January 17, 2021, 11:40:56 am »
I believe I'm formatting that equation correctly, but it still isn't doing what it's supposed to. The line still stops at random points (albeit different ones from before) and still travels through the same tiles.

18
##### Ask a Question / Re: Raycasting Help
« on: January 17, 2021, 07:00:44 am »
Tiles can be tricky to work with because the individual collision bounds of tiles are merged into larger polygons. Turn on debug draw to see where these are. There is a parameter you can use to compute the position where the collision occurs along the line segment from the origin to the end. I don't remember off the top of my head what that is. Do you have documentation for the extension?
It's not much but yes. The block I'm using is the last one he describes.
Quote
This extension provides three blocks:

1. "first actor on line" returns the first actor hit on the line (the actor nearest to x1, y1). If no actor is hit, it will return null.

2. "all actors on line" returns a list of all actors hit on the line, in order of first hit to last hit.

3. "ray cast" returns a list of raycast results, in order of first hit to last hit. Each result is its own list containing:
0. The B2Fixture hit.
1. The actor the fixture belongs to.
2. The x of the collision.
3. The y of the collision.
4. The x normal of the collision.
5. The y normal of the collision.
6. The fraction along the line at which the collision occured.

19
##### Ask a Question / Raycasting Help
« on: January 16, 2021, 09:07:46 pm »
I have been using the raycast extension provided here (http://community.stencyl.com/index.php/topic,16734.0.html) to provide coordinates for an instant-traveling projectile. It should be able to detect actors and terrain as well as their current x/y location. However, the coordinates it provides seems to be nonsensical.
It will detect regions correctly, and the debug line I have been drawing to determine where it starts/stops ends in the correct location when it first makes contact with it.
Code: [Select]
`Source/scripts/ActorEvents_14.hx:473: [[B2Fixture,[Actor 0,LoadParkourTest],10,896,10,0,0.966777408637874],[B2Fixture,[Actor 0,LoadParkourTest],10,896,10,0,0.966777408637874]]`However, colliding with tiles is a tossup. Sometimes it will travel through several tiles, come out on the other side, and then provide the coordinates it exited the tile from...
Code: [Select]
`Source/scripts/ActorEvents_14.hx:473: [[B2Fixture,[Actor 100000000,Terrain],704,639,10,0,0.366336633663366],[B2Fixture,[Actor 100000000,Terrain],0,639,10,0,1]]`...or just ignore all the tiles outright until it hits the edge of the screen, despite being adjacent to the tiles it just collided with and having no difference whatsoever in what type of tile it is.
Code: [Select]
`Source/scripts/ActorEvents_14.hx:473: [[B2Fixture,[Actor 100000000,Terrain],620,0,0,10,1],[B2Fixture,[Actor 100000000,Terrain],620,256,0,10,0.666666666666667]]`If the raycast goes offscreen, the game crashes, even though it's set to end at the edge of the screen.
None of this is making any sense to me. This extension is several years old, so is it possible that it's too deprecated to work properly with modern Stencyl?

20
##### Ask a Question / Re: Pulling data from nested lists(?)
« on: January 16, 2021, 09:00:14 pm »
Thanks, this works, although you have the item numbers reversed; it should be "get item 2/3 from item 0 in list" instead.

21
##### Ask a Question / Pulling data from nested lists(?)
« on: January 16, 2021, 07:26:55 am »
I am currently working with the raycast extension provided here (http://community.stencyl.com/index.php/topic,16734.0.html), and so far it is returning the values I need from it (the x and y coordinates of the first object it hits). However, I am unable to properly access these values from the list it creates.
Here is an example of the raycast making contact with a tile:
Code: [Select]
`Source/scripts/ActorEvents_14.hx:465: [B2Fixture,[Actor 100000000,Terrain],491.692307692308,256,0,10,0.692307692307692]`This is what it prints out when it makes contact with multiple tiles/actors:
Code: [Select]
`Source/scripts/ActorEvents_14.hx:239: [[B2Fixture,[Actor 30,Corner Detection],576.5,896,10,0,0.559587471352177],[B2Fixture,[Actor 0,LoadParkourTest],9.99999999999998,896,10,0,0.992360580595875],[B2Fixture,[Actor 0,LoadParkourTest],9.99999999999998,896,10,0,0.992360580595875],[B2Fixture,[Actor 100000000,Terrain],896,896,10,0,0.315508021390374],[B2Fixture,[Actor 100000000,Terrain],576,896,10,0,0.559969442322384]]`And here is the readme portion for the block I am using:
Quote
3. "ray cast" returns a list of raycast results, in order of first hit to last hit. Each result is its own list containing:
0. The B2Fixture hit.
1. The actor the fixture belongs to.
2. The x of the collision.
3. The y of the collision.
4. The x normal of the collision.
5. The y normal of the collision.
6. The fraction along the line at which the collision occurred.
From what I can tell, it is nesting lists inside each other. How would I pull data from a list inside an existing list instead of just pulling an entire list and having it return null/unusable values?

22
##### Ask a Question / Re: Immediately determine nearest tile in travel direction
« on: January 13, 2021, 07:10:00 pm »
Firing an actor at a fast speed doesn't get the results I need. Setting it to 500 is not instantaneous travel and causes a noticeable delay. Setting it to 999 causes it to travel faster than the game updates and only gets detected as colliding with a tile/actor either when its past it already or five tiles deep.

23
##### Ask a Question / Immediately determine nearest tile in travel direction
« on: January 01, 2021, 12:23:32 pm »
If I'm creating an actor that has instant movement from one point to another (in this context, a projectile that has instant contact from firing to wherever it's being aimed at), how would I determine which tile/actor is in its travel path? My idea was to draw a straight line from the origin of the actor until it makes contact with something, then use the coordinates from where it made contact, but I have been unable to figure out the best method for doing it, and it also seems like there would be an easier way to do so.

24
##### Ask a Question / Re: Ledegrabbing by using regions and collision boxes
« on: December 12, 2020, 08:57:33 pm »
Very in-depth and descriptive post, thanks!

25
##### Ask a Question / Ledegrabbing by using regions and collision boxes
« on: December 11, 2020, 07:08:05 pm »
I am attempting to create a ledgegrab mechanic, but I am unsure of the whole process. The way I would like to do it would be to create two 1x1 hitboxes on the player actor and individual 1x1 regions on each tile corner in the scene they can ledgegrab onto. However, actor regions and scene regions seem to be incapable of interacting with each other, unless I'm missing something obvious. There is also the usage of actor collision points, but the block guide and Stencylpedia is not very descriptive of what they are or what they do, i.e. what tile data is and how it should be used. Is there an example of what would go in tile data that could tie into a ledgegrab mechanic?

26
##### Ask a Question / Re: Game detects player touching the right wall, but not the left
« on: November 24, 2020, 07:29:10 pm »
Thanks, it's working now! I still don't exactly understand how that fixes the issue though, how does having it constantly set to false affect whether or not they're against a wall, even though the other variables that it needs are both being set correctly?

27
##### Ask a Question / Game detects player touching the right wall, but not the left
« on: November 23, 2020, 06:43:12 pm »
While trying to implement walljumping, Stencyl can detect the player touching a wall on their right and act on it, but cannot detect if they're touching a wall on their left. Both attributes LeftWalljumpEnabled and RightWalljumpEnabled are being changed and updated equally and correctly, and even though the logic for the left wall jump is exactly the same as the right wall jump, only the right wall jump registers.
• Changing the order of the left/right events does nothing.
• Changing the hitbox of the player to a single solid box does nothing.
• Removing the right wall jump check and leaving the left one in does nothing. Taking out the left one does not effect the right one's functionality.
• There are no other events that would be interfering with the left wall jump.
I'm at a complete loss, any help would be appreciated.
Also I am aware there are existing kits with walljump already implemented, but I want to do this from scratch.

Pages: 1 2