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

Pages: 1 ... 15 16 17 18
241
Ask a Question / Re: Crash on AI death
« on: July 24, 2011, 01:33:01 am »
Still getting the same crash error, though I put the enemy's behavior into an [if <[self] is alive] conditional

Edit: ok now I see, the if statement has to go inside the loop. got it working now.

242
Ask a Question / Crash on AI death
« on: July 23, 2011, 07:12:47 pm »
Tried to make the enemy die when it collides with a weapon, coded:

when this collides with something else
[if <[group of [last collided actor]] = Weapon>
  Kill [self]

But when it collides with the weapon the game crashes and gives me this:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at stencyl.api.engine.actor::Actor/getX()[/Users/jon/Desktop/stencyl/plaf/flash/root/stencyl/api/engine/actor/Actor.as:1243]
   at Function/<anonymous>()[C:\Users\Galdon\Documents\StencylWorks\sandbox\flash\scripts\Design_37_37_directionfaced.as:61]
   at stencyl.api.engine::TimedTask/update()[/Users/jon/Desktop/stencyl/plaf/flash/root/stencyl/api/engine/TimedTask.as:37]
   at stencyl.api.engine::GameState/innerUpdate()[/Users/jon/Desktop/stencyl/plaf/flash/root/stencyl/api/engine/GameState.as:1397]
   at stencyl.api.engine::GameState/postUpdate()[/Users/jon/Desktop/stencyl/plaf/flash/root/stencyl/api/engine/GameState.as:1331]
   at stencyl.api.engine::GameState/update()[/Users/jon/Desktop/stencyl/plaf/flash/root/stencyl/api/engine/GameState.as:1313]
   at org.flixel::FlxGame/update()[/Users/jon/Desktop/stencyl/plaf/flash/flixel/org/flixel/FlxGame.as:355]

Edit: if it is important, the weapon spawns a certain number of pixels infront of the character when the attack button is pressed. i tried removing the collision code and it still kills the enemy then crashes the game

243
Ask a Question / Re: Different action for different collision groups?
« on: July 23, 2011, 06:21:17 pm »
I double checked things after you said what I had should work for errors; I appear to have forgotten to set the actor to the enemy type. It's working now. ^_^; thanks

244
Ask a Question / Different action for different collision groups?
« on: July 23, 2011, 05:52:43 pm »
Not finding any blocks under the collision category for this, and the stencylpedia vaguely hints at it in the opening tutorial but doesn't actually have a section on this. What I am trying to do now, is make it so an actor upon a collision will check the collision type then respond differently for each type.

For example, if it's an item, do nothing since the item has it's own pickup and remove code already, if it is an enemy, take damage.

I tried <if [group of [last collided actor] = [Enemy]> but that didn't do anything, and i can't seem to find any other blocks that look like they would work better. Also, sorry if I'm doing too much question asking so rapidly, trying to make a full game and keep running into spots that are stumping me ><

245
Ask a Question / Re: What have I got wrong with this patrol code?
« on: July 23, 2011, 05:22:31 pm »
Ahh, ok. I was under the impression the always wrapper was basically the main loop. It's working now that I moved it. Thanks.

246
Ask a Question / Re: creating variables?
« on: July 23, 2011, 04:54:48 pm »
Finally got it working, not sure what i was doing wrong the first time but it's working now, thanks for the assistance :)

247
Ask a Question / What have I got wrong with this patrol code?
« on: July 23, 2011, 04:46:35 pm »
I tried to write some code to make an AI patrol a short area, then when he turns around to change animation to face the right way.



This is the code I used; however, it won't change animation until the second directional change, and each time it changes direction it doubles in speed for some reason. I have no idea why either of those are happening. o.o

248
Ask a Question / Re: creating variables?
« on: July 23, 2011, 09:02:09 am »
Given your description, it looks like you are simply adding SCORE and 100. You need to store the result back into SCORE.

Example:

[ set SCORE to [ [get SCORE] + [100] ] ]

I was using the 'set attribute to' block. I found the tutorial on the stencylpedia and erased my old code to try following it now, but the increment block looks different from what is shown there and won't let me select [score] where it now says [number] and the 'set attribute to' block won't accept [points to add] as a number when i tried doing that instead.

249
Ask a Question / Re: creating variables?
« on: July 23, 2011, 07:43:51 am »
thanks, one other question on the same topic, about Game Attributes; trying to impliment score, and I'm finding that it doesn't seem to be working as I expect; I have a behavior in an item to when touched it sets score to [[score] +[100]] and in the scene a behavior to [draw text [score] at [x number] [y number]] but when the item is picked up, it doesn't change from 0 to 100

Edit: found instructions in the stencylpedia; however the tutorial there seems to be out of date; as the increment block no longer looks like [incriment [] by []] and now looks like [[incriment/decriment] [number] by []] and I can't set number to be score like in the tutorial.

250
Ask a Question / creating variables?
« on: July 23, 2011, 05:52:26 am »
Having some more difficulties; I need to be able to tell which direction my character is facing, and the easiest way I can think of would be to make a variable that has one value when you hit the right key, and changes to another value when you hit the left key.

Unfortunately, I can't find anything at all about this in the stencylpedia, and searching through the help guide I have no idea if it's custom blocks or attributes that act as variables or how to use them, and the normal blocks don't seem to have anything that looks like they can change the value of attributes.

251
Ask a Question / Re: Jumping won't work randomly
« on: July 22, 2011, 04:46:42 am »
Thanks; hopefully this will be the last question on getting this movement to work; how does the direction function work? It seems to only function as the number 0 in code, and I don't see any options to change it's value in the code blocks. Need to be able to tell which direction my guy is facing so he swings the right way ><

252
Ask a Question / Re: Jumping won't work randomly
« on: July 21, 2011, 07:02:28 pm »
ok; that's working now, having one other problem though, I'm trying to add an animation to make the character swing their weapon, so far, I seem to get 'idle' pose for the duration of the swing instead of the swing.

My code is:

ALWAYS
If <[Attack] was [pressed]>
  Switch animation to [Attack-R] for self
  do after [1] seconds
    Switch animation to [Idle-R] for self
 

253
Ask a Question / Re: Jumping won't work randomly
« on: July 21, 2011, 05:25:04 pm »
I'm using the 'platformer movement' resource pack

254
Ask a Question / Jumping won't work randomly
« on: July 20, 2011, 08:37:01 pm »
It worked in the original tutorial; but I'm making a new game, and need to be able to jump; I downloaded the 'jumping' behavior, and assigned it to the player, picked the animations, and the button that's supposed to go with it as I did in the tutorial, yet when I go into the scene testing pressing the jump button does nothing!

Is there something else I have to do to make the jump button function?

255
Ask a Question / Re: Best way to impliment a cutscene?
« on: July 18, 2011, 05:02:46 pm »
Ahh, ok. I was searching under 'behaviors' thinking that it'd probably be a scene behavior. Thanks

Pages: 1 ... 15 16 17 18