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

Pages: 1 ... 150 151 152 153 154
2266
Resolved Questions / Re: Get height for Font throwing 1009 error
« on: April 09, 2011, 11:08:57 am »
Yes.

The error dissapears when I remove the get height of font block. I never had any trouble with the remove index from HUD custom block. o_o"

Uploaded "Test Game" on forge, if you want to check what I mean. Just hit test game, and you'll see it prints all the errors. If you remove the block I told you about, it should go without errors.

2267
Resolved Questions / Re: Get height for Font throwing 1009 error
« on: April 09, 2011, 10:14:57 am »
Here.

Code: [Select]
package scripts
{
import flash.display.BlendMode;
import flash.events.*;
import flash.net.*;
import flash.filters.*;

import Box2DAS.Collision.*;
import Box2DAS.Collision.Shapes.*;
import Box2DAS.Common.*;
import Box2DAS.Dynamics.*;
import Box2DAS.Dynamics.Contacts.*;
import Box2DAS.Dynamics.Joints.*;

import stencyl.api.data.*;
import stencyl.api.engine.*;
import stencyl.api.engine.actor.*;
import stencyl.api.engine.behavior.*;
import stencyl.api.engine.bg.*;
import stencyl.api.engine.font.*;
import stencyl.api.engine.scene.*;
import stencyl.api.engine.sound.*;
import stencyl.api.engine.tile.*;
import stencyl.api.engine.utils.*;

import org.flixel.*;

public dynamic class Design_4_4_DrawHUD extends SceneScript
{

public var _ItemstoDraw:Array;
public var _XOffset:Array;
public var _YOffset:Array;
public var _Font:Font;
public var _DrawHUD:Boolean;
public var _X:Number;
public var _Y:Number;
public var _ActorType:ActorType;
public var _ActorName:String;
public var _CreatedActorsList:Array;
public var _Actor:Actor;
override public function init():void
{
    doesCustomDrawing();

    if (_DrawHUD)
    {
        CreateActors();
    }
}
override public function update():void
{
}
override public function draw(g:Graphics, x:Number, y:Number):void
{

    if (_DrawHUD)
    {
        for (var index0:int = 0; index0 < _ItemstoDraw.length; index0 + +)
        {
            if ((String(("" + _ItemstoDraw[ index0])).indexOf("[Actor]") < 0))
            {
                g.translateToScreen();
                g.setFont(_Font);

                if (sameAs(("" + _XOffset[ index0]), "Center"))
                {
                    _X = (getScreenX() + ((getScreenWidth() / 2) - (g.getFont().font.getTextWidth(("" + _ItemstoDraw[ index0])) / 2)));
                }

                else
                {
                    _X = Number("" + _XOffset[ index0]);
                }

                if (sameAs(("" + _YOffset[ index0]), "Center"))
                {
                    _Y = (getScreenY() + ((getScreenHeight() / 2) - (g.getFont().font.height / 2)));
                }

                else
                {
                    _Y = Number("" + _YOffset[ index0]);
                }

                g.drawString("" + ("" + _ItemstoDraw[ index0]), _X, _Y);
            }
        }
    }
}
/*IGNORE __Index __Item */
public function AddtoHUDList(__Index:Number, __Item:Object):void
{
    _ItemstoDraw[ __Index] = __Item;
}
/*IGNORE __Index */
public function RemoveHUDElement(__Index:Number):void
{
    ArrayUtil.removeAt(_ItemstoDraw, __Index);
}
public function StartDrawingHUD():void
{
    _DrawHUD = true;
    CreateActors();
}
public function StopDrawingHUD():void
{
    _DrawHUD = false;

    for each(var item:* in _CreatedActorsList)
    {
        setValueForScene("Draw HUD", "_Actor", item);

        if ((_Actor ! = null && _Actor.isAlive()))
        {
            _Actor.die();
        }
    }
}
public function CreateActors():void
{

    for (var index0:int = 0; index0 < _ItemstoDraw.length; index0 + +)
    {
        if ((String(("" + _ItemstoDraw[ index0])).indexOf("[Actor]") > = 0))
        {
            _ActorName = String(("" + _ItemstoDraw[ index0])).substring((String(("" + _ItemstoDraw[ index0])).indexOf("]") + 1), String(("" + _ItemstoDraw[ index0])).length);
            _ActorType = getActorTypeByName(_ActorName);

            if (_ActorType ! = null)
            {
                createActor(_ActorType, Number("" + _XOffset[ index0]), Number("" + _YOffset[ index0]), FRONT);
                getLastCreatedActor().anchorToScreen();
                _CreatedActorsList.push(getLastCreatedActor());
            }
        }
    }
}

public function Design_4_4_DrawHUD(ignore:*, scene:GameState)
{
super(scene);
}

override public function forwardMessage(msg:String):void
{

}
}
}

2268
Resolved Questions / Re: Get height for Font throwing 1009 error
« on: April 09, 2011, 10:10:55 am »
Dup, sorry. Here it is.


2269
Resolved Questions / Get height for Font throwing 1009 error
« on: April 09, 2011, 09:53:21 am »
Screen shot of the behavior in this thread

The troublesome part is in the when drawing wrapper, inside the last IF statement.

The "get height of font" block is throwing a null reference error, both the current font and the one that let you choose the font.

b368 ZIP preview
Windows 7

