Making people attack you ( in the right forum this time )!

Seeing as this is a long way into a module it would take me ages to test it so before I do it, is this possible ?

Can I change people to hostile by using the ga_faction join script in a conversation even if they’re in another area ? I was thinking of steadily adding their tags and the $hostile bit during the conversation inside so when you go out you have a lot of enemies in various places. I don’t mind doing this but would rather know if it works.

I think it works as some of the people in the original conversation that turn violent have the same tags as some outside that area and I seem to remember being attacked at random later on. I might’ve even done this deliberately so it happened but can’t remember if I did.

I looked at the ga scripts for factions in the conversation editor and all they have is faction rep and faction join.

Faction rep would be good but it says it only deals with the main factions so if I made a custom faction and made everyone in that faction hate the player on one conversation line I doubt if it would work.

Or is there a way to turn a custom faction hostile in a conversation ?

All I want to do is be attacked it can’t be too much to ask for !

Thank you.

Here is a script that makes hostile up to 3 group of tagged people. Each group member shares the same tag. Make it a campaign script so you can call it from any conversation.

// set hostile the tagged creatures

void  SetHostile(string sTag)
{
	int n = 0;
	object oHostile = GetObjectByTag(sTag);
	while (GetIsObjectValid(oHostile))
	{
		ChangeToStandardFaction(oHostile, STANDARD_FACTION_HOSTILE);
		n++;
		oHostile = GetObjectByTag(sTag, n);
	}
}

void main(string sT1, string sT2="", string sT3="")
{
	if (sT1 != "") SetHostile(sT1);
	if (sT2 != "") SetHostile(sT2);
	if (sT3 != "") SetHostile(sT3);
}

Let say the script is named “set_hostile”
We have 3 groups. All warriors group members are tagged “enemy_warrior” for instance.
From a convo call set_hostile(“enemy_warrior”, “enemy_ranger”, “enemy_wizard”). That makes hostile the warriors, rangers and wizards groups.

The groups must be in same the module but not necessarily in the same area as the PC.

Of course you may amend the script according to your needs.

2 Likes

I don’t know how you did that but I’m very impressed as I’ve never seen a script that you can add tags to from the conversation editor and didn’t think it was possible.

I’m definitely not likely to amend it as I’d mess it up and don’t really understand it !

You’re name is on the script and will live on in the city of Boudang for eternity and maybe even beyond if more people get upset by the deeds of adventurers elsewhere.

Many thanks.

Thanks Tsongo.

Actually you define the parameters you want to pass in the void main statement. It can be a string for a tag, a ResRef, a Rostername or an int or float for a number … Standard scripts like the ga_ xx work the same way.

Use the Refresh button to enter the parameters like for the ga_xx scripts.

Grab my last mod 16 Cygni: Strike Back campaign folder. It is the last mod, so the collection is the richest. There are several campaign scripts you may find useful for your own work.

Claudius33… I think I understand what you mean but I’ve never seen a script work like that apart from the ones that come with the toolset. Most of my scripts come from the conversation ga ones as that’s where most of the changes happen in my mods.

I was just stunned when I refreshed your script and three boxes came up for me to fill in. I was just about to start filling in the tags on the actual script then realised what you had said in your post, tried it and couldn’t believe it worked like that.

Thanks for the offer of the scripts from your mod, if I need more I will definitely investigate and any I use will be named at the top. I’m good at doing that bit because I can’t trash anything by writing behind a //

Be my guest. The toolset is versatile indeed.

I agree it’s probably one of if not the last of it’s kind with such capabilities. Developers don’t make money from player’s free content which puts them off having toolsets and I suppose games have got a lot more complicated so it would take us twenty years to make a mod !

Claudius33… Just to say this script worked perfectly and just as I wanted it to, fights broke out all over the place.

You could even change bits and flip it to make things behave when you kill the boss etc. I’m still impressed !

1 Like

Thanks Tsongo. Glad I could help.