Forum
Questions, builds, help and the odd argument. The mods and guides are out front.
I clicked Valo City and then Take it in maps section and this pop up on the desktop
I don't remember exactly, but i think GameType refers to maps/garages/menu/ect. It could be addon fault or you replaced some game core scripts. Still it's too little information to tell you exactly, unless someone had the same crash.
So I'm attempting to add bot to my "CCgarage" track, but when clicking TAKE IT in game it crashes & there's only this in error log. I tried fixing it myself but failed, there are lines mentioned which I even don't have...
pre
sl/Scripts/game/bot.java function createCar ? i'm sure you have it. if you could post your garage code, maybe i could fix it.
Spoiler: pre
do you have the nonus installed in your game?
Of course
Ok, i think i found it. In your code the variable "map" type is GroundRef, the createCar function requires that the map would be GameRef type. Try to change GroundRef to GameRef at line 31
It had same problem without the int defaultCar = cars.racers.Nonus:0x0006r; line
Added 58 seconds later:
# mindeliszz :
Ok, i think i found it. In your code the variable "map" type is GroundRef, the createCar function requires that the map would be GameRef type. Try to change GroundRef to GameRef at line 31
ok a sec I'll try
it's not the car problem. Anyway if changing GroundRef to GameRef doesn't work, then create new GameRef type variable.
Added 1 minute later:
Spoiler:
package java.game;
import java.io.*;
import java.util.*;
import java.util.resource.*;
import java.game.*;
import java.render.*; //Text
import java.render.osd.*; //Text
import java.sound.*;
import java.render.osd.dialog.*; //Dialog Window
import java.game.parts.*;
import java.game.parts.enginepart.*;
public class CCGarage extends Track
{
final static String MapName = "CC - Garage";
final static String MapDescription = "Indoors garage meant for screenshots \n and other fun";
final static String MapAuthor = "Author: Coprone";
final static ResourceRef MapImage = new ResourceRef(Maps.Addon_Maps.CCGarage:0x0005r); // Image for track selector
final static float TS_Version = 1.0; // Do not change it!
int defaultCar = cars.racers.Nonus:0x0006r; // Default car for opponents if no custom cars found
Bot raceBot1;
Vector3 raceBot1_posStart;
Ypr raceBot1_oriStart;
public CCGarage()
{
posStart = new Vector3( -0.220, -1.076, -1.110 ); // Start car position
oriStart = new Ypr( 1.600, 0.000, 0.000 ); // Start car rotation
map = new GroundRef( Maps.Addon_Maps.CCGarage:0x00000001r );
gr = new GameRef( Maps.Addon_Maps.CCGarage:0x00000001r );
//nav = new Navigator( -5.317-2.64, -15.996, 2.64, maps.test_track.smallmap:0x00000001r, maps.test_track.smallmap:0x00000002r, maps.test_track.smallmap:0x00000005r, 6, 8, 10 ); // GPS map
//}
raceBot1 = new Bot( Math.random()*59, 3, 1, 2.0, 2.0, 20.0);
raceBot1.driverID = null;
raceBot1.createCar( gr, GameLogic.carSaveDir + "CCgarage" );
raceBot1.car.wakeUp();
raceBot1.brain.queueEvent( null, EVENT_COMMAND, "AI_params 90.0 90.35" ); // make it faster
raceBot1.car.setMatrix(new Vector3( 0.197, -0.721, 6.368 ), new Ypr (1.605, -0.161, -0.007));
}
public void StartMap()
{ // Track selector run this function when you click "TAKE IT"
GameLogic.changeActiveSection( new CCGarage() );
}
public void enter( GameState prev_state )
{
Frontend.loadingScreen.show();
GfxEngine.flush();
map.setWater( -100, 300.0, 50.0 ); // set water 100 meters under world orgin
super.enter( prev_state );
}
public void exit( GameState next_state )
{
super.exit( next_state );
}
}
will check everything in a bit, i'm testing some stuff atm so i didnt pay much attention to it
Well now there's in the error log
Spoiler:
!Cannot parse "gr" in file "java.game.CCGarage" at line 32
!Unknown field name "gr" in file "java.game.CCGarage" at line 32
!Cannot parse "gr" in file "java.game.CCGarage" at line 37
!Unknown field name "gr" in file "java.game.CCGarage" at line 37
!Script error
Thread: THRD-RUNVMI Dummy.handleEvent
Error: parse error (2)
java.game.CCGarage:<init> (line:32)
java.game.CCGarage:StartMap (line:44)
java.game.TrackSelect:osdCommand (line:237)
java.render.osd.Gadget:sendMessage (line:211)
java.render.osd.Button:click (line:31)
java.render.Group:handleEvent (line:178)
ok ok, try this:
Spoiler:
package java.game;
import java.io.*;
import java.util.*;
import java.util.resource.*;
import java.game.*;
import java.render.*; //Text
import java.render.osd.*; //Text
import java.sound.*;
import java.render.osd.dialog.*; //Dialog Window
import java.game.parts.*;
import java.game.parts.enginepart.*;
public class CCGarage extends Track
{
final static String MapName = "CC - Garage";
final static String MapDescription = "Indoors garage meant for screenshots \n and other fun";
final static String MapAuthor = "Author: Coprone";
final static ResourceRef MapImage = new ResourceRef(Maps.Addon_Maps.CCGarage:0x0005r); // Image for track selector
final static float TS_Version = 1.0; // Do not change it!
int defaultCar = cars.racers.Nonus:0x0006r; // Default car for opponents if no custom cars found
Bot raceBot1;
Vector3 raceBot1_posStart;
Ypr raceBot1_oriStart;
GameRef map;
public CCGarage()
{
posStart = new Vector3( -0.220, -1.076, -1.110 ); // Start car position
oriStart = new Ypr( 1.600, 0.000, 0.000 ); // Start car rotation
map = new GroundRef( Maps.Addon_Maps.CCGarage:0x00000001r );
//nav = new Navigator( -5.317-2.64, -15.996, 2.64, maps.test_track.smallmap:0x00000001r, maps.test_track.smallmap:0x00000002r, maps.test_track.smallmap:0x00000005r, 6, 8, 10 ); // GPS map
//}
raceBot1 = new Bot( Math.random()*59, 3, 1, 2.0, 2.0, 20.0);
raceBot1.driverID = null;
raceBot1.createCar( map, GameLogic.carSaveDir + "CCgarage" );
raceBot1.car.wakeUp();
raceBot1.brain.queueEvent( null, EVENT_COMMAND, "AI_params 90.0 90.35" ); // make it faster
raceBot1.car.setMatrix(new Vector3( 0.197, -0.721, 6.368 ), new Ypr (1.605, -0.161, -0.007));
}
public void StartMap()
{ // Track selector run this function when you click "TAKE IT"
GameLogic.changeActiveSection( new CCGarage() );
}
public void enter( GameState prev_state )
{
Frontend.loadingScreen.show();
GfxEngine.flush();
map.setWater( -100, 300.0, 50.0 ); // set water 100 meters under world orgin
super.enter( prev_state );
}
public void exit( GameState next_state )
{
super.exit( next_state );
}
}
Well, that fixed the biggest problem, but now I only got error, which I don't know any about
!member redefinition (map) at class java.game.CCGarage
!member redefinition (map) at class java.game.CCGarage
i'll leave this to the boss then 😃