2270
Shared Resources / Re: Draw HUD (scene behavior)
« on: April 09, 2011, 07:09:47 am »
UPDATE
This behavior draws text and numbers on screen. It comes with two custom blocks for adding and removing HUD elements on the fly. It can also create actors and anchor them to the screen.

Comands:
- StartDrawingHUD: Tell this behavior this message to enable drawing for this behavior. It will also create the actors, if applicable.
- StopDrawingHUD: Tell this behavior this message to disable drawing for this behavior. It will also kill all the created actors, if applicable.
- CreateActors: Tell this behavior this message to create actors, based on the entries on the Items to Draw list.
=========================
Uploaded the updated version. Any problem, please let me know.

2271
Shared Resources / Re: Draw HUD (scene behavior)
« on: April 08, 2011, 10:02:46 pm »
I can add the option to create and fix the position of actors on the fly. I'll add that tomorrow.

2272
Shared Resources / Re: Cutscene pack (now available)
« on: April 08, 2011, 02:48:57 pm »
This may sound like a stupid question, but I want to be sure: one actor can have multiple trigger behaviors, correct?

2273
Old Bugs (1.x/2.x) / [Forge]Changing resource Icon
« on: April 08, 2011, 09:56:16 am »
If I upload a resource on Forge, and then change the icon, the new icon will only appear in the View Details page. Outside of the details page, it will show the icon it was uploaded with.

b368 preview (I just downloaded)
Windows 7

2274
Shared Resources / Re: Cutscene pack (now available)
« on: April 08, 2011, 09:47:12 am »
If anyone participating in the latest game jam (or working on any game really) wants to add a last minute cutscene (or two) to enhance their final product, I'm willing to work with you to make it happen.  I'd like to get this thing out into the field to gauge the usefulness in a complete game, before I sink too much more time into it. 

I'll gladly ask for your assistance then. Probably tomorrow, but as soon as I can I'll send you a PM with my idea of the cutscene. Is that ok?

2275
Shared Resources / Draw HUD (scene behavior)
« on: April 08, 2011, 09:44:59 am »
A simple behavior I'm using in Dungeon Rush! and figured it could be useful for someone else. It uses lists to draw as many numbers/texts as you need on screen. It's a scene behavior, so the drawing will always be above everything.

It also comes with custom blocks to add/remove HUD elements on the fly. I just added a custom block in the always wrapper of another behavior with the value I want (for example, current money), and that value will be drawn on screen.

The behavior on Forge have 3 screen shots if you want to check it but not download it.

2276
Resolved Questions / Re: Problem with lists
« on: April 07, 2011, 03:18:03 pm »
Yeah, checking for the content of the list solved this. Guess I was avoind that due to lazyness. >_>

Here is the behavior in its working form.

2277
Resolved Questions / Re: Problem with lists
« on: April 07, 2011, 02:52:25 pm »
My idea was indeed to check if the lists are equal or not. But I'll try this code and see if it works.

2278
Resolved Questions / Problem with lists
« on: April 07, 2011, 02:16:39 pm »
I have a little problem with this behavior. At the beginning, I set that list attribute to a game attribute list that tells wich achievements were already completed. The part bellow that is working normally, but the problem is after the comment block "Notification". Even though the lists are not equal after an achievement condition is met, the part under Notification isn't executing at all. (I can tell by the print blocks)

What am I doing wrong?

2279
Shared Resources / Re: Cutscene pack
« on: April 06, 2011, 07:05:50 pm »
I was thinking about this a bit more, and I think there are applications for this resource pack beyond cutscenes. 

1) Enemy AI -- seems like these triggers could be used to direct enemy movement and behaviors. You'll have to use your imagination and picture better looking enemy Actors, but here's an example.  Only one Actor Type is used, and all but one of them only use 1 trigger (the one that rotates at the top uses 2). 

example: http://www.stencyl.com/v10/game/play/2060

2) Simplified Dialog -- dialog appears to be much simpler using these triggers.  For instance if you wanted to have sign posts that displayed helpful info -- you could use a Dialog trigger for that. 

I was thinking about using the trigger behaviors for stuff like dialog and scene changing (a zoom in when you enter a door?), but the triggers to enhance enemy AI it's a nice touch! My behaviors don't have conditions for actor position, so this would be very useful!

EDIT: Greg, just checked your example, you just solved my "change direction when at the end of platform" issue. I was going to make a behavior for this, but now that I see I can use the pack, it sure saves a lot of time!

2280
Windows / Mac / Flash / HTML5 / Re: Dungeon Rush!
« on: April 06, 2011, 06:28:45 pm »
As I said in another thread: progress report!

The dungeon itself is ready. There may still be some rooms with problems, but we'll fix it as we playtest them.

There are a few music tracks I have to finish, about 6 I think.

We're currently working on the credits and the achievements part of the game. I have all the behind-the-scenes stuff done, but it's missing the notification part, and the actual achievements screen.

Strasteo is working on the credit's scene NPCs, and will work on some level design fixes.

So, yeah, we are almost there!
==================

Also...
I'll use this post to officially announce our partnership, Lit-Switch Productions. We've been working together for quite some time, and we work well together! We already talked about some of our next possible projects, and we're quite excited about this! Strasteo will handle most (if not all) of the graphic/level design related part, while I'll handle programming and sound.

We're also setting up a blog with information about our projects and stuff like that. It should be looking the way we want when we release Dungeon Rush!, though I'll let Strasteo decide if he wants to show the blog now or later.

Pages: 1 ... 150 151 152 153 154