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 - Red Frostraven

Pages: 1 2
1
Flash?

2
Ask a Question / Creating region types?
« on: April 17, 2013, 05:01:55 pm »
Is there a nifty way to have 5 regions do the exact same thing??

I have a light setting behavior that I want to apply to 5 different zones at the same time, but...

Edit:
I guess I can have a "caller" behavior that calls the behavior when the player or actor enters the zone, but that still means setting each region manually in the behavior...
and a separate behavior for each act...

OR have entering a region trigger for each region of the same type -- but that requires pre-made behaviors with little room for custom variables.

3
Ask a Question / Re: Double Jumping after a Wall Jump
« on: April 14, 2013, 04:38:53 pm »
... bad suggestion on my part when I think about it.

4
Yeah. The most important part is the description.

I caught MYSELF getting confused by the block names :D
Adding a description should do it.

5
Ask a Question / Re: Darkness effect on actors?
« on: April 14, 2013, 03:53:02 am »
Use brightness.

Actor --> Effects --> Apply Effect to actor + brightness.

You can activate the light/darkness when entering regions, and even have a function that sets the tint/brightness amount based on distance to a specific location or object or even the closest instance of a group of objects.

Use RemoveAllEffects to manage stable brightness levels:
Every time you move closer to the lightsource, RemoveAllEffects from player then apply a brightness value that is higher.

Here's a concrete behavior that alters the brightness every 0.1 seconds for as long as the actor is close to a lightsource:

