Skip to main content

News

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

1
Projects / Re: Project ZeC (My Zelda-esque Clone)
Code: [Select]
var name = candle_flame;

var tile;
var tw = GetTileWidth();
var th = GetTileHeight();
var tn = GetTileName(tile);

var px = GetPersonX(name);
var py = GetPersonY(name);
var pl = GetPersonLayer(name);
var dir = GetPersonDirection(MainChar);

var x;
var y;
var l;

switch (dir) {

case "north":
 
 x = px;
 y = py - 2;
 l = pl;
 tile = GetTile(x, y, l);
 
  if (tn = "burnable_bush") //tile name to be changed later
   {
    if (py == y)
    {
     }
    }
   break;

I am not currently in front of a computer to test this on... Writing the code on my mobile phone. Looking at how this code is written so far, I'm wondering if it will produce an error on var tn due to the fact that var tile technically isn't being define until the switch (dir)?
I'm not even sure what you're trying to do in this example, I'm sure there's a way to do it that's more concise and won't make an error though.
2
Sphere Support / Re: Player Movement Systems...
It's certainly possible and a simple switching mechanism could be implemented.

Could it cause glitches? Well if there were mistakes in the code, sure :P
3
Projects / Re: Project ZeC (My Zelda-esque Clone)
Rhuan helped me come up with a way to handle the map transitions. It's a very good starting point but I need to find a way for the player not to be able to move across the map while the transition is occurring.
To do that just put in  DetachInput() and ClearQueue() (with the player as the parameter) at the start of the transition and then an AttachInput at the end.
4
Alpha version of MapEngine and associated scripts available for download - I need to write some documentation and clean up a few things but I think this now counts as a usable system.

Note the graphical resources used to demo this are not mine and they are from Kefka's Revenge, please don't use them in any other public project without permission from their original authors.

The demo in this download allows you to walk around and talk to two people that is the extent of it - it's meant to demo a map engine and sprite system which I think it does.

Requires miniSphere 5 beta 2 at least also needs the latest version of the pact.js system module - this was updated today 30/09/17 so you maybe need to visit the miniSphere github for that.

edit by Fat Cerberus: Or just use beta 3 ;)

https://www.dropbox.com/s/y5r93nq23nftvfn/dist.zip?dl=0

EDIT: link updated - I fixed a bug where collision checks between sprites would sometimes fail.

EDIT2: the first fixed version wasn't actually fixed, should be fixed now

EDIT3: re-uploaded again.... Sorry about this, found and fixed more bugs, I guess I should have tested more before posting the first time.
5
Projects / Re: Project ZeC (My Zelda-esque Clone)
Oh no I'm really sorry to hear that and hope it is fixed somehow soon.
6
I got a switch at release and had a lot of fun with Zelda BOTW for a while but haven't touched it much since - I haven't really played games for several months now, I've been coding instead, though I'm looking forward to Xenoblade 2 - I was kinda obsessed with Xenoblade X on the Wii U for a long time.
7
Projects / Re: Project ZeC (My Zelda-esque Clone)
It was based off of tile movement. A good portion of my x,y put you on the other side of a door at mid tile points. Especially in the dungeon levels where the north & south doors take up 2 tiles & the entry point is between those 2 tiles.
You could do 4 directions without doing tile movement - tile movement in an action rpg would be problematic anyway.
8
Projects / Re: Project ZeC (My Zelda-esque Clone)
You shouldn't have needed to move everything - what was your movement script?
9
Projects / Re: Project Zelda [MiniSphere 5 Beta]
That's a pretty hefty typo...
Fixed...
10
Projects / Re: Project Zelda [MiniSphere 5 Beta]
So, using miniSphere, v2 api? Any chance I can persuade you to use some of my new scripts? (MapEngine, Sprite Engine and HUDSystem)

I know they're not 100% ready but they're pretty close and having someone else use them would help them get polished.
11
OK updates:

1. Everything is written in ES6 style now pretty much
2. It works again
3. I've added handling for person scripts
4. I've added an extensible input handler

