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

Pages: 1 2 3 ... 14
1
Extension Ideas / Re: Having trouble with blocks unsing 'anything' type.
« on: January 04, 2013, 06:17:15 am »
Just wrote another block and tested it with 'text' and it works, but as soon as I change any of them to 'anything' the block won't load (Weather it's in the 'returns' or in the 'field' areas).  So I'm now leaning to this being a sencyl-side bug (which is really annoying and going to set my plans back a bit =Z)

I'm going to leave the post here for now, in case there's something I'm missing, but if not I'll repost in the bugs section.

Code: [Select]
<block tag="get" spec="Bonus: mod %0 modtype %1 bonustype %2 bonuslayer %3" code="CalcVarInterface.newBonusVar(~,~,~,~)" type="normal" color="gray" returns="text">
<fields>
<text order="0"></text>
<text order="1"></text>
<text order="2"></text>
<text order="3"></text>
</fields>
</block>

2
Not yet sure if this is a bug, or if I'm not doing something right.  I'd think if it was a bug someone would have noticed it by now since it's a pretty major part of the extension system - and I didn't see it when poking through the assigned and unassigned bugs sections, so I'm guessing the latter.

I have this in my blocks.xml file (among other blocks, but these are the ones that are causing the issue)
Code: [Select]
<block tag="listWrap" spec="List Wrap %0" code="ShivaInterface.listWrap(~)" type="normal" color="gray" returns="list">
<fields>
<anything order="0"></anything>
</fields>
</block>
<block tag="listUnwrap" spec="List Unwrap %0" code="ShivaInterface.listUnwrap(~)" type="normal" color="gray" returns="anything">
<fields>
<list order="0"></list>
</fields>
</block>

The code these reference looks like this;

Code: [Select]
public static inline function listWrap(v0:Dynamic):Array<Dynamic> {
var Arra:Array<Dynamic> = new Array<Dynamic>();
Arra.push(Type.getClassName(Type.getClass(v0)).split(".").pop());
Arra.push(v0);
return Arra;
}

public static inline function listUnwrap(v0:Array<Dynamic>):Dynamic {
return v0[1];
}

When I open my game, these two blocks don't show up (but the other block in the same blocks.xml file does - so it's not a formatting error, or a missing close tag or something).

