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

Pages: 1 2 3
1
Ahh, thankyou both.

"Safe" sounds good, considering the trouble I've had
getting my head around the Stencyl way of doing things. :)

2
THANKS Alexin - you rock.   :)

3
Sorry Alexin, you've got me on the right track I'm sure...
but I'm still not understanding something.

Let's say we're inside the behaviour for Actor "FRED" and I want to know if he has collided with actor "WILMA"....
...but not any other actor.

How would I do that?   thanks  8)

4
Kill it immediately with the "kill" block, as soon as it collides with the specified actor. There should be no delay at all.

Sorry to be dopey, but can you test to see if something collides with an individual actor 'X' in particular?
If so - could you please include a screenshot with the relevant blocks?

Or -can you only test to see if something collides with 'collision group Y'?
thanks.

5
Hmm.

Did what Alexin suggested, but the cursor still does not appear 'mid screen' until I drag it onto the screen from 'outside' the window.

Behaviour attached.

6
The only thing I can think of is... are those numbers actually the middle of the screen?

Actually Hectate, I just noticed a post from Alexin (earlier up this page) which seems to solve the problem.

He pointed out...

The behavior for the cursor (Point And Click 1) won't work as you expect.

In that behavior, you're setting the actor's location, which is defined in scene space, with the mouse location, defined in screen space. This means you have to convert the mouse X and Y to scene space. You do it by adding the camera's X and Y, respectively (Scene > View).

Now that sounds deadset confusing to me, but I'll give it a go tonight,
and see if I can get it to work.

So yes, a late 'thanks!' to Alexin - I'd missed your post earlier.  :)

7
OK, I'm continuing on my 'Point and Click movement' journey...

I have a cursor object, called 'Star Cursor'.
It has a behaviour, called 'Star cursor movement'.

I've been able to move it with the mouse, and hide the mouse cursor.
BUT
I am building a tutorial.
And this requires the star cursor to automatically appear in the middle of the screen, and THEN the player moves it.

But do you think I could get it to work?   :-[

Originally, it wouldn't appear unless I moved the mouse cursor 'onto' the windowed area.
So - I coded what you see in the attachment.

And - it still won't work. 
The star cursor STILL doesn't appear on the screen, until I move the mouse so that it's "within" the flash window. 
Surely, setting the Star Cursor's X and Y to 'middle of screen' is enough?

Any ideas, oh Stencyl gurus?

8
When you drop a block into SW, it pretty much just inserts a line of code into a file. If you click on the "Preview Code" button at the top of the screen in design mode, you can see the actual code your behavior will use.

Yes, I'd seen that, thanks.

By the way - is there a way to make your code block 'smaller'?
They're pretty massive if you've only got a line or 2 of code in there.
I'm also a bit confused with what you use the *tiny* code block for?  (The one with space for just a few characters?)

Also - is there a way to tell Stencyl you want the current 'design mode window' to be much 'longer'?
(ie with room for lots of programming blocks, scrolling down?)

At the moment I "drag a block to the bottom, use the arrow button to scroll down a bit, then REPEAT" over and over,
but surely there's a proper way to make a bigger/longer programming 'canvas'?

9
Really?  That works?

I assumed each code block would need to be 'correct by itself'.
...but obviously that's not the case.

Hmm, Stencyl is full of surprises  :-)

Thanks Gigaclon  :-)

10
AS3 supports switch, so StencylWorks does as well. There are no blocks for it, but you could use a code block to add it in code, pretty much exactly as you have it above.

That's GREAT!  Thanks  8)

With clever use of multiple code blocks, you could even use regular blocks between them for the body of each case.

Erm, sorry... you've lost me there.  :-\
Are you able to put together a quick mockup/screenshot to illustrate what you mean?

11
Ask a Question / Is there a Stencyl equivalent to this Gamemaker function?
« on: September 26, 2011, 04:28:19 am »
In my Stencyl game I'm building, I'd creating a tutorial.

In the behaviour of that scene, I'll have 10 steps.
Each step will have a number of things happening, before user input leads to the next step.

Now, the only way I can see to do this in Stencyl is with an attribute eg 'StepNumber',
and then...

