Jump to content

trader5050

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by trader5050

  1. Hello there,

    I have a command script (CmdJasonDispatcher.script) as follows:

    Quote

    /******************************************************************************************

        Jason's Dispatcher Script

    ********************************************************************************************/

    int DummyGroup = 31;

    object CmdJasonDispatcher : CommandScript
    {
        CmdJasonDispatcher()
        {
        
            SetCursor("alarm");
            SetIcon("alarm");
            SetGroupID(DummyGroup);
             SetGroupLeader(true);
            SetRestrictions(RESTRICT_SELFEXECUTE);
            
        }

    ............. rest of code
            
    };

    My understanding is that the game loads ALL scripts when the mod is loaded. So very confused as to why whenever I try to call it:

    Quote

    "Error: Symbol CLASS_CmdJasonDispatcher is not defined in current scope"

    Any ideas?

  2. Hello,

    I'm trying to expand upon the Miami Mod patrol capability by having units self-direct to incidents. The problem is that I can't seem to identify anything/anyone.

    I'm trying:

    		GameObjectList list = Game::GetGameObjects();
    		for(int i=0; i<list.GetNumObjects(); i++)
    		{
    			GameObject obj = list.GetObject(i);
    						
    			/* cars */
    			if (obj.GetType()==TYPE_VEHICLE) {
    			
    				
    			
    			}
    			
    			/* people */
    			if (obj.GetType()==TYPE_PERSON) {
    				
    				/* injured? */
    				Person prsn(&obj);
    				
    				if (prsn.IsInjured() || prsn.IsComatose()) {
    					Mission::PlayHint("Found an injured person!");
    					somethingToDo=true;
    				}
    				
    			}
    			
    			/* start chase */
    			if (somethingToDo) {
    				Mission::PlayHint("Found a rescue activity!");
    				sendRescue(v,obj);
    				break;
    			}
    			
    		}

    I was also checking for gangsters, etc., but nothing ever triggers. Any help is appreciated!

  3. On 10/14/2021 at 3:03 AM, itchboy said:

    1. Unfortunately there is no other way to test. Scripting in Em4 is tedious but ironically a great way to brush up on syntax, and eventually, getting good at sorting logical errors.

    2. No you can't force trigger an event. You can only mess with the freeplay_endless.xml to give you a higher possibility of getting the event you want. May the Em4 gods be kind to you.

    3. The SDK is here in the German forums. You need an account and I recommend using a translator. https://www.emergency-forum.de/lexicon/index.php?lexicon/659-sdk/

    I took it a step further and downloaded all the SDK listings and put them into text files so I have quick reference without needing to login and translate

    Thanks for the help.

    I downloaded all of the SDK and combined into a single PDF for searching, so that's nice.

  4. Hello there,

    I have a few really basic questions:

    1. What's the easiest way to edit/reload scripts for testing? Currently I have to completely re-open the game, load mod, start freeplay, get cops into a car and hit a cmd button just to test something. It's extremely time-consuming.

    2. Is there any way to force-trigger an event for testing?

    3. I can't seem to find an SDK reference anywhere. I don't even see a function list on any sites, despite some links seeming to indicate one exists. Any help?

    Thanks a bunch!

×
×
  • Create New...