The error that shows up in my log;
Code: [Select]
[ERR] java.lang.IllegalArgumentException: No enum const class stencyl.sw.editors.snippet.designer.Definition$Type.ANYTHING
Now 'anything' does show up as a type in the help information that's commented out, so I would expect it to work.  I'm trying to make it so that when my classed objects are used stencyl-side they are passed around as Lists (so I can store them in an attribute, since there's no such thing as an 'anything' attribute).

3
Extensions / Re: How to Create an Extension
« on: January 01, 2013, 11:21:56 am »
Oh I get it - the PDF is what replaces the post below it.  I somehow missed that there were attachments, sorry!

The reference to the 'pedia' was what threw me (I thought the pedia already was replacing even the PDF).  Nevertheless, I think I got it now, thanks!

4
Extensions / Re: How to Create an Extension
« on: January 01, 2013, 08:11:50 am »
I know this is an old post, but it's still stickied.  The linked post indicates that an updated version of the document exists on StencylPedia, but looking for the information there only pulls up the *other* type of extension (Stencyl extensions - like the Resource Manager, not code/block extensions)

What am I missing?

5
Suggestion Archives / Re: 'code' block fields
« on: October 29, 2012, 09:50:15 am »
As a parameter of the 'extensions' blocks. (blocks.xml)  My bad, I should have been more clear - will edit original post.

6
Suggestion Archives / Extensions: 'code' block fields
« on: October 29, 2012, 08:08:12 am »
I'd like to be able to set a field for a block as a 'code' field in an extension.  This would work exactly like 'text', but without the automatic quotes.

I'm trying to make something like this work;
Code: [Select]
<block tag="CreateLocalVar" spec="Create Local variable %0 of type %1" code="var ~:~;" type="action" color="gray" returns="void">
<fields>
<code order="0"></code>
<code order="1"></code>
</fields>
</block>

and currently it can't;  'text' puts quotes around it which makes the output;
Code: [Select]
var "%0":"%1";which of course doesn't parse!

Edited to make it more clear I'm talking about extensions.

7
Resolved Questions / Re: Drawing Order [Answered]
« on: October 26, 2012, 08:36:17 pm »
Semi-related so adding here instead of making a new thread;
  Draw image for [actor] also currently does not apply effects on the actor to the drawn image (which makes the main method I use for rendering shadows completely ineffective)

It also makes 'pseudo-3d' rendering with effected actors (that is to say, actors that are 'affected' with an 'effect')

EDIT:  Test game attached - drag the circle on the left to the circle on the right - the moved circle will change colour and render itself onto the other circle, but the drawn image will not change colour.

ALSO - The 'drawn' actor had 'set opacity to 50%' before it - which used to apply to apply when using draw image for [actor] but does not in 3.0 yet.

This is the beginning of a new project I'm working on and I just switched to 3.0 after finishing my last one on 2.x so publishing a test game of what I already had was easy.

8
Ask a Question / Re: Best way to approach A* Pathfinding?
« on: August 29, 2012, 11:33:21 am »
Thanks cole.  I was just about to start implementing something like this and this saves me a lot of time.

9
Ask a Question / Re: Why doesn't my hue changer doesn't work?
« on: August 29, 2012, 11:30:49 am »
When [Actor] is [created] looks for any actor being created, not the actor that the behaviour is attached to, so this will trigger every time any other actor appears.

For optimization - try removing all of the 'if [chamelion degree] = ' to 'OTHERWISE IF [chameleon degree]' - this way it will stop checking once it finds the right one.

I was goin to say to clear effects, but you caught that in your second post.

the only other thing I see that's 'wrong' is that your line where you say 'set chameleon degree to larger of...'  Currently the largest 'sub' will always be the one that is chameleon degree.  If sub 1 is 100 and the rest are all at 10 (for example) Chameleon degree will be '100' even if you change one of the othres to be 11.

Currently, if there is a tie - it will add the degrees together.  So lets say that sub 0 and sub 1 are both 100.  Currently your script is going 'oh chameleo degree is 100 and sub 0 is 100, so lets add change degree by 180 as an effect.  Okay... now 100 is equal to sub 1, which is also 100, so lets add test degree+30, or 210 to the degree.  Well, that's 390... and it's degrees so that wraps to 30...) Now that example will give you a result you expected, but if we use sub 2 and sub 1 instead, you get 90 instead of either 30 OR 60.

Not sure why you are having saturation issues - might be a problem with stacking effects.

10
Ask a Question / Re: how to work code mode
« on: August 29, 2012, 11:20:03 am »
Code mode lets you use code for whatever platform you are programming in (example:  Actionscript 3 for Flash)

What you have there looks like a block example, so you would use regular design mode.

'Create' block is under 'Scene'  and 'Kill' I believe is under 'Properties'.

11
I don't know if those collision blocks work outside of collision events.

What I would try in this scenario is go into 'Scene' block, and there is a basic actor block (it will be a magenta block that defaults to [self])  Take that out and stick it in where it says actor 1.  If it won't stick, take out the boolean <the bottom of [actor] [wasn't hit> and try to stick it in and stick it back in the boolean.

actor 1 and actor 2 are handles that are used in the collision detection blocks.

12
Oh, right.  You want to change the target location by [negate[half-width]], [negate[half-height]].  I misspoke when I said 'move them'.  The part where you use the mouse position in the formula - that's where you need to do the adjusment.

The 'point' the actor is at is always the top-right hand side of their sprite, which is not what you want in this case, so by moving it 1/2 it's height up and 1/2 it's width to the left, it will appear as though the centre is being aimed in the direction you fire.

13
Ask a Question / Re: Limited moves per scene
« on: August 14, 2012, 05:56:22 pm »
Okay, now for the actual block/script changes.

Disable.png shows the changes you need to make to the 'Update' script for the 'Switch Scene Button'.  This should go right after the 'do only on iOS' block.

Then, in each of the four 'On Actor' buttons, that have an icon that looks like a mouse - you need to put that stuff in 'if not <disabled>' blocks.  This will prevent the mouse from affecting your button at ALL if it is disabled.

Once you have done all that.;
  1) Add a bunch of them to your level select screen (I used 4 for testing).  C
  2) Click on each one and go into the inspector. 
  3) Click customize.
  4)  Under the 'Switch Scene button' change the 'Level Required' and the 'Scene' for each one.
     4a)  The 'Level Required' should be '0' for level 1, '1' for level 2.. and so on.
     4b)  Your scene should be the right scene for each level ;)