2 key things I still need before I can release a working demo now:
1. A method for loading person scripts from a file
2. A decent talk function to show how it works... :P

One further thing before I can publish this as ready for use:
- documentation
12
Projects / Re: Project ZeC (My Zelda-esque Clone)
Does that BindKey trick work in miniSphere?  Thinking about how the input code in map_engine.c looks, it might not.
Honestly I have no idea, I've hardly used the "default" mapengine in years.
13
Projects / Re: Project ZeC (My Zelda-esque Clone)
In attempting to eliminate diagonal player movements (based on Original LoZ, only 4 movements n, s, e, w) the movement systems I've attempted so far have in fact eliminated the diagonal movement but in the process broken other essential game functions. Might be good movement systems for future projects but not ZeC.
To eliminate Diagonal movement whilst taking advantage of various "normal" features of the sphere v1 map engine you have to.

1. AttachInput to your character. (otherwise OnActivateTouch and related thigns don't work.

2. Use BindKey to overwrite the functionality that AttachInput has given to KEY_UP, KEY_DOWN, KEY_LEFT and KEY_RIGHT e.g.
Code: [Select]
BindKey(KEY_UP,"""");
BindKey(KEY_DOWN,"""");
BindKey(KEY_LEFT,"""");
BindKey(KEY_RIGHT,"""");
3. Implement new movement - normally done by setting an update script that handles it.
14
@Rhuan That first link is a 404.
It had taken the bracket with it, fixed.
15
Sphere General / Re: Promoting Sphere?
Collision algorithm built into my work in progress map engine, I could add more shape types in the future - for now does rectangles and circles:
Code: [Select]
	static polysCollide(x, y, _one, two)
{
let result = false;
let one = {x: _one.x + x, y:_one.y + y, type: _one.type, w:_one.w, h:_one.h};
if(one.type === 0)
{
if(two.type === 0)
{//circle with circle
result = (((one.x - two.x) * (one.x - two.x) + (one.y - two.y) * (one.y - two.y)) <= ((one.w + two.w) * (one.w + two.w)));
}
else if(two.type === 1)
{//circle with rect
let x_d = one.x - two.x - two.w /2;
x_d = x_d < 0 ? -x_d : x_d;
let y_d = one.y - two.y - two.h /2;
y_d = y_d < 0 ? -y_d : y_d;
if((x_d > (two.w/2 + one.w)) || (y_d > (two.h/2 + one.w)))
{//distance between centres > radius + half width or height of square
result = false;
}
else
{
if(x_d <= two.w/2 || y_d <= two.h/2)
{//distance between centres < half width or height of square (combined with check above)
result = true;
}
else
{//final check pythag
x_d = x_d - two.w/2;
y_d = y_d - two.h/2;
result = ((x_d * x_d + y_d * y_d) <= one.w * one.w);
}
}
}
else
{
CEngine.error ("Unknown polygon type given to collision engine, valid types are 0 or 1, supplied type was " + two.type);
}
}
else if(one.type === 1)
{
if(two.type === 0)
{//circle with rect
let x_d = two.x - one.x - one.w /2;
x_d = x_d < 0 ? -x_d : x_d;
let y_d = two.y - one.y - one.h /2;
y_d = y_d < 0 ? -y_d : y_d;
if((x_d > (one.w/2 + two.w)) || (y_d > (one.h/2 + two.w)))
{//distance between centres > radius + half width or height of square
result = false;
}
else
{
if(x_d <= one.w/2 || y_d <= one.h/2)
{//distance between centres < half width or height of square (combined with check above)
result = true;
}
else
{//final check pythag
x_d = x_d - one.w/2;
y_d = y_d - one.h/2;
result = ((x_d * x_d + y_d * y_d) <= two.w * two.w);
}
}
}
else if(two.type === 1)
{//rect with rect
result = (
(one.x <= (two.x + two.w)) &&
((one.x + one.w) >= two.x) &&
(one.y <= (two.y + two.h)) &&
((one.y + one.h) >= two.y));
}
else
{
CEngine.error ("Unknown polygon type given to collision engine, valid types are 0 or 1, supplied type was " + two.type);
}
}