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 - SanjayPatel

Pages: 1
Ask a Question / Re: Play sound based on list version 3.0
« on: April 02, 2014, 07:35:35 pm »
So what you're trying to do is store the names of the sounds you want to trigger in a list as text?  That's a cool idea, but I don't think it will work directly because the block that triggers a sound doesn't accept text as it's input like, say, the switch animation blocks. 

I think its possible, however, to create a list that references the actual sound objects, and not just the text name of the sound.  The only way i could figure out how to do this, however, was to make an attribute of type "Sound" for each of the sounds you want included in the list.  Then set the default value of the these sound attributes to each of the sounds you've imported into stencyl.  Then you can add those sounds to the list and reference them directly.

Either way, it seems kind of clunky.  Its probably easier just to reference the sounds directly.

Ask a Question / Re: Text When Enemy Dies
« on: April 02, 2014, 07:01:38 pm »
You could try triggering a custom event to draw the text.  Check this article out:

You could setup an actor in the upper right with a behavior that includes a custom event that draws the text. Then in the enemy actor condition for "dying" you can trigger the custom event to draw text before killing the enemy actor.

I'm sure theres a bunch of ways you could do it, but thats the first thing that came to mind.

Journals / Re: Soul Source - Game Journal
« on: April 02, 2014, 03:27:19 pm »

Updates 04-02-14

Implementing the card processing "stack" is the current beastly task.  The basic game flow of combat involves choosing up to 2 actions from your hand at the bottom.  These two selected cards move up to the selected card slots along the left hand side of the screen.  The enemy character will also choose 1 or 2 actions each turn.  The first cards of both player and enemy will get processed and then the second cards of player and enemy will get processed.

For reference:
"A" cards are attacks, which will be more varied and tied to equipped items and spells.
"B" cards are blocks, which will be tied to armors or shield spells.


