Sign in to follow this  
red_ned

[SOLVED]Infistar Custom Functions

4 posts in this topic

Hey @infiSTAR trying to script some custom functions in the menu:

	class custom1 {
		type = 0;	// just execute
		name = "Spawn_bandits_Mission: type = 0";
		code = "["bandits"] call DMS_fnc_SpawnBanditMission;";
	};
	class custom2 {
		type = 0;	// just execute
		name = "Spawn_bauhaus_Mission: type = 0";
		code = "["bauhaus"] call DMS_fnc_SpawnBanditMission;";
	};
	class custom3 {
		type = 0;	// just execute
		name = "Spawn_beertransport_Mission: type = 0";
		code = "["beertransport"] call DMS_fnc_SpawnBanditMission;";
	};
	class custom4 {
		type = 0;	// just execute
		name = "Spawn_behindenemylines_Mission: type = 0";
		code = "["behindenemylines"] call DMS_fnc_SpawnBanditMission;";
	};

I want to list all my missions in there to help me test and debug new ones and its much simpler just to be able to click them on the menu but I keep getting:

Quote

17:04:36 File a3_infistar_exile\CUSTOM_FUNCTIONS.hpp, line 4: '/CfgCustomFunctions/custom1.code': Missing ';' at the end of line

17:04:36 Error context ] call DMS_fnc_SpawnBanditMission;";

17:04:36 ErrorMessage: File a3_infistar_exile\CUSTOM_FUNCTIONS.hpp, line 4: '/CfgCustomFunctions/custom1.bandits': '"' encountered instead of '='

17:04:36 Application terminated intentionally

ErrorMessage: File a3_infistar_exile\CUSTOM_FUNCTIONS.hpp, line 4: '/CfgCustomFunctions/custom1.bandits': '"' encountered instead of '='

am I missing something?

 

cheers

 

Edited by red_ned
solved

Share this post


Link to post
Share on other sites

Hey
when doing a string within a string like you did here:
code = "["bandits"] call DMS_fnc_SpawnBanditMission;";

you need to either use single quotes or double them up e.g.
code = "[""bandits""] call DMS_fnc_SpawnBanditMission;";

so it should work like this:
 

class custom1 {
	type = 0;	// just execute
	name = "Spawn_bandits_Mission: type = 0";
	code = "[""bandits""] call DMS_fnc_SpawnBanditMission;";
};
class custom2 {
	type = 0;	// just execute
	name = "Spawn_bauhaus_Mission: type = 0";
	code = "[""bauhaus""] call DMS_fnc_SpawnBanditMission;";
};
class custom3 {
	type = 0;	// just execute
	name = "Spawn_beertransport_Mission: type = 0";
	code = "[""beertransport""] call DMS_fnc_SpawnBanditMission;";
};
class custom4 {
	type = 0;	// just execute
	name = "Spawn_behindenemylines_Mission: type = 0";
	code = "[""behindenemylines""] call DMS_fnc_SpawnBanditMission;";
};

 

Share this post


Link to post
Share on other sites
Advertisement
31 minutes ago, infiSTAR said:

Hey
when doing a string within a string like you did here:
code = "["bandits"] call DMS_fnc_SpawnBanditMission;";

you need to either use single quotes or double them up e.g.
code = "[""bandits""] call DMS_fnc_SpawnBanditMission;";

so it should work like this:
 


class custom1 {
	type = 0;	// just execute
	name = "Spawn_bandits_Mission: type = 0";
	code = "[""bandits""] call DMS_fnc_SpawnBanditMission;";
};
class custom2 {
	type = 0;	// just execute
	name = "Spawn_bauhaus_Mission: type = 0";
	code = "[""bauhaus""] call DMS_fnc_SpawnBanditMission;";
};
class custom3 {
	type = 0;	// just execute
	name = "Spawn_beertransport_Mission: type = 0";
	code = "[""beertransport""] call DMS_fnc_SpawnBanditMission;";
};
class custom4 {
	type = 0;	// just execute
	name = "Spawn_behindenemylines_Mission: type = 0";
	code = "[""behindenemylines""] call DMS_fnc_SpawnBanditMission;";
};

 

thanks for that, I am forgetting all this stuff fin my old age, I did have something similar a few years ago but I still don't seem to have the triggers in the menu even though I added each of these:

"Spawn_bandits_Mission",

inside the menu for the admins, have I forgotten something?

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.