I Need help with Ladders - Please. ( Stencyl 3.3.2 )

TanyaBanana

  • Posts: 7
I am stuck. Can someone please help me.

I want to create a ladder in a platform game.  -  I am trying to use this...

http://www.stencyl.com/game/play/24823
" the Climb Behavior posted on StencylForge "

But I am getting this error...   ( I think this code is for an older version of Stencyl. ?? )
and Yes - I have created a 'region called ladder' - but I stll get this error...

ClimbLadder: scripts.Design_244_244_ClimbLadder has no field engine
   from scripts.Design_244_244_ClimbLadder
   line: 179
   columns: 4-23
ClimbLadder: scripts.Design_244_244_ClimbLadder has no field engine
   from scripts.Design_244_244_ClimbLadder
   line: 180
   columns: 11-30
ClimbLadder: You can't iterate on a Dynamic value, please specify Iterator or Iterable
   from scripts.Design_244_244_ClimbLadder
   line: 180
   columns: 11-30



TanyaBanana

  • Posts: 7
I think this is the problem...

(hammer) Created:
( Code: )
_RegionList=new Array<Dynamic>();
_RegionState=new Array<Dynamic>();

I only have one region called " Ladder " - can anyone suggest how to fix?   

( Thanks in Advance... )

ajimundi

  • *
  • Posts: 230
Simply insert your region into the region list.
::: It's never too late, unless you're dead. Maybe not even then. :::

TanyaBanana

  • Posts: 7
Thank you for your quick reply.   I will try that now.    :)

TanyaBanana

  • Posts: 7
Thanks !!     that has solved half of my problem... 

Now the error reads...

ClimbLadder: Unexpected !
   from scripts.Design_244_244_ClimbLadder
   line: 211
   columns: 26-27

I guess this is "_RegionState "   Any more idea's ?

« Last Edit: August 09, 2015, 03:48:46 am by TanyaBanana »

ajimundi

  • *
  • Posts: 230
Can't say without looking into the behaviour itself. Maybe later, when I can be online with my computer.
::: It's never too late, unless you're dead. Maybe not even then. :::

mdotedot

  • Posts: 1654
Hello TanyaBanana,

The behavior was made for earlier version of Stencyl.


In Update / Always code
where it says ‘this'
replace with:
Engine
So that it reads:
Code: [Select]
Engine.engine.regions

Also name all your regions 'Ladder' i.e. 'ladder1', 'ladder2' etc..

Hope that helps!

Best regards from
M.E.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

MMMhasseb

  • Posts: 15
First it's in the "created" tab where you should replace "this" with "engine"
but after I fixed it I got this error with both the up_pressed and created tab in red
The error is:
ClimbLadder: Cannot access static field engine from a class instance
   from scripts.Design_272_272_ClimbLadder
   line: 179
   columns: 4-25

TanyaBanana

  • Posts: 7
Hello mdotedot,

Thanks for your help, I did the changes, 'Created' tab, and I also get the same error as MMMhasseb

Please help, again - Thanks.

mdotedot

  • Posts: 1654
Hello TanyaBanana,

It is indeed the 'Created' event but I only needed to change the 'this' into Engine:
Code: [Select]
// if you don't make a new instance you can't push ..
_RegionList=new Array<Dynamic>();
_RegionState=new Array<Dynamic>();

 if(Engine.engine.regions != null){
  for(r in Engine.engine.regions){
// if name index Of ladder
if(r.name.toUpperCase().indexOf("LADDER") > -1){
          _RegionList.push(r);
          _RegionState.push(""+false);
}
  }
 }

No other change was needed.

Tested on build: 8471

Best regards from
M.E.

« Last Edit: August 10, 2015, 12:29:57 am by mdotedot »
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

TanyaBanana

  • Posts: 7
Thanks Again, I will try that now.

I'm using Mac Version, Build 8453...

TanyaBanana

  • Posts: 7
It Works !! - it WORKS !!!  - So HAPPY !  Thank YOU!!

MMMhasseb

  • Posts: 15
I removed the behavior and re-downloaded it.
I have a region called Ladder
I replaced this by engine (I copied mdotedot's )code but I got this error now:
ClimbLadder: Unexpected /
   from scripts.Design_271_271_ClimbLadder
   line: 175
   columns: 8-9 

Edit: It Worked!!  Thanks a lot

« Last Edit: August 10, 2015, 12:45:16 am by MMMhasseb »

mdotedot

  • Posts: 1654
Double check if you have indeed the double // on the first line.
It is a comment and you need // for it to work!
(I edited my reply so that it has two /)

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.