Finally, a screenshot showing that is correctly disables them.


EDIT:  This is pretty solid, actually.  If it weren't for the fact that it uses a Game Attribute, this would be good for the Forge.


14
Ask a Question / Re: Limited moves per scene
« on: August 14, 2012, 05:16:25 pm »
Okay.  Try changing 0.1 seconds to 0.02 seconds, but also divide the amount you move the actor by by 5.  This should smooth it out a little instead of being so choppy.

See what happens if you turn the boolean to FALSE after every time this happens (in the 'every x seconds' event).  I'm wondering if it 're-collides' and might produce the effect you are looking for.  (if it stops working when you do that, then remove it :D)



For #2
  1 - Go to 'settings' and create a 'Game Attribute' that is a number.  'Highest Level beaten'.  (Game attributes save when you use the same-game features, so this is why you want one of these instead of a Scene Attribute)
  2;
    2a - when you beat a level, use the 'Set Highest Level beaten to []' block in Attributes -> Game   
    2b - You want to use the block inside 'Numbers and Text -> Math'.  There's one there that says 'smaller of [] and []' drag that out.
    2c - Click on 'smaller' and a pop up will appear.  Change it to 'larger'
    2d - put 'Highest Level beaten' on one side and the current level on the other (you never want the player to lose progress if they play an old level, this makes sure they always get credit for the latest level :).
3 - create an actor.  For now, make this a simple square with different colours.  You can make it all fancy later.  You want the following animations;
  Normal - what the button looks like when it's on the screen (make this yellow)
  Pressed - what the button looks like when it's pressed (make this green)
  Hover - what the button looks like when it's pressed (make this blue)
  Disabled - what the button looks like when you have not yet beaten the right level (make this grey)
4)  Go to the 'Behaviours' button for the actor.  Click 'Add a Behaviour'.  Under 'FROM YOUR LIBRARY' select Game.  You should see one called 'Switch Scene Button' - you want that add it.
5)  Click 'Edit Behaviour on the top Right.
6)  You want to add 3 attributes to this behaviour;
    An Animation Type attribute named 'Disabled Animation'     NOT HIDDEN
    A 'Number' animation called 'Required Level'       NOT HIDDEN
    A 'Boolean' attribute called 'Disabled'       HIDDEN
7)  Go back to your actor behaviours and set the 4 animations to the right ones (if you only see 3 you did something wrong - maybe you hid the 'Disabled Animation' attribute or forgot to make it an animation).  Don't change anything else here - just the animations (for now)

... I think I have to do pictures for the next few steps - trying explain it  and draw it out would look a little confusing.  That should keep you busy for a bit anyways.


EDIT just followed my own instructions because I wanted to test it, so here's what the behaviour on the button you made should look like when you are done.

15
that's pretty good.  Not the way I would have done it, but it works great (and I wasn't sure about the way I thought of to try it - it might not have worked.)

I would actually have it so the smaller dinos turn quicker, so maybe make a 'turn time' attribute.  I would test out 0.5 secs for the small one and 1 second for the large one and see how that looks.

Only problem is... the dinos actually walk right off the screen (and I think thereby the platform and they fall?) regardless they don't come back.  Lowering the numbers might help  (If you play this and just stand there you'll see it)

I don't know if you've tested the shooting thing I mentioned at all - still quite wonky.

Pages: 1 2 3 ... 14