Page 1 of 2

I've seen it done on servers

Posted: Mon Oct 10, 2011 4:39 am
by EvilGrins
How do I edit a map so that players on it are forced to a different starting weapon other than the pistol?

Re: I've seen it done on servers

Posted: Mon Oct 10, 2011 10:50 am
by Feralidragon
You need to make a script for it.

Basically, you need to create an actor that you place somewhere in the map (no matter where, as long it's in an open space and not solid), and that activates a mutator in the map to switch those weapons.

Since you don't know how to script such thing and if you know which maps have them, search them up and if possible, try to contact the original mapper so he can tell you exactly what actor he placed there, or you can request someone to make you such script.

Re: I've seen it done on servers

Posted: Mon Oct 10, 2011 6:18 pm
by EvilGrins
Thanks!

Re: I've seen it done on servers

Posted: Tue Oct 11, 2011 1:10 pm
by Bloeb
Feralidragon wrote: Basically, you need to create an actor that you place somewhere in the map (no matter where, as long it's in an open space and not solid), and that activates a mutator in the map to switch those weapons.
It doesn't matter whether the actor is placed in an open-space or not. Also, the actor doesn't need to activate a mutator. It can directly manipulate the players inventory list.
Feralidragon wrote: Since you don't know how to script such thing and if you know which maps have them, search them up and if possible, try to contact the original mapper so he can tell you exactly what actor he placed there, or you can request someone to make you such script.
He's in luck. I've already created a mod that can do this: BTME. The mod has an actor called InventoryConfigurationTrigger. The actor can be configured to change the players inventory. It's possible to attach this actor to regular trigger-actors, ZoneInfo-actors and possibly NavigationPoint-actors.

Re: I've seen it done on servers

Posted: Tue Oct 11, 2011 1:55 pm
by Feralidragon
Bloeb wrote: It doesn't matter whether the actor is placed in an open-space or not. Also, the actor doesn't need to activate a mutator. It can directly manipulate the players inventory list.
That's not accurate: from a general stand point of view, the safest thing to do always is indeed put an actor in open-space. If *your* actor has the required configuration to not be destroyed in solid space once the game is launched, that's one thing (and there are several different kinds of settings that make that possible in each actor), but when you're not sure how it works when you use some 3rd party mod, the safe thing to do is to place it in open space, otherwise you run the risk of it not working since might get destroyed before it evens process anything at all when they are in solid space, while in open they don't and work properlly.

As for not needing a mutator, again that's *your* case. Yes, you can manipulate the players inventory list directly and all, but I ask you: is it safe? The answer is no. Everytime you mess with something directly which is already handled by the game, you run the risk to break it apart.
Also, there are some reasons why activating a mutator instead is much better: much faster performance, more stability and it's safer.

The performance is much superior since with an actor you don't get any events called, so you have to either add a timer or tick event to make some checks in all the actors you want periodically, while with a mutator you get those events, so you process only 1 single thing in the exact moment it happens and no extra processing is needed.
On another hand, since mutators are handled by the game itself and it already gives you many ways to replace and add the stuff you want, you don't have to mess a player's inventory directly most of the times, therefore is safer and more stable, and you have a much better compatibility and management with other mutators running at the same time.


But well, bottom line: I don't agree with your approach on this for the reasons stated above, but is an "aproach" nonethless, so if it works good for the purpose you want, then :thuup:

Re: I've seen it done on servers

Posted: Tue Oct 11, 2011 5:56 pm
by EvilGrins
Bloeb wrote:
Feralidragon wrote: Since you don't know how to script such thing and if you know which maps have them, search them up and if possible, try to contact the original mapper so he can tell you exactly what actor he placed there, or you can request someone to make you such script.
He's in luck. I've already created a mod that can do this: BTME. The mod has an actor called InventoryConfigurationTrigger. The actor can be configured to change the players inventory. It's possible to attach this actor to regular trigger-actors, ZoneInfo-actors and possibly NavigationPoint-actors.
Cool but isn't that strictly only for BT? Seems to be where your focus was.

Re: I've seen it done on servers

Posted: Fri Mar 23, 2012 5:33 am
by Ozma777
lol I was reading this up top and thought immediately about BTME. Then Bloeb posted. BTME is just a replacement zoneinfo it should work for all gametypes. Instead of zoning your map with zoneinfo actor zone it with BTMEzoneactor. I don't know the specifics of that script but it should work.

Re: I've seen it done on servers

Posted: Mon Apr 23, 2012 3:17 am
by EvilGrins
Don't know how he did it, still having troubles just playing it, but a guy released a new map over at Hermskii's and it does switch the default weapon automatically.

If anyone's curious:
http://hermskii.com/Forum/viewtopic.php?f=17&t=3208

Re: I've seen it done on servers

Posted: Mon Apr 23, 2012 6:20 am
by JackGriffin
I'm glad he released this, I was beginning to worry it would not see a public version for a while. Beautiful map, isn't it? Al has all kinds of embedded custom code in actors all over the map. He's not a big fan of external mods and he (and Titled) will very often script stuff and just attach it to existing actors like triggers. I'd helped him fix various stuff but stopped hearing from him a couple of weeks ago. I thought maybe he had dropped away again so this release is a bit of a surprise. He's been working on this for a few years off and on, it's nice to be able to talk about it publicly.

Have you fought a tank yet? <Boom!> :D

Re: I've seen it done on servers

Posted: Mon Apr 23, 2012 8:28 am
by EvilGrins
JackGriffin wrote:I'm glad he released this, I was beginning to worry it would not see a public version for a while. Beautiful map, isn't it? Al has all kinds of embedded custom code in actors all over the map. He's not a big fan of external mods and he (and Titled) will very often script stuff and just attach it to existing actors like triggers. I'd helped him fix various stuff but stopped hearing from him a couple of weeks ago. I thought maybe he had dropped away again so this release is a bit of a surprise. He's been working on this for a few years off and on, it's nice to be able to talk about it publicly.

Have you fought a tank yet? <Boom!> :D
I fought a tank. I beat the tank without dying... only to be killed in the chemical release it spews out as it dies.

Yeah, it's a cool map, minus a couple little issues I addressed over at the link. As it is well both-pathed I thought I'd just go into spectator mode and let them beat it so I could watch but that didn't work. The map is broken into stages that require an actual player. Bots will only fight up the beginning of the next stage before they go into defense mode and wait.

So, I'm gonna have to play it through to the end. Just getting to that tank, me and 3 bots, took like 35 minutes.

Re: I've seen it done on servers

Posted: Mon Apr 23, 2012 10:04 am
by ASLY
NWBT_v6.u
http://www.2shared.com/file/kffW5AaU/NWBT_v6.html
[+]Actor -> [+]Info -> [+]Mutator -> NWBT_Mutator -> (Put somewhere to your map) -> NWBT_Mutator Properties - [+]NWBT_Mutator -> DefaultWeapon

Re: I've seen it done on servers

Posted: Tue May 01, 2012 12:43 pm
by VatcilliZeitchef
JackGriffin wrote:I'd helped him fix various stuff but stopped hearing from him a couple of weeks ago. I thought maybe he had dropped away again so this release is a bit of a surprise.
Talking about ghosts are we?

Yes I have been a bit inactive, Usually I just log into MSN for a few minutes then log off again. But I am glad I managed to get the map released, now as soon as I can get that Myoko bot and the botpathing fixed
I can release it as beta 2... Maybe I can think of a way to work around those mods that disable the Grab key too so it will be playable in those, Though honestly I tried the map with mutators like MH-Excal/Monsterhunt plus and..
...It just ruins the fun with how easy it becomes when you have 200+ health. Lurkers and Hulking Abominations are no challenge at all... Getting cornered does NOT mean instant death.. And the zombies appear to be more stupid for some reason.

It's playable just... Not advisable.

As for setting a custom starting weapon that was actually a trigger Titled made which is located just underneath the playerstarts, it's messy though so I don't recommend using it, the script might however contain usable parts. It does give accessed nones at some times.

Code: Select all

//=============================================================================
// InventoryBuster. Note that inventory is not real, it is a myth.
//=============================================================================
class InventoryBuster expands Triggers;

var() class<inventory> toDestroy;
var() class<inventory> SpawnInventory[4];
var() bool triggerOnTouch;

simulated function Touch( actor Other )
{
	if (triggerOnTouch)
		Trigger(Other, pawn(Other));
}

simulated function Trigger( actor Other, pawn EventInstigator )
{
	local Inventory Item;
	local Inventory lastItem;
	local Weapon NewWeapon;
	local pickup NewPickup;
	local int i;
	local int giveItem[4];

	for(i = 0; i < 4; i++) {
		giveItem[i] = 1; // TRUE
	}

	if ((Pawn(Other) != None) && (Other.IsA('playerpawn') || Other.IsA('bot')==true)){
		for( Item=Pawn(Other).Inventory; Item!=None; Item=Item.Inventory ){
			if (ClassIsChildOf(Item.Class, toDestroy)){
				if (lastItem != None){
					lastItem.Inventory = Item.Inventory;
				} else {
					Pawn(Other).Inventory = Item.Inventory;
				}
				Item.Destroy();
			} else {
				for(i = 0; i < 4; i++){
					if (ClassIsChildOf(Item.Class, SpawnInventory[i])){
						giveItem[i] = 0; // FALSE
					}
				}
				lastItem = Item;
			}
		}
		for(i = 0; i < 4; i++){
			if (giveItem[i] == 1 && SpawnInventory[i] != None){ // TRUE
 				Item = spawn(SpawnInventory[i],Other,,,rot(0,0,0));
				Item.RespawnTime = 0.0;
				Item.bHeldItem = true;
				Item.GiveTo(Pawn(Other));
				
				NewWeapon = weapon(Item);
				NewPickup = pickup(item);
				
				if (NewWeapon != None){
					NewWeapon.Instigator = Pawn(Other);
					NewWeapon.GiveAmmo(Pawn(Other));
					NewWeapon.SetSwitchPriority(Pawn(Other));
					NewWeapon.WeaponSet(Pawn(Other));
					NewWeapon.AmbientGlow = 0;
					NewWeapon.bCanThrow = false;
				}
				
				if (NewPickup != None){
					if (NewPickup.bCanActivate){
						NewPickup.gotoState('activated');
						
					}
					
				}
			}
		}
	}
}


Re: I've seen it done on servers

Posted: Tue May 01, 2012 12:54 pm
by JackGriffin
Al there is a gentleman that posts here by the name Higor and I believe that he knows more about how to make a bot do what you want than anyone I've ever seen.

Re: I've seen it done on servers

Posted: Tue May 01, 2012 12:55 pm
by GenMoKai
Say what?! Dude! Glad to see you! That have been a really long time!

I check the map... i really wasnt expecting that your was going to release that map

Re: I've seen it done on servers

Posted: Tue May 01, 2012 4:14 pm
by VatcilliZeitchef
JackGriffin wrote:Al there is a gentleman that posts here by the name Higor and I believe that he knows more about how to make a bot do what you want than anyone I've ever seen.
Higor eh? You suggest I just PM him or do you know a different way to catch his attention? Either way it would be appreciated!
GenMoKai wrote:i really wasnt expecting that your was going to release that map
Truth be told, for a long time neither was I. Good to see you're still around!