[Work in progress -- I have to make dinner for my wife and three sons and kill a foul beast hiding under inside our walls before I may return. I wish I was kidding on this latter part.

6
I could not be bothered to use the ingame grid, because I'm making a game with 1024x576 screen size that needed a grid that could not be fit to the scene with the current resolution and using a static grid size, without going for 4 pixel grid sizes.
So I made a custom grid reference behavior that utilizes custom blocks and global lists (of it's user's choice) to create custom grids within scenes.
Tiles start at 0,0 -- so 10x10 tiles start at 0,0 and end at 9,9.


Base settings:
-Set tile height and width
-Set grid offset/start (I did not want my grid to start at 0,0, so I made the ability offset the start of the grid to anywhere as a X,Y position.
-Set grid's width and height in tiles

Note that these values can be changed at any time, altering the functionality of the grid on the fly,  resizing tiles, expanding the number of tiles or moving the grid in any direction.
I used three separate global blocks, where all three are required to be set for the grid to work.

Grid offset X,Y and grid width and height can all be set to 0 to create a grid that starts at 0,0 and continues infitely.

Grid offset X,Y can be set to 160, 100 -- for instance -- in order to make a grid that has it's 0,0 tile position starting at X160,Y100
Grid tile width and height can be set to 5,5 to create a grid that is only 5 tiles wide and 5 tiles heigh.

You can create as many custom grids as you want within one scene for as long as you can keep track of your global lists the functions refer to.


Basic functionality:
-Translate X position within grid to the corresponding tile Row (returns -1 if the position isn't on grid)
-Translate Y position within grid to the corresponding tile Column (returns -1 if the position isn't on grid)

Theses allow you to translate the positions of actors into coordinates on the grid, or get the tile the mouse was clicked on.

-Translate center of Row number to X position
-Translate center of Column number to Y position

This reverses the translations of positions to grid tile numbers, by returning the X and Y positions of the CENTER of tiles specified.
For instance, 4x and 4y in a 100x100 grid tile will return X 550 and Y 550.
(Grid tiles start at tile 0,0.)

Semi-advanced functionality:
Translate X,Y positions into center of the appropriate tile's X,Y positions (snap to grid)

Example: If I click the mouse to move a character to a position, the function changes an input of X,Y to the the tile at X,Y's position's center X,Y coordinates.
If our grid has 100x100 pixel tiles with a X150,Y80 offset and a player clicks on the position X282 and Y198 -- it calculates that the player clicked on Tile 1,1, and returns X300 and Y230 -- the center of the grid tile that was clicked.

Booleans:
Is X,Y position on grid? (Returns true if X and Y positions are on the grid)

...

If anyone wants this behavior, just tell me -- and I'll publish it.
Publishing it just requires me to rewrite to the functions to employ human language and adding descriptions.

Speaking of which..: is there any way to change the custom blocks themselves or add descriptions after creating the blocks?

7
My main problem is the need to do everything, myself, to be satisfied.

I want to make the animations, the scripts, all the maps, all the coding...

While that is possible for smaller projects, it will be impossible for larger projects.
And all my projects are, realistically, pretty darn large projects.

__________

So whenever I get an idea, I note it.
Wherever I am, on whatever available -- and store it for later use.
That gives me thousands of ideas to work on... but not the time to put them into life XD

8
How to make a functional array without any problems:

(Screenshot at bottom; I'm going over the logic in the top section, and want feedback for better methods if there are any in any of the steps)

Create a scene behavior.
Create three custom blocks:

Create Array (Global block): (Return type: None (action block))
Create Array from [ List ] Width: [ Width ] Height: [ Height ] Default value [ Anything ]

Empty [ List ]
Set item 0 in [ list ] to [ Width ]
Set item 1 in [ list ] to [ Height ]

Repeat [ [ Width ] x [ Height ] ] times
Set item [ [ 2 ] + [ current loop count ] ] to [ Anything ]

___
===
___

Set Array Value (Global block): (Return type: None (Action block))
Set Array [ List ] item X: [ Width ] Y: [ Height ] to [ Anything ]

IF [ [ Width ] < [ Get item # 0 from [ List ] ] AND [ Height ] < [ Get item # 1 from [ List ] ]
(safecheck mechanism) 

Replace item # [  2 + [ [ Height ] * [ Get item #0 from [ List ] ] + Width ] ] with [ Anything ]
** (Holy cow batman!) **

Otherwise [ Print: Can't set values outside array boundaries! ]

___
===
___

Get Array Value (Global block): (Return type: Anything)
Get Array [ List (List) ] item X: [ Width (number) ] Y: [ Height (Number) ]

IF [ [ Width ] < [ Get item # 0 from [ List ] ] AND [ Height ] < [ Get item # 1 from [ List ] ]
(safecheck mechanism) 

[ Return [ Get item # [ 2 + [ [ [ Height ] * [ Get item #0 from [ List ] ] + Width ] ]
** (Holy cow batman!) **

Otherwise
Return [ -1 ]
Print [ Can't get values outside array boundaries! ]

=================

Functional explanation:

When we set our array, we multiplied it to the size we needed.
A 12x12 array contains 144 items plus the two first entries.

Now.
Why does this work? What prevents entries from overwriting eachother when setting values?
The failsafe IF [ [ Width ] < [ Get item # 0 from [ List ] ] AND [ Height ] < [ Get item # 1 from [ List ] ]  prevents you from writing to 15,0 in the array by checking that 15 in fact is larger than the maximum allowed width for each row -- stored in the list's item #0.

Writing to X 15 Y 0 in a 14x14 array would overwrite the normal value in X 1 Y 1 -- so the X/Width comparison failsafe is important to avoid errors.

Less importantly, we don't want you to write outside Y boundaries of the array either, in case you set the boundaries for a reason, so we just stop those too -- even though you don't need to stop if you need to expand the array.
However, you can never expand the width of the array without creating a new array.

The array also starts at X 0 and Y 0 like a normal array, which means that if you create the array as 14x14 -- the location X 13, Y 13 is the final value in the array and trying to get 14,13 or 13,14 results in the error messages set up.

Trying to access X -1 and X-2 with Y 0 returns the array boundaries -- and is a nifty thing to keep in mind if you have many arrays in different sizes and need to automatically write to one.

Now. How it the array actually works, shown with a 3x3 array:

X,Y
0,0 | 1,0 | 2,0
0,1 | 1,1 | 2,1
0,2 | 1,2 | 2,2

However, this is not an actual array. It's a list where math creates the array functionality:
And the list like it actually looks:
0: (Reserved) 3
1: (Reserved) 3
2: 0,0
3: 1,0
4: 2,0
5: 0,1
6: 1,1
7: 2,1
8: 0,2
9: 1,2
10:2,2

HOW this works:

Looking at the code that actually changes the values inside the array:
Replace item # [  2 + [ [ Height ] * [ Get item #0 from [ List ] ] + Width ] ] with [ Anything ]

IF you Get Array item X (Width) = 2 and Y (Height) = 0:
2 + ( X: 2 +  ( Y: 0 * (Reserved) 3 ) ) = List item number 4

0: (Reserved) 3
1: (Reserved) 3
2: 0,0
3: 1,0
4: 2,0
5: 0,1
6: 1,1
7: 2,1
8: 0,2
9: 1,2
10:2,2

For X0 Y1:
2 + ( X: 0 + ( Y: 1 * (Reserved) 3 ) ) = List item number 5

0: (Reserved) 3
1: (Reserved) 3
2: 0,0
3: 1,0
4: 2,0
5: 0,1
6: 1,1
7: 2,1
8: 0,2
9: 1,2
10:2,2

...

WHY this works:

It works because of the multiplication of X with Y.

For instance: We can set up an array with the max size X = 10 and Y = 2:
The Array is 10 items wide and 2 items long, and "looks" like this:
[-2,0: 10][-1,0: 2] <--- The index necessary to 'remember' the array size
_____________
[0,0][1,0][2,0][3,0][4,0][5,0][6,0][7,0][8,0][9,0] <-- Values for Y = 0 and X 0 to 9
[0,1][1,1][2,1][3,1][4,1][5,1][6,1][7,1][8,1][9,1] <-- Values for Y = 1 and X 0 to 9
...

As a list:
0: [-2,0: 10]
1: [-2,0: 3]
2: [0,0] <-- First item in the array
3: [1,0]
4: [2,0]
5: [3,0]
6: [4,0]
7: [5,0]
8: [6,0]
9: [7,0]
10:[8,0]
11:[9,0] <--- Last item for Y = 0
12:[0,1] <--- First item for Y = 1
13:[1,1]
14:[2,1]
15:[3,1]
16:[4,1]
17:[5,1]
18:[6,1]
19:[7,1]
20:[8,1]
21:[9,1] <-- Last item in the array: 9,1

Functionality:
I made this array because I needed the ability to reference positions on my entire map, and I had problems with "lists within lists" -- especially when trying to register mega-sized arrays of over 100x100 (10 000 items)

This array handles 10 000 items (100x100, 500x20, 250x40) with ease.

(EDIT: I had to post prematurely because my laptop ran out of power :D )

9
Shared Resources / Re: A* Pathfinding Behavior
« on: April 08, 2013, 03:38:39 am »
Thanks :)

10
Ask a Question / Re: netbook
« on: March 29, 2013, 04:47:00 am »
Reduce the size of the window in the "game settings"?

11
Resolved Questions / Re: falling bridge-like behavior? (SOLVED)
« on: March 27, 2013, 02:58:25 pm »
How about making a loop that increases Y speed in the absence of gravity?

Start Y-speed at 4, then multiply it by 2 every 0.1 seconds through a 5 time loop:
4 -> 8 -> 16 -> 32 -> 64 --> 128

12
Game Ideas / Re: Any ideas for level themes?
« on: March 27, 2013, 02:43:50 pm »
Dark cave
Humid cave
Rotting cave
Crystal cave
Root-bound cave
Rocky cave
Salt cave
Slippery cave
Icy cave

Palmy jungle
Brushy jungle
Thorny jungle
Thick jungle
Treetop jungle
Dark jungle
Mystic jungle
Haunted jungle

Snowy mountain
Volcanic mountain
Windy mountain
Thunderous mountain
Rainy mountain
Unstable/earthquake mountain
Red mountain
Steep mountain
Deserted mountain

Anything that is NOT a desert, generally.

13
Archives / Re: How about adding a clean multidimensional array?
« on: March 27, 2013, 01:56:14 am »
Place your 128+ lists into 1 list.

Long story short:
Lists within lists failed a reliability test, massively, producing errors when I tried to write to list number 128.
(I also tried 129 list -- the same error applied when writing to list 128.)

So I'm considering making 1 list with 4096 items using custom blocks, possibly as little as 1 single custom block to enable arrays:

["Array X:"[Number]"Y:"[Number]]
With the custom block return type being a number:
[Return[X]+[Y*128]]

For custom inputs referencing X 57 Y 10 -- it refers to item number 1337.
For custom inputs referencing X 127 Y 0 -- it refers to item number 127
For custom inputs referencing X 0 Y 1 -- it refers to item number 128
For custom inputs referencing X 1 Y 1 -- it refers to item number 129

At the very least -- this is failsafe unless lists have item number restrictions.

...

=================

Alright.

That was quite easy to set up.

At this point I'm just waiting for the crash and burn.

14
Resolved Questions / Re: Can I detect if Actor is stuck in a tile?
« on: March 25, 2013, 01:54:46 pm »
"Snap to grid" is your friend.

15
IF you have your behavior shoot projectiles, you pretty much have to choose their spawnpoint and the direction.

There's multiple ways to do this so if you post your code so far, people can be able to tell you why it doesn't work as intended and how to make it work as intended, and why that will make it work as intended.

Pages: 1 2