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

Pages: 1 2 3 4 5 ... 17
31
Chit-Chat / Re: Help Needed
« on: November 05, 2012, 04:30:47 am »
Click any block in the pallette (on the right side of the stencyl screen) with right mouse button and choose "view help". It will show you a help page for this block (at least in most cases).

You should also read the hole stencylpedia (not just the crash course) or at least first 2 chapters (getting started and logic) and then everything else as needed.

I also recommend TD tutorial.

http://blog.publysher.nl/2012/04/tutorial-creating-tower-defense-game-in.html

As far as I know it's not finished, but even first few chapters will help you understand how everything works. That's how I started in Stencyl.

32
Ask a Question / Re: Spawning Question
« on: November 05, 2012, 02:01:49 am »
Have you tried making a list of actor types, then generate actor of a type you get from the list?

It should work.

If that wasn't clear, I mean code similar to this:

Code: [Select]
when the scene is created
  set ActorType to actor1
  add ActorType to List
  set ActorType to actor2
  add ActorType to List
  etc. for all actor types

when you want to create those actors
  create [get item [random number from 0 to whatever] from List] at x, y

I made a quick test and it works.  Funny I didn't think of this solution when I actually needed it.

33
Resolved Questions / Re: Double jumping
« on: November 03, 2012, 01:17:35 pm »
I don't see any reason why this would change anything. All code inside that if block will be executed, order in this case is not important, because the game will not check again if "can jump" is true in this update tick.

I'm not sure what's wrong here. My guess would be that the collision event happens after the player started jumping, before the actor actually moved from the ground (in the same update tick). You may need a different way to check if player is touching ground.

I also don't understand why you used 2 booleans to remember the same thing (can jump and jumped), unless you plan to use it in the future.

35
I don't see anything wrong. What is the code inside the events you are triggering? Maybe there is something wrong in there.

I have to add that I don't have any experience with iOS, so I'm sorry if solution I proposed for some reason is just not working correctly there. Maybe someone with more experience can write something more about it.


Did you try deactivating part of the code and try it with only one timer? Just to see, maybe that's only part of your code that is slowing things down.

Also, you could try using "trigger event in behavior _thisbehavior for this scene" instead triggering event in all behaviors. Stencylpedia says it could have small effect on performance.

36
Ask a Question / Re: slow motiion
« on: November 02, 2012, 02:40:28 pm »
It could be done using the current pausing system, right? I'm thinking of pausing the game every other frame (or at any other ratio). Obviously this would mean no normal pausing in game (unless you can switch "can be paused" for actor during runtime).

37
How exactly did you implement? I think it is unlikely that the code I proposed would slow down the game in any way, because it's really simple math.

Do you use "random number" block in every update frame? Maybe that could be the reason for slowing down. You need to determine random number only when the timer starts, not every frame.

So, in my example that would be something like that:

Code: [Select]
when created
set customtimer to 0
set randomnumber to [random number between 200 and 400]

when updated
if game is not paused
  if customtimer >= randomnumber
    create recycled actor
    set customtimer to 0
    set randomnumber to [random number between 200 and 400]
  otherwise
    increment customtimer by 1

and it should not be something like that:
Code: [Select]
when created
set customtimer to 0

when updated
if game is not paused
  if customtimer >= [random number between 200 and 400]
    create recycled actor
    set customtimer to 0
  otherwise
    increment customtimer by 1

Though even then it shouldn't really slow down...

It may be something different. Did you check console for errors (when testing the game, press key ~, it's under escape)? Or maybe something doesn't work like it should and for example it creates too many actors.




As for your question - it may be possible by coding, but I don't know how.

38
You can use "anything as animation" block (put it inside switch animation block) to write animation name. It accepts stencyl name of the actor animation (the actor has to have this animation attached). Originally, "switch animation" block only accepts an animation attribute, that's why you need to use "anything as animation" - to convert text to animation attribute.

39
The problem with the set attribute block is that you wrote "filename", while it should be something like _filename. Best click on the small arrow to the right of that field and choose the correct attribute from the list (last position on the first menu, then choose behaviour name, then choose the filename attribute from that behaviour, this way stencyl will write correct attribute real name and behaviour name in this block).

The second method doesn't work, because as Hectate wrote, attribute is not the same as actor value and while you set the actor value, you don't draw text from the actor value, but from the attribute.

40
You could something I suggested in this thread (currently the last post):

http://community.stencyl.com/index.php/topic,15690.0.html

The custom timer created this way will be stopped when the game is paused.

41
@thebloke65: how does that make any difference?

I don't know anyone who watched Star Wars the first time when he/she was adult and liked it (as much as those who watched it the first time as kids do). There is a reason to that.

As far as I know, kids liked the new trilogy in the same way kids liked the original trilogy. It's just that those other kids are now usually much older.

42
I hate to tell you that, but original saga was also kid-orientated.

43
Ask a Question / Re: Pausing Events for Scenes
« on: October 30, 2012, 04:24:54 am »
When created event will only check if the game is paused at creation - it won't have any effect (AFAIK game is always unpaused on scene behaviour creation).

Moreover, you need to make a custom timer, as far as I know there is no way to stop normal timers (without using custom code).

So, what I would do:
Code: [Select]
when created
set customtimer to 0

when updated
if game is not paused
  if customtimer >= 300
    create recycled actor
    set customtimer to 0
  otherwise
    increment customtimer by 1

This way customtimer will get to 300 every 3 seconds of unpaused game (when update runs 100 times per second), it won't "run" when the game is paused and the actors won't be created then.

44
Sentenza, your code won't work as needed. It will be executed 100 times per second, every time it will start new timer for random number of seconds, after which it will create actor. So after few seconds there would be hundreds of actors.

Anyway, that's exactly what OP tried.

Rob1221 posted solution to this problem.

45
Chit-Chat / Re: Best Practice: Events vs Behaviors
« on: October 29, 2012, 02:50:30 am »
I also haven't been using events, only to test how they work. It seems that event is technically an automatically created behaviour (with name like "ActorEvents_38"), so you can acces attributes via set/get block in behaviour>attributes. So - while it is possible to access event's attributes from another behaviour, it's a mess.

Pages: 1 2 3 4 5 ... 17