Implementing the actual information in the cards is not as complicated.  A "card" is a list with several fields holding it's information.
[Type, Value, Speed, Animation#, ResponeAnimation#]

  • Type: differentiates between attacks, blocks, and other special abilities.
  • Value: the power of the attack or block.
  • Speed: higher speed cards get processed first
  • Animation#: this will identify the animation to be triggered for the player.
  • ResponseAnimation#: this will identify the animation to be triggered for the enemy.

In order to implement decks and hands of cards, I simply create a list of card lists which can be read using nested [get items "index" from "list"] blocks.

Drawing a card means adding the first item from the Deck list to the Hand List and then removing it from the Deck.  Likewise, playing a card entails adding the card from the Hand list to the "stack" and then removing that item from the Hand.  Each of the cards that are used by player or the enemy is placed in the stack, sorted by selection order and card speed.  The Stack is then processed in order at the end of each turn, which means that use the basic math:
  • PlayerHealth = PlayerHealth - (EnemyAttack - PlayerBlock)
  • EnemyHealth = EnemyHealth - (PlayerAttack - EnemyBlock)
While these actions are processed, animations are triggered based on the cards played.

After those cards are processed, they are discarded from the stack.  Then new cards are drawn and the next turn can begin.

Thats the rough outline of how the card combat will be processed.  Hoping to get a playable demo of the combat up on the arcade soon!

Ask a Question / Re: Complex Tile Collision Shapes
« on: April 02, 2014, 09:20:07 am »
Well maybe this will still help - this is how i managed tile switching stuff in stencyl 2 (using some AS3 code),1166.msg141425.html#msg141425

Ask a Question / Re: Complex Tile Collision Shapes
« on: April 01, 2014, 08:32:01 pm »
hmm... not really.  As far as i can tell, the Tile API is designed more for setting up the tiles for a scene at the load.  Is the maze you're trying to build dynamic? Like do the collisions change while the scene is live?

Ask a Question / Re: Complex Tile Collision Shapes
« on: April 01, 2014, 04:23:29 pm »
I've definitely found that sticking with a 32x32 size tile works out better for stencyl. 

Have you tried using the Tile API?

You could have the level generated by loops that read from a list.   In that list you could note which tile from a particular tile set to use for each tile in the scene. Then you just make a tileset that you can customize the collisions of.

Journals / Updates: 04-01-14
« on: April 01, 2014, 01:53:02 pm »

Implementing a Deck and Card system into the game is going to require a series of multi-dimensional lists. 
I'll need a list for:
  • Library of Potential Items
  • Stored Player Inventory
  • Carried Player Inventory
  • Equipped Player Inventory
  • Player Deck
  • Player Hand

Thats a lot of lists for just the Player.  In addition to that, however, I'll need Lists to maintain the Cards available to the various enemies to be encountered.

List for Enemies:
  • Library of Enemy Cards
  • Enemy Deck
  • Enemy Hand

So far implementing that plus some temp artwork for visual feedback is taking up all my time.  Will follow up with some notes about the list implementation.

...and some WIP animations...

Ask a Question / Re: How to align font to the right side?
« on: March 31, 2014, 10:29:58 am »
You can use the "get width for "  " as text block to figure out the length of the number you're printing. Just negate this length and use that as the "X" for the draw text behavior.  I attached a stencyl project that should work.

Ask a Question / Re: Changes in editor are not reflected in game
« on: March 31, 2014, 10:08:56 am »
I've had this issue come up multiple times when there are duplicate custom events or blocks.  If you check under the "custom" category in the palette in design mode and see blocks that are under a heading that doesn't match up with another behavior, it might mean you've got the same issue I had.

I also found that this happened when looking under /User/<yourusername>/stencylworks/games/<gamename>/snippets I'd see .pngs for behaviors i had previously removed from my game.  Thats where the duplicates were coming from.  I can't say I recommend messing with those files, because I don't know what other dependencies there are for those old behaviors, but deleting them, exporting and reimporting my game made this issue go away.

Journals / Soul Source - Game Journal
« on: March 31, 2014, 09:34:21 am »
Soul Source was completed for Stencyl Jam 2014 and is playable in that form here:

I have plans to expand the game from it's current form.  Right now it's a procedurally generated dungeon crawler with some action adventure controls, but I'd like to expand the combat system into a deck building, turn-based combat system.

In addition, the backstory is being rewritten and fleshed out, along with a static over world from which the player will delve into different dungeons. 

SOOooo..... its a 2-d, top-down rpg with a static overworld, procedurally generated dungeons with random encounters and boss battles that uses a deck-building mechanic for inventory and turn-based combat.

More posts to come.  but here's the ROUGHEST draft of a screenshot of the battle system.  Down below are the slots for the player's hand of cards.

Stencyl Jam 14 / Re: Soul Source - Procedurally Generated Dungeons
« on: March 24, 2014, 01:10:09 pm »
Here's a project and behaviors I used to make the lighting work in Soul Source.

Stencyl Jam 14 / Re: Soul Source - Procedurally Generated Dungeons
« on: March 24, 2014, 07:07:40 am »
Wow! It's awesome game! How You did light effects in the game?

Thanks! It was a lot of trial and error with layer and actor blend modes.  I'll try to put together a demo project soon and post it.

Stencyl Jam 14 / Re: Soul Source - Procedurally Generated Dungeons
« on: March 23, 2014, 04:11:12 pm »
Also up on the Stencyl Arcade:

Stencyl Jam 14 / Soul Source - Procedurally Generated Dungeons
« on: March 23, 2014, 04:08:05 pm »
Hi All,

Uploaded my game to Newgrounds for the Stencyl Jam 2014. 

Soul Source is a 2-D, top-down adventure game with procedurally generated dungeons.


Without a soul, the body cannot survive...
As a Soul Caster, you can channel the life force of the spirits around you into your magicks.
But can you find the Soul Source and reclaim your life before the light runs out?
Z to Illuminate
X to cast a Soul Blast
Arrows to Move
Game Design - Sanjay Patel
Sound Design - Brett Forest
Music - Tyler Young

Thanks for checking it out in advance! 

Ask a Question / Re: Can Stencyl do random/procedural level generation?
« on: August 22, 2013, 03:14:28 pm »
I know this is an old topic, but I've been working on a project that uses procedural generation to create levels and I think it'd help to note some of the things I've encountered.
check out WIP so far:

I was able to get this far using code mode and creating a scene behavior. 

Using multi-dimensional arrays in AS3 is not as hard as it sounds  - basically I'm creating an array thats as long as the number of grid rows in the scene. Then you store an array in each of the indexes of that rows array that is as long as the number of columns in the scene.  This meant that by saying Array[0] i was referencing the top row of the scene.  By typing Array[0][1] I'm referencing the grid square that is in the top row and second column from the left. 

Now here's where it gets really weird:

In each of those Array[row][col] spaces I stored ANOTHER array that was only two in length - one index for TilesetID and one index for TileID.

Code: [Select]
var TSID:int = 0;//helper variables to reference tilesetID and TileID
var TID:int = 1;
var tilesArray:Array = new Array(30); //number of rows in my scene

for(var r:int = 0; r < rows; r++)//every row
tilesArray[r] = new Array(cols);
for(var c:int = 0; c < cols; c++)//every column
tilesArray[r][c] = new Array(2);//Array[0] is TilesetID and Array[1] is TileID
tilesArray[r][c][TSID] = 1;//
tilesArray[r][c][TID] = 0; //fill the array with WALL tiles



This created this 3-d array and filled it with TilesetID and TileID numbers.

Next went through the nasty process of randomly changing tiles from walls to floors (hint use one tileset for walls and one tileset for floors.  Then set all of the squares in your floor tileset to have no collisions while all the squares in the walls tileset have full square collisions. 

Last I went through the whole array and used the setTileAt command to generate the appropriate tile at the each row and column coordinate.

I'll try to post more details later, but for now here's the gist of it:

Code: [Select]
for(var r:int = 0; r < rows; r++)
for(var c:int = 0; c < cols; c++)
setTileAt(r, c, 0, tilesArray[r][c][TSID], tilesArray[r][c][TID]);
                //it works like this setTileAt(row, column, layer, tilesetID, TileID)

after it writes all the tiles I have it make a player and a stair case. 

Thats the basic Idea I used - any feedback or further ideas would be awesome!

Pages: 1