Jump to content

Chris07

Members
  • Posts

    339
  • Joined

  • Days Won

    4

Posts posted by Chris07

  1. And the & usually means that they refer to an already named object 

    so if it says: 

    Dog.PushActionMove(ACTION_APPEND, &Evi, TARGET_ANY);

    the dog moves to the already specified object called Evi 

     

    Not exactly true. The ampersand '&' simply denotes a pass by reference as opposed to a pass by value.

     

    The difference?

     

    &Evi means you are passing the entire object into the function. Any modification to the value of Evi inside of the function will also take effect outside of the function.

    Without the &, a copy of Evi is passed into the function so that any modification made to Evi inside of the function will have no effect on its value outside of the function.

     

    Its sort of like sharing your sandwich with your friend (whatever he does to it, also effects you) [Pass by reference] versus making your friend his own sandwich (whatever he does to his 'copy' of the sandwich does not effect your own sandwich) [ pass by value].

     

    The sandwich analogy is a bit lame but hey...I was winging it :P

     

    More information about pass by value and pass by reference.

  2. Why do I have this weird feeling that "modding" will be limited to just the editor and that no scripting mechanism will be put in place?

    If they omit scripting, which I've yet to hear a single thing about, then the types of mods seen in EM4 will be impossible.

    I hate to be a downer but I'm scared they've either severely limited or totally cut scripting from the game.

  3. 1. This mod was made to be multiplayer compatible and thus no units spawn on the map. They must be called out manually.

    2 . Money is high so that it doesn't play a factor in the game. Remember, this was a clan mod.

    3. How is the time bugged?

    4. When called in, units may take some time to appear and drive into the map (a few seconds)

    Fire units spawn in grid H3

    Police spawns at the back of the police station and a few at A5

    Ems spawns at F8

    TEC and the fire crane spawn at D8

  4. Audio::PlaySample(); plays a sound once. To make it loop you need to use PlaySample3D().

    PlaySample3D(AlarmSound, Vector Target, true);

    Replace "Vector Target" with a vector object of the location you want the sound to come out of...If you want the sound to follow the vehicle, I would assume it would be best to use "pos".

  5. What part of mapping do you need help with? There are a lot of distinct parts to mapping.

    So you need help with making a ground texture? Painting terrain? Placing roads? Placing objects?

    Mapping from scratch is a very tedious process that takes a lot of time (weeks-months) to do from scratch. Not many tutorials exist, but I think there is a German one though. If you can narrow down your question a bit i might be able to help with some questions.

  6. I was talking about lines 243-266

    Yours will not work because in the post above, l99 is not initialized, only l97 is.

                            else if(StrCompare(v.GetPrototypeFileName(), OBJ_CRUISER04) == 0)			{				GameObjectlist l99;				Game::CollectObstaclesOnVirtualObject(VO_BACK01, l99, ACTOR_VEHICLE);				if(l99.GetNumObjects() > 0)				{					Game::CollectObstaclesOnVirtualObject(VO_BACK02, l99, ACTOR_VEHICLE); //Reuse l99, no need for a new variable					if(l99.GetNumObjects() > 0)					{						v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);						return;					}					else					{						ActorList l1 = Game::GetActors(VO_TT_BACK02);						ActorList l2 = Game::GetActors(VO_BACK02);					}				}				else				{					ActorList l1 = Game::GetActors(VO_TT_BACK01);					ActorList l2 = Game::GetActors(VO_BACK01);				}				} else			{				Mission::PlayHint(HINT_NOTVALID);				return;			}
  7. I have two more things up my sleeve.
     
    Looking at the script before I started adding a bunch of stuff, I just noticed line 249 is missing a semi-colon. Try adding it and see if that fixes things.

    GameObjectlist l99;

     

     

    Otherwise replace starting at "} else if(StrCompare(v.GetPrototypeFileName(), OBJ_VAN) == 0)" until the end of the childID == 1 statement.

                } else if(StrCompare(v.GetPrototypeFileName(), OBJ_VAN) == 0)            {                GameObjectList l99;                Game::CollectObstaclesOnVirtualObject(VO_BACK03, l99, ACTOR_VEHICLE);                if(l99.GetNumObjects() > 0)                {                    v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);                    return;                } else                {                    ActorList aList1 = Game::GetActors(VO_TT_BACK03);                    ActorList aList2 = Game::GetActors(VO_BACK03);                }            }            else if(StrCompare(v.GetPrototypeFileName(), OBJ_SUV) == 0)            {                    GameObjectList l99;                Game::CollectObstaclesOnVirtualObject(VO_BACK04, l99, ACTOR_VEHICLE);                if(l99.GetNumObjects() > 0)                {                    v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);                    return;                } else                {                    ActorList aList1 = Game::GetActors(VO_TT_BACK04);                    ActorList aList2 = Game::GetActors(VO_BACK04);                }            }            else if(StrCompare(v.GetPrototypeFileName(), OBJ_CRUISER04) == 0)            {                GameObjectlist l99                Game::CollectObstaclesOnVirtualObject(VO_BACK01, l99, ACTOR_VEHICLE);                if(l99.GetNumObjects() > 0)                {                    GameObjectlist l99;                    Game::CollectObstaclesOnVirtualObject(VO_BACK02, l99, ACTOR_VEHICLE);                    if(l99.GetNumObjects() > 0)                    {                        v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);                        return;                    }                    else                    {                        ActorList aList1 = Game::GetActors(VO_TT_BACK02);                        ActorList aList2 = Game::GetActors(VO_BACK02);                    }                }                else                {                    ActorList aList1 = Game::GetActors(VO_TT_BACK01);                    ActorList aList2 = Game::GetActors(VO_BACK01);                }                } else            {                Mission::PlayHint(HINT_NOTVALID);                return;            }                        if(aList1.GetNumActors() > 0)                Vector TurnTo = aList1.GetActor(0)->GetPosition();                        if(aList2.GetNumActors() > 0)                Vector Park = aList2.GetActor(0)->GetPosition();                        Audio::PlaySample3D(SND_TOSTATION, Caller->GetPosition());            v.PushActionMove(ACTION_NEWLIST, Park);            v.PushActionTurnTo(ACTION_APPEND, TurnTo);            v.PushActionWait(ACTION_APPEND, 1.0f);        }

    The only other thing i can think of is that the l1 variable is getting overwritten at some point (since its being used elsewhere). This will prevent that.

  8. Lets see if it's even making it into VAN specific portion:

     

    Find:

    else if(StrCompare(v.GetPrototypeFileName(), OBJ_VAN) == 0)			{				GameObjectList l99;				Game::CollectObstaclesOnVirtualObject(VO_BACK03, l99, ACTOR_VEHICLE);				if(l99.GetNumObjects() > 0)				{					v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);					return;				} else				{					ActorList l1 = Game::GetActors(VO_TT_BACK03);					ActorList l2 = Game::GetActors(VO_BACK03);				}			}

    Replace with:

    else if(StrCompare(v.GetPrototypeFileName(), OBJ_VAN) == 0)			{				GameObjectList l99;				Game::CollectObstaclesOnVirtualObject(VO_BACK03, l99, ACTOR_VEHICLE);				if(l99.GetNumObjects() > 0)				{					v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);					return;				} else				{					ActorList l1 = Game::GetActors(VO_TT_BACK03);					ActorList l2 = Game::GetActors(VO_BACK03);                                         Mission::PlayHint("I MADE IT");				}			}

    using the van, send it to station. If the Hint plays...its making it and i've hit another dead end. If it doesn't play, it's because the program never reaches that portion of the code

  9. I made a mistake...It's supposed to be Mission::PlayHint()

    //Debug L1f(l1.GetNumActors() > 0)	Mission::PlayHint("L1 is good!");else if(l1.GetNumActors() == 0)        Mission::PlayHint("L1 is equal to 0");else        Mission::PlayHint("Impossible...this is worse than dividing by 0 (L1)");//Debug L2if(l2.GetNumActors() > 0)	Mission::PlayHint("L2 is good!");else if(l2.GetNumActors() == 0)        Mission::PlayHint("L2 is equal to 0");else        Mission::PlayHint("Impossible...this is worse than dividing by 0 (L2)");/*Audio::PlaySample3D(SND_TOSTATION, Caller->GetPosition());v.PushActionMove(ACTION_NEWLIST, FirstPoint);v.PushActionTurnTo(ACTION_APPEND, TurnTo);*/

    Anyway...now that my theory is confirmed lets try the obvious. Ensure that your VOs are named properly in the editor and that their names are correct in your script. The error is most likely that your VO is named wrong. that's why it's == 0

  10. I don't have the ability to view .dds files on this computer, but based upon the name I would guess it is:

     

    /Data/UI/Game/Icons/Cursor/aim.dds or /Data/UI/Game/Icons/Cursor/aimed.dds

     

    Yes, that's under based game. adding an icon named aim.dds or aimed.dds to your MODNAME/UI/Game/Icons/Cursor/ should cause the game to choose your version over the base game's.

  11. The code to do that is all over the place and in several mods:

    General idea is thus:

    ActorList aList1 = Game::GetActors(VO_1); ActorList aList2 = Game::GetActors(VO_2);ActorList aList3 = Game::GetActors(VO_3);if(aList1.GetNumActors() > 0) {     Vector FirstPoint = aList1.GetActor(0)->GetPosition();} else {     Mission::PlayHint("FirstPoint VO not found");     return; //something went wrong. abort.}if(aList2.GetNumActors() > 0) {     Vector Park = aList2.GetActor(0)->GetPosition();} else {     Mission::PlayHint("Park VO not found");     return; //something went wrong. abort.}if(aList3.GetNumActors() > 0) {     Vector TurnTo = aList3.GetActor(0)->GetPosition();} else {     Mission::PlayHint("TurnTo VO not found");     return; //something went wrong. abort.}//v = the Vehicle Objectv.PushActionMove(ACTION_NEWLIST, FirstPoint);v.PushActionTurnTo(ACTION_APPEND, Park);v.PushActionWait(ACTION_APPEND, 1.0f);v.PushActionMove(ACTION_APPEND, Park);v.PushActionTurnTo(ACTION_APPEND, TurnTo);

    ...where VO_1 VO_2 VO_3 correspond to the VOs described in my first post.

  12. Lets debug this a little more. Let's first confirm my suspicion of the cause of the error:

     

    Replace:

    if(l1.GetNumActors() > 0)	Vector FirstPoint = l1.GetActor(0)->GetPosition();if(l2.GetNumActors() > 0)	Vector TurnTo = l2.GetActor(0)->GetPosition();Audio::PlaySample3D(SND_TOSTATION, Caller->GetPosition());v.PushActionMove(ACTION_NEWLIST, FirstPoint);v.PushActionTurnTo(ACTION_APPEND, TurnTo);

    With:

    //Debug L1f(l1.GetNumActors() > 0)	Game::PlayHint("L1 is good!");else if(l1.GetNumActors() == 0)        Game::PlayHint("L1 is equal to 0");else        Game::PlayHint("Impossible...this is worse than dividing by 0 (L1)");//Debug L2if(l2.GetNumActors() > 0)	Game::PlayHint("L2 is good!");else if(l2.GetNumActors() == 0)        Game::PlayHint("L2 is equal to 0");else        Game::PlayHint("Impossible...this is worse than dividing by 0 (L2)");/*Audio::PlaySample3D(SND_TOSTATION, Caller->GetPosition());v.PushActionMove(ACTION_NEWLIST, FirstPoint);v.PushActionTurnTo(ACTION_APPEND, TurnTo);*/

    Tell me what the game ticker says...or any additional error.

  13. I know this is a couple days old, but in-case you're still stuck...

     

    Not sure as the scripts looks okay. What I would do is comment out parts of the script and play a hint confirming that the bottom was reached. If you don't CTD...that part of the code is fine. Gradually expand until you locate the offending section.

     

    Alternatively...please "Break points" everywhere.

     

    After every few lines, output to the log file a unique number. Then when you crash, look at the log and see what the last line to execute was...that'll help you find the offending portion.

     

    My guess is it has to do with the object your creating. CTD usually happen when something goes wrong with a prototype or model.

  14. Most likely reason is because of this part:

    if(l1.GetNumActors() > 0)	Vector FirstPoint = l1.GetActor(0)->GetPosition();

    If the if() statement returns false, the FirstPoint variable never gets initialized.

     

    Explanation:

    say l1.GetNumActors() > 0 is false (because l1.GetNumActors() is 0)

     

    then the

    Vector FirstPoint = l1.GetActor(0)->GetPosition();

    line gets skipped over completely and is never defined.

     

    You either need to declare and set a default value for FirstPoint outside of the if() statement (somewhere before it), or you need to account for the situation that l1.GetNumActors() == 0 and bail out before it reaches the v.PushActionMove line.

  15. Errors typically get thrown when they are called, with the exception of syntax errors. When you load the mod, I believe the game compiles your scripts. During the compilation it will catch syntax errors. Errors in scope or other semantic errors are usually caught at run-time (during gameplay when the command is called)

     

    Scripting is the single most frustrating part of modding. I find that about 80% of my time scripting is waiting for things to load. Stupid error? Forget a ';'? Got to load the whole thing over again. How did those Manhattan mod guys do it? Takes me like 3-4 minutes to load their mod with an SSD. I'd have shot myself somewhere around the 4th or 5th error.

  16. I'm not exactly sure what's gonig on in the script after a quick look through. Comments being in German don't help :tongue2:

    Why use vectors to position things? Do you need fine grain control over their direction?

     

    Why not use virtual objects?

     

    VO_1 (Placed directly in front of parking spot)

    VO_2 (The actual parking spot)

    VO_3 (Placed in the direction you want the vehicle to point when its done parking relative to the position of VO_2. In most cases this VO can be omitted and VO_1 can be used)

     

    1. Send vehicle to VO_1's location

    2. Make vehicle face VO_2

    3. Send Vehicle to VO_2's location

    4. Make Vehicle Turn to face VO_3 (or VO_2 depending)

     

    I haven't really played with vectors and doing things manually that way. I find the VO method easier.

  17. Replace it with whatever you want. The Cabin gets placed and the tiller trailer gets added dynamically. If you put something other than the tiller_cabin there, the trailer won't spawn. Replace it as you did the others.

     

    Also, LAFireStation.script deals with the spawning of the vehicles in the station at game start and the control panel controls. LAToFireStation.script will be needed to send them back to station.

×
×
  • Create New...