Winner Not selected properly. (Car race game) [TIS]

Hiarun2004

  • Posts: 14
Oops there is another problem, so basicly, only the first player gets set to winner, even if the 2nd player wins, same thing for  career mode, only the player can win and the AI Car doesnt get set to  winner game attribute.

stefan

  • *
  • Posts: 2263
You are typing "the actor" in the winner game attribute, instead of using the correct block. Double check that you did everything like the videos because you have been missing some crucial steps

Hiarun2004

  • Posts: 14
Can you jaut tell me which is the right block

stefan

  • *
  • Posts: 2263
The same as the actor value blocks use

Hiarun2004

  • Posts: 14
But that doesn't work. I can't seem to drag it in there.  Should I create a new attribute of type actor and use ir.?

Hiarun2004

  • Posts: 14
I did it, but it doesn't work. I'll watch the video in the evening and make the changes.

stefan

  • *
  • Posts: 2263
Show a screenshot of the winner scene behavior

Hiarun2004

  • Posts: 14
Well insted of printing the winner attribute, i was printing player one attribute but ever since i changed the Game Attribute to Winner, This shows up.

"TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2150]
   at com.stencyl::Engine/getRecycledActorOfType()[C:/Program Files/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2143]
   at com.stencyl.behavior::Script$/createRecycledActor()[C:/Program Files/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1763]
   at scripts::Design_27_27_WinnerBehav/init()[Source/scripts/Design_27_27_WinnerBehav.hx:107]
   at com.stencyl.behavior::Behavior/initScript()[C:/Program Files/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Behavior.hx:97]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:/Program Files/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/BehaviorManager.hx:105]
   at com.stencyl::Engine$/initBehaviors()[C:/Program Files/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:1113]
   at com.stencyl::Engine/loadScene()[C:/Program Files/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:984]
   at com.stencyl::Engine/enterScene()[C:/Program Files/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:1777]
   at com.stencyl::Engine/onUpdate()[C:/Program Files/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2591]
"

So I dont know what to do.

stefan

  • *
  • Posts: 2263
In your race manager behavior. Change the Winner game attribute to (type of [the actor]). Your winner behavior expects an actor type (the names of the cars itself), but if you set winner to [the actor], it will be something like carBlack01, which isnt the correct name of that actor type

Hiarun2004

  • Posts: 14
Hmm.... But I can't seem to put  any actor value in the  winner game attribute.... What can I do

stefan

  • *
  • Posts: 2263
Put it in as text