If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Proto:SpongeBob SquarePants: Revenge of the Flying Dutchman (GameCube, PlayStation 2)/Uncompiled Source Code

From The Cutting Room Floor
Jump to navigation Jump to search

This is a sub-page of Proto:SpongeBob SquarePants: Revenge of the Flying Dutchman (GameCube, PlayStation 2).

Since a majority of the prototype's python scripts are stored as plain text, there is an abundance of uncompiled code.

Chum World

We can find Chum World's scripts in DATA/CA. In the prototype, Chum World seems to be abbreviated "CA" for Carnival.

Midway Games - Hoops Minigame

The letter tile and the clown SpongeBob can talk to for the "Hoops" minigame.

The first area of Chum World is referred to as "Midway Games", and it has a couple of minigames to play. The "Hoops" Minigame when completed will award the player with the "S" letter tile.

LVL_AGENT.PY

All levels have a level-agent script that can alter the level when certain conditions are met.

    def Gather(self):
        if self.ScriptP_GatheredItem( LibPython.PythonInterpreter_Z_LookupAgent("LTILES") ):
            self.ScriptWorldVarSet(WorldVar2,3)

    def Init(self):
        if self.ScriptWorldVarComparison(WorldVar2) == 2:
            self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("LTILES"),TRUE)
        if self.ScriptWorldVarComparison(WorldVar2) <> 2:
            self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("LTILES"),FALSE)

    def RTCEnd(self):
        if self.ScriptP_RTCNumber() == 2100:
            self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("LTILES"),TRUE)

When initialized, the level-agent shows the "S" letter tile unless it has already been collected. If the player won the "hoops" game before but never collected the tile, it will be visible in this scenario as well.

CLOWN_HOOPSGAME.PY

The clown that teaches Spongebob about the "hoops" minigame plays a vital role.

    def Init(self):
        if self.ScriptWorldVarComparison(WorldVar2) == 0:
            self.ScriptSetState(S_IDLE)
            self.ScriptLocalSet(Local0,0)
        if self.ScriptWorldVarComparison(WorldVar2) > 1:
            self.ScriptSetVisible(FALSE)
        if self.ScriptWorldVarComparison(WorldVar2) == 1:
            self.ScriptSetState(S_IDLE)

When initiated, if the game has already been beaten before the clown will not appear.

    def Think(self):
        if self.ScriptDistanceToObject( LibPython.PythonInterpreter_Z_LookupNode("SPONGEBOB") ) <= 3.0:
            if self.ScriptWorldVarComparison(WorldVar2) == 0:
                if self.ScriptLocalComparison(Local0) == 0:
                    if self.ScriptLevelVarComparison(LevelVar1) < 3:
                        self.ScriptPlayVoiceOver(1900,LibPython.PythonInterpreter_Z_LookupAgent("LVL_AGENT"))
                        self.ScriptLocalSet(Local0,1)
        if self.ScriptDistanceToObject( LibPython.PythonInterpreter_Z_LookupNode("SPONGEBOB") ) <= 3.0:
            if self.ScriptWorldVarComparison(WorldVar2) == 0:
                if self.ScriptLocalComparison(Local0) == 2:
                    if self.ScriptLevelVarComparison(LevelVar1) < 3:
                        self.ScriptPlayVoiceOver(2000,LibPython.PythonInterpreter_Z_LookupAgent("LVL_AGENT"))
                        self.ScriptLocalSet(Local0,3)
        if self.ScriptDistanceToObject( LibPython.PythonInterpreter_Z_LookupNode("SPONGEBOB") ) <= 3.0:
            if self.ScriptWorldVarComparison(WorldVar2) < 2:
                if self.ScriptLevelVarComparison(LevelVar1) == 3:
                    self.ScriptWorldVarSet(WorldVar2,2)
                    self.ScriptPlayVoiceOver(2100,LibPython.PythonInterpreter_Z_LookupAgent("LVL_AGENT"))
        if self.ScriptDistanceToObject( LibPython.PythonInterpreter_Z_LookupNode("SPONGEBOB") ) > 4.5:
            if self.ScriptLocalComparison(Local0) == 1:
                self.ScriptLocalSet(Local0,2)

