Can someone view this VERY EASY palette blocks / code ?

Donni11

  • *
  • Posts: 2182
Hi everybody ,
I was making a game and when I use this block of code /  palette blocks I get a null error , can some please tell me what I am doing wrong ?
Peace

letmethink

  • *
  • Posts: 2547
Otherwise if false will never happen. Replace that with just otherwise.
~Letmethink

Donni11

  • *
  • Posts: 2182
Ok , I am now testing....
Peace

Donni11

  • *
  • Posts: 2182
Now I get this :
TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at MethodInfo-3929()[Source/scripts/SceneEvents_2.hx:84]
   at com.stencyl.behavior::TimedTask/update()[C:\Program Files\Stencyl\plaf\haxe\lib/stencyl/1,00/com/stencyl/behavior/TimedTask.hx:48]
   at com.stencyl::Engine/update()[C:\Program Files\Stencyl\plaf\haxe\lib/stencyl/1,00/com/stencyl/Engine.hx:2401]
   at com.stencyl::Engine/postUpdate()[C:\Program Files\Stencyl\plaf\haxe\lib/stencyl/1,00/com/stencyl/Engine.hx:2732]
   at com.stencyl::Engine/onUpdate()[C:\Program Files\Stencyl\plaf\haxe\lib/stencyl/1,00/com/stencyl/Engine.hx:2725]
Peace

letmethink

  • *
  • Posts: 2547
Is that the only scene event? You must create an actor to reference a last created actor.
~Letmethink

ETHproductions

  • *
  • Posts: 430
'Last Created Actor' will cause an error if no actors have been created at runtime, or if the last created actor has been killed. Using 'if ([Last Created Actor as text] not = null)' should solve your problem. :)
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Donni11

  • *
  • Posts: 2182
You must create an actor to reference a last created actor.
Huh ?  What do you mean ?  I have 5 scenes and 10 actors .
Peace

letmethink

  • *
  • Posts: 2547
You must create an actor to reference a last created actor.
Huh ?  What do you mean ?  I have 5 scenes and 10 actors .
Yes. But none of them are created on runtime. What are you trying to reference with 'last created actor'?
~Letmethink

Donni11

  • *
  • Posts: 2182
'Last Created Actor' will cause an error if no actors have been created at runtime, or if the last created actor has been killed. Using 'if ([Last Created Actor as text] not = null)' should solve your problem. :)
There is a block like that ?  Can you show me a picture ?
Peace

Donni11

  • *
  • Posts: 2182
You must create an actor to reference a last created actor.
Huh ?  What do you mean ?  I have 5 scenes and 10 actors .
Yes. But none of them are created on runtime. What are you trying to reference with 'last created actor'?
Um .. the last created actor in the scene .....  I don't really get what your asking .
Peace

ETHproductions

  • *
  • Posts: 430
What letmethink means is that you must create an actor in an event (such as When Created) in order for Last Created Actor to work properly. Is the actor you want created this way?

My code is a combination of blocks:
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

letmethink

  • *
  • Posts: 2547
Which actor are you creating last? What is the context?

Here is the code ETHproductions mentioned before:

ninja'd
~Letmethink

ETHproductions

  • *
  • Posts: 430
In the block pane, you can find this block under Scene > Actors > Get Actor. You can also use the search bar at the top of the pane to search for blocks.
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Donni11

  • *
  • Posts: 2182
Oh wait I found it , so I want to make it that if the actor IS alive it goes to a certain scene , this is my code so far  , any ideas ?
Peace

ETHproductions

  • *
  • Posts: 430
The code you have should do exactly what you want it to. Is it still not working?
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.