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

Pages: 1 ... 235 236 237 238 239 ... 241
3541
Ask a Question / Re: Actor, Actor Group,Actor type.. confusing..
« on: December 17, 2011, 04:44:36 am »
Maybe you just need to go to the scene, put actor1 there and customize the behavior attributes there. I think then you should be able to set actor2 and actor3. You can only set actor attributes in the scene editor, not directly on the actor type (I guess it's because outside of the scene context, actors don't exists).

3542
In one of the followups to 2.0, we plan to let you define Scene Templates for which you can define a parent-child relationship between scenes and have the "parent" scene hold all the boilerplate behaviors, so you don't have to re-define them each time.
Sweet :) Stencylworks is getting better and better...

3543
Resolved Questions / Re: Teleport Help
« on: December 16, 2011, 07:53:49 pm »
I think you have to use toRadians, Math.cos() expects radians.
getAngle() returns radians, but 270 are degrees.
Code: [Select]
Math.cos(actor.getAngle() + Util.toRadians(270))
or (if created in design mode):
Code: [Select]
Math.cos(Util.toRadians(Util.toDegrees(actor.getAngle()) + 270))

3544
Old Bugs (1.x/2.x) / It's possible to attach an actor behavior to a scene
« on: December 16, 2011, 08:52:01 am »
When you edit a scene and click "import behavior from library" a window opens with a little search box on the top right. When you search for the name of an actor behavior you can attach it to the scene, then when you start the game an error message appears (and then you are like "whoa, what happened" and start to debug perfectly fine behaviors :P)

It happened to me, because I have an actor behavior "Do on Key Press" an a scene behavior "Scene Do on Key Press". I searched for "Do on K" and accidentally added the "Do on Key Press" actor behavior to my scene.

This does not happen if I click on a folder first and then enter something in the search box, in this case I only see scene bahaviors.

3545
I also noticed this. My workaround looked like this:

3546
Resolved Questions / Re: Width/Height of Actor Type?
« on: December 16, 2011, 03:43:02 am »
Nice, that makes some useful global custom blocks:

3547
Resolved Questions / Re: Width/Height of Actor Type?
« on: December 16, 2011, 02:56:15 am »
Code: [Select]
var sprite:Sprite = Assets.get().resources[type.spriteID] as Sprite;

Great, thanks! That's what I was looking for. Couldn't I just use
Code: [Select]
var width = sprite.width;
var height = sprite.height;
?
That seems to give the right results (for the default animation, that's the only animation I need).

3548
Archives / Re: A "null" block
« on: December 16, 2011, 02:48:52 am »
Or create a global custom block with return type "Anything" and put a code statement inside with "return null;"

3549
Resolved Questions / Width/Height of Actor Type?
« on: December 16, 2011, 02:13:32 am »
Hi!

Is it possible to get the width and height of an Actor Type without/before creating an actor of this type? I think it has to be possible, because the actor is created from the actor type, so the information should be there somewhere.

I don't mind if it's only possible with code. I looked at the API, ActorType has a spriteID, and Sprite has width and height, but I don't know how to use the spriteID to get an instance of Sprite?

Of course I could just create an actor of the actor type get the width/height and then kill it, but I was looking for a more elegant solution (I fear creating an actor could have unwanted side effects if there is something in the "when created" block)




3550
Archives / Re: May be to add percent block?
« on: December 15, 2011, 12:44:30 am »
Yes, should work fine.
if it's global custom block, is it mean that this formula will work even if I will not attach this wrapper to any actor or scene and everywhere I can use just green custom block for necessary action?
Yup.

3551
Ask a Question / Re: Fog of War
« on: December 15, 2011, 12:15:54 am »
I've seen this on Stencylforge, it's called Draw Light Radius.
Basically you just need a black image with a transparent circle, and use it as an actor that moves around with your player.

3552
Ask a Question / Re: Applying Shooting Restrictions for bullets
« on: December 15, 2011, 12:06:18 am »
For the delay: use a boolean attribute "Wait" like this:

If not Wait
    <Do your shooting here>
    Set Wait to true
    Do after _ seconds
        Set Wait to false

For ammo: Use an attribute that counts how much ammo you have. Decrease it by one every time you shoot, reset it to max when you reload. And put your shooting code in a "if Ammo > 0"-block.

3553
Ask a Question / Re: A couple of questions...
« on: December 14, 2011, 04:14:10 pm »
Do you have to do the levels in order, or can you chose randomly among the first ten levels?

If you do the levels in a given order, you can just switch from each level to the next after completing it and have one game attribute to store how many levels you have completed.

If you can chose randomly you need one game attribute per level to store if this level was completed.

In both cases after ten levels have been completed you can unlock the next levels (e.g. another game attribute "stage 2 unlocked" set to true).

3554
Ask a Question / Re: A couple of questions...
« on: December 14, 2011, 02:31:35 am »
1) You can create a region, and use the "for each actor in region"-block to check if your player has entered the region. When your player is inside the region behind the doorway, create a new actor that represents the door.

2) For items use game attributes. There's an example game on stencylforge where you can pick up a sword. I think it was called "Action Adventure" or something like that.

3) Again game attributes. For collection gold you have a number attribute, that you increase each time you collect a coin.

4) To switch an animation use the "switch animation to"-block. To check if the animation has finished use the "is animation playing for"-block (make sure the animation is not set to loop) after the stops playing you can kill the actor with the "kill actor"-block.

5) You can also use game attributes to unlock levels (one boolean per level).

I hope that helps...


3555
Old Bugs (1.x/2.x) / Re: Cannot Test / Export in 1.3.0 (Linux)
« on: December 13, 2011, 10:42:46 am »
Ok, feel free to ask me to test the linux version anytime :)

I was wondering what these "dot underscore" files (._something) are. There where a lot of them in the stencylworks directory. Turns out they are metadata files from OSX that are created on windows and linux filesystems.
Code: [Select]
http://support.apple.com/kb/TA20578 Seems save to delete them.

Maybe because the file extension of ._flex.swc is still swc, stencyl tried to read it like an swc file.

Pages: 1 ... 235 236 237 238 239 ... 241