These dictate if the game is started or not. If SpongeBob talks to him for the first time, the clown explains the game. If SpongeBob happens to walk away and return, the clown will say, "Yeah, whaddaya want?". Finally, if you sink all three balls into the "hoops" the clown will congratulate you before showing the letter tile.

Do take note that with the nature of this game, the player cannot actually fail it. There is no dialog or condition for an event where the player fails the task.

SCRIPT_HOOPTUBE.PY

This script is duplicated three times for all three "hoops".

 def Think(self):
        if self.ScriptDistanceToObject( LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL1") ) <= 0.7:
            if self.ScriptLocalComparison(Local0) == 0:
                self.ScriptLocalSet(Local0,1)
                self.ScriptLevelVarInc(LevelVar1,1)
                self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL_PLUGGED1"),TRUE)
                self.ScriptCharSetCollideable(LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL_PLUGGED1"),TRUE)
                self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL1"),FALSE)
        if self.ScriptDistanceToObject( LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL2") ) <= 0.7:
            if self.ScriptLocalComparison(Local0) == 0:
                self.ScriptLocalSet(Local0,1)
                self.ScriptLevelVarInc(LevelVar1,1)
                self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL_PLUGGED1"),TRUE)
                self.ScriptCharSetCollideable(LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL_PLUGGED1"),TRUE)
                self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL2"),FALSE)
        if self.ScriptDistanceToObject( LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL3") ) <= 0.7:
            if self.ScriptLocalComparison(Local0) == 0:
                self.ScriptLocalSet(Local0,1)
                self.ScriptLevelVarInc(LevelVar1,1)
                self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL_PLUGGED1"),TRUE)
                self.ScriptCharSetCollideable(LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL_PLUGGED1"),TRUE)
                self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("BEACHBALL3"),FALSE)

It does the same test across all three beach balls to find any balls that come in range of the "hoop". If it finds one, it activates itself and increments a counter on the level for how many "hoops" have been scored.

Chum Putt

Chum Putt's minigame appears to be (crudely) implemented.

LVL_AGENT.PY

All levels have a level-agent script that can alter the level when certain conditions are met.

    def Init(self):
        self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("LTILEE"),FALSE)

Chum Putt will hide the "E" letter tile when it is initialized. It will be shown when the game is completed by the player.

GOLFHOLE.PY

    def Init(self):
        self.ScriptSetTargetNone(DEFAULT)
        if self.ScriptGlobalComparison(Global0) == 0:
            self.ScriptSetStateAnim(S_PLAY_ANIM,anim_misc02)
        if self.ScriptGlobalComparison(Global0) == 1:
            self.ScriptSetStateAnim(S_PLAY_ANIM,anim_misc)

    def Collide(self):
        if self.ScriptGlobalComparison(Global0) == 0:
            if self.ScriptP_Sender( LibPython.PythonInterpreter_Z_LookupAgent("GOLFBALL") ):
                if self.ScriptLocalComparison(Local0) == 0:
                    self.ScriptLocalSet(Local0,1)
                    self.ScriptLevelVarInc(LevelVar1,1)
                    self.ScriptSetStateAnim(S_PLAY_ANIM,anim_misc03)
                    if self.ScriptLevelVarComparison(LevelVar1) >= 10:
                        self.ScriptCharSetVisible(LibPython.PythonInterpreter_Z_LookupNode("LTILEE"),TRUE)
An example of a golf target that has not been touched by the golf ball yet.

The script appears to increment LevelVar0 up by 1 each time an activated "Golf Hole" is touched by the golf ball. When it reaches 10, it will make the "E" letter tile appear.

These golf targets appear to be covering over terrain painted as holes.

It appears Global0 dictates whether the game is playable or not.