If StepNumber = 1 then <Do this, do that, eventually...  user input makes 'StepNumber' = 2 >
    Else if StepNumber = 2 then <Do this, do that, eventually...  user input makes 'StepNumber' = 3 >
    Else if StepNumber = 3 then <Do this, do that, eventually...  user input makes 'StepNumber' = 4 >
    Else if StepNumber = 4 then <Do this, do that, eventually...  user input makes 'StepNumber' = 5 >
   etc etc


..but that seems a bit ugly.

Now, in Gamemaker there's a function called 'switch/case' which works as follows:

==========================================
switch (StepNumber)
   
{
      case 0:
   
         {
            StepNumber=1;
            Do something here
            Do something else here
         }
   
      break;
   
      case 1:
   
         {
            StepNumber=2;
            Do something here
         }
               break;

etc etc

}
==========================================


..is there an equivalent in Stencyl?

Or should I stick with my original plan?
Or - does anyone have a better suggestion?

Thanks

12
Perhaps you didn't realize that the attributes can be dropped on top of any block that uses one of those type? For an example that is relevant; anywhere that you see the words "last collided actor" or "last created actor" or "self" (in reference to an actor), you can also use any attribute of type "Actor" instead. Just pick up the actor attribute's "Getter" block and stick it on top of the part where it says "self" or "last created actor".

I absolutely did not realise that.

The question I have for the Stencyl devs is - why not?
Is this something I should have read somewhere - or is it something that I'm just supposed to 'fluke upon'?  Could be my fault, or the documentation.  Don't know.

Anyway, back to you Hectate....

Please, tell me if I've got this right?

I go into attributes, and create an attribute called "Oliver" and one called "Target".
Then, in a single behaviour I can drag the 'setter' called Oliver into a statement
and it will do that 'thing' to 'Oliver'.
And then in the next line, I could do drag the setter called 'Target' into a line,
and do another 'thing' to the actor called 'Target'.   And the same again, within a single behaviour, with any number of other actors?

Yes?

By the way, is there anyway to share a project with 1 person rather than 'upload for all'?
It would be nice to do the former (to correct little mistakes), rather than subject an early buggy mess to 'everyone'
and just clog up Forge with things that aren't of interest to 99.99999% of users.

Oh, and as always, I'm not expecting for you to 'instantly' solve my problems.
No apologies needed at any time.  :)

13
I'm not sure why you'd want to use 2 or 3 different behaviors to handle this movement, you should be able to do it all in one actor behavior like I "coded" out in the previous post.

Umm, I thought that each of the 3 actors should have their own behaviour?
Also - I don't understand how (in behaviour for actor X) to specifically do all the things to actors Y and Z.

As far as it not killing the target, there must be something about your IF statement that causes it to never be true, thus it never gets killed.

Well here's the code - there's only 2 lines - hope you can see what it is.

That said, the single-behavior method I recommended wouldn't kill it and re-create it every time, just enable/disable movement toward it and change it's animation to an invisible one when you're not moving toward it.

As explained earlier, I don't get how to 'do things' to actor Y and Z within the code for actor X.
If you're able to have a look at the 3 links in my post above, and show how to make it work in 1 actor's code, that would be great.

14
OK, some more progress...

1. Pointing and clicking to 'drop a target' now works.
2. The character then moves towards the target
BUT AS OF TONIGHT...  ( :) )
3. The player stops when his feet hit the target. (I put a circle-shaped sensor around his feet)
Hooray!
4. BUT.... the target doesn't disappear :(, despite this code.
(Hmm, something's wrong.)

Here are the other 2 behaviours in the scene:
One for the cursor.   One for the player's character, called Oliver.

Any suggestions?

15
I'll post a bit more later tonight, but the short version is:

1. Pointing and clicking to 'drop a target' now works.
2. The character then moves towards the target
3. BUT the target doesn't die when touched by the character. (I thought I told it to)
4. BUT the character doesn't stop moving when it touches the target. (I thought I told it to)
5. Instead, the target bounces away (like a pool ball being hit by the white)
    And the character 'spins' off on a tangent, as if the top of it hit the target and 'spun' it.

Pages: 1 2 3