Map pre-processing question....

Discussions about Coding and Scripting
Post Reply
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Map pre-processing question....

Post by MrLoathsome »

I have been attempting to write a bit of code that will make AS maps more playable
with DM.

But I have run into a wall. Literally. :mad2: :omfg:

First thing I decided to try was to somehow get rid of any actors in the
map that are of class ExplodingWall.

Here is the current code snippet I have been trying.
Commented out lines are some other things I tried that also have failed.

Code: Select all

	ForEach AllActors(class'Actor', A)
	{
		if (A.IsA('ExplodingWall'))
		{
			log(A);
			A.SetPhysics(PHYS_None);
			A.SetCollision(false, false, false);

//			ExplodingWall(A).bHidden = True;
//			ExplodingWall(A).Health = -20.0;
//			A.GoToState('Exploding');
			A.Destroy();
		}
	}
Note this code is in a Gametype class, not a mutator.
Have tried it in both PreBeginPlay and PostBeginPlay.
Compiles fine. No errors or warning of any type in the
log file.
The ForEach loop is finding the correct actor(s).

Nothing happens. Damn walls never go anywhere.

Is what I am attempting even possible?
blarg
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Map pre-processing question....

Post by Feralidragon »

So if I understood correctly, you want to remove the walls in the AS maps (which are supposed to be destroyed later on), right?
In that case, what you want is not the ExplodingWall actors, since those walls are all movers afaik, while the ExplodingWall class is just the debris effect of it to make it pretty, and since you cannot "destroy" movers (afaik), you just have to trigger them into going to their 2nd position.
User avatar
Wises
Godlike
Posts: 1089
Joined: Sun Sep 07, 2008 10:59 am
Personal rank: ...

Re: Map pre-processing question....

Post by Wises »

ahh yeah lol.. kinda like the playerstarts thing , you can't add / remove them.. but in case of walls and movers etc.. I think because the engine requires that they be Built pre-map-compile... that .. this is not likely to happen.. how-ever triggering them into State 2 like Ferali suggests would be the go.. not sure about things like the chains thing at the gates (which need to be destroyed) and other such things.. perhaps could trigger an Explode all Explodable objects thing to account for these. hehe.
:shock:..
User avatar
papercoffee
Godlike
Posts: 10452
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Map pre-processing question....

Post by papercoffee »

And what is with the goal trigger at the end of those maps?
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Map pre-processing question....

Post by MrLoathsome »

I had glanced at the triggers when 1st looking at this, but was hoping for an easier way.
Flipping all the triggers on the map, is the best way to get this done, but I will have to look
at it closer to figure out exactly how to do that....

The goal trigger is used by the assault gametype to determine when the map ends I am pretty sure.
That should be irrelevant, for this purpose, since this is for DM/TDM/LSM gametypes that will be played
on AS maps.
If it does cause an issue, I can exclude that from the trigger flipping.

I think if I can rip thru the map and flip all the triggers, the state of the actual chains themselves
will also be irrelevant. The gate should open if the trigger gets flipped, but will have to test that
bit out with AS-Mazon.
blarg
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: Map pre-processing question....

Post by Higor »

Put this AS specific map code in a separate function.

I'd use HandleAssault() name.
Call it on InitGame, after everything else on that function (super.InitGame before as well).

On it, check that the map has a "AS" as it's first 2 characters, if it does, run a AllActors iterator on FortStandards.
If the FortStandard isn't a trigger target, make it 'Touch' or call the assault event except the one marked as final fort.
If the FortStandard is a trigger target, find the previous trigger and trigger it's events instead (do that manually, some triggers may have team restrictions).


You'll have some issues with the Assault Bonus pack maps since they have odd trigger/fortstandard methods and placements.
Post Reply