Skip to main content

Chainsaw Pickups

Info

Chainsaw fuel pickups cannot be picked-up after a client has already picked-up 2 of them in the same map.

This method will give ALL Slayers +1 fuel pickup when one Slayer tries to pickup a fuel canister.

idDynamicEntity

entity {
	entityDef coop_pickup_ammo_gas_1_fake {
	inherit = "func/dynamic";
	class = "idDynamicEntity"; // This is the fuel canister model
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = false;
	disableAIPooling = false;
	edit = {
		spawnPosition = { // Be sure to set the spawn position
			x = -11.11;
			y = -11.11;
			z = -11.11;
		}
		spawnOrientation = { // Be sure to set the spawn orientation
			mat = {
				mat[0] = {
					x = -1;
					y = 0;
					z = 0;
				}
				mat[1] = {
					x = 0;
					y = -1;
					z = 0;
				}
			}
		}
		renderModelInfo = {
			model = "art/pickups/ammo/ammo_chainsaw_01.lwo";
			contributesToLightProbeGen = false;
			ignoreDesaturate = true;
			emissiveScale = 0.2;
			scale = {
				x = 2;
				y = 2;
				z = 2;
			}
		}
		clipModelInfo = {
			type = "CLIPMODEL_NONE";
		}
		dormancy = {
			canBecomeDormant = true;
		}
	}
}
}

idTrigger

entity {
	entityDef coop_pickup_ammo_gas_1_trigger {
	inherit = "trigger/trigger";
	class = "idTrigger";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = false;
	disableAIPooling = false;
	edit = {
		spawnPosition = { // Set the spawn position to same as the idDynamicEntity
			x = -11.11;
			y = -11.11;
			z = -11.11;
		}
		renderModelInfo = {
			model = NULL;
		}
		clipModelInfo = {
			type = "CLIPMODEL_BOX";
			size = {
				x = 2;
				y = 2;
				z = 2;
			}
		}
		targets = {
			num = 1;
			item[0] = "coop_pickup_ammo_gas_1_fake_timeline"; // Targets the removal or respawn timeline
		}
		playerCanActivate = true;
		clientCanActivate = true;
		triggerForAllClients = true;
		triggerOnEnter = true;
		triggerOnce = true; // Set to false for respawning pickup
		wait = 0; // Add a wait timer for respawning pickup
	}
}
}

Global SFX / Give Fuel

A separate relay entity must exist once to activate the sound effect & give fuel ammo command.

entity {
	entityDef multiplayer_chainsaw_refill_relay {
	inherit = "target/relay";
	class = "idTarget_Count";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = false; // Must be false
	disableAIPooling = false;
	edit = {
		flags = {
			noFlood = true;
		}
		networkSerializeTransforms = false;
		count = 1;
		spawnPosition = {
			x = 1;
			y = 1;
			z = 1;
		}
		targets = {
			num = 2;
			item[0] = "multiplayer_chainsaw_refill"; // Ammo refill
			item[1] = "multiplayer_chainsaw_refill_sfx"; // Sound effect
		}
		repeat = true; // Must be true
	}
}
}
entity {
	entityDef multiplayer_chainsaw_refill_sfx {
	inherit = "sound/soundentity";
	class = "idSoundEntity";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = false;
	disableAIPooling = false;
	edit = {
		temporarySoundEvent = true;
		spawnPosition = { // The spawn position does not matter
			x = 1;
			y = 1;
			z = 1;
		}
		soundOcclusionBypass = true;
		startEvents = {
			num = 1;
			item[0] = "play_pickup_ammo_chainsaw";
		}
		stopEvents = {
			num = 1;
			item[0] = "play_pickup_ammo_chainsaw";
		}
	}
}
}
entity {
	entityDef multiplayer_chainsaw_refill {
	class = "idTarget_Command";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = false;
	disableAIPooling = false;
	edit = {
		flags = {
			noFlood = true;
		}
		commandText = "give ammo/sharedammopool/fuel"; // Be sure to set the ammo count to 1 for this decl
		spawnPosition = { // The spawn position does not matter
			x = 1;
			y = 1;
			z = 1;
		}
	}
}
}

Removal Timeline / Relay

entity {
	entityDef coop_pickup_ammo_gas_1_fake_timeline {
	inherit = "target/timeline";
	class = "idTarget_Timeline";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = true; // Must be true
	disableAIPooling = false;
	edit = {
		flags = {
			noFlood = true;
		}
		networkSerializeTransforms = false;
		spawnPosition = {
			x = 1;
			y = 1;
			z = 1;
		}
		componentTimeLine = {
			entityEvents = {
				num = 2;
				item[0] = {
					entity = "coop_pickup_ammo_gas_1_fake_remove"; // Remove relay
					events = {
						num = 1;
						item[0] = {
							eventTime = 100;
							eventCall = {
								eventDef = "activate";
								args = {
									num = 1;
									item[0] = {
										entity = "";
									}
								}
							}
						}
					}
				}
				item[1] = {
					entity = "multiplayer_chainsaw_refill_relay"; // SFX & give fuel relay
					events = {
						num = 1;
						item[0] = {
							eventTime = 100;
							eventCall = {
								eventDef = "activate";
								args = {
									num = 1;
									item[0] = {
										entity = "";
									}
								}
							}
						}
					}
				}
			}
		}
		allowClientsToStart = true;
		renderModelInfo = {
			scale = {
				x = 1;
				y = 1;
				z = 1;
			}
		}
	}
}
}
entity {
	entityDef coop_pickup_ammo_gas_1_fake_remove {
	inherit = "target/remove";
	class = "idTarget_Remove";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = false; // Must be false
	disableAIPooling = false;
	edit = {
		flags = {
			noFlood = true;
		}
		networkSerializeTransforms = false;
		count = 1;
		spawnPosition = {
			x = 1;
			y = 1;
			z = 1;
		}
		targets = {
			num = 1;
			item[0] = "coop_pickup_ammo_gas_1_fake"; // Removes the chainsaw canister model
		}
	}
}
}

Respawn Timeline / Relay

entity {
	entityDef coop_pickup_ammo_gas_1_fake_timeline {
	inherit = "target/timeline";
	class = "idTarget_Timeline";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = true; // Must be true
	disableAIPooling = false;
	edit = {
		flags = {
			noFlood = true;
		}
		networkSerializeTransforms = false;
		spawnPosition = {
			x = 1;
			y = 1;
			z = 1;
		}
		componentTimeLine = {
			entityEvents = {
				num = 2;
				item[0] = {
					entity = "coop_pickup_ammo_gas_1_fake_relay"; // Respawn relay
					events = {
						num = 2;
						item[0] = {
							eventTime = 100;
							eventCall = {
								eventDef = "activate";
								args = {
									num = 1;
									item[0] = {
										entity = "";
									}
								}
							}
						}
						item[1] = {
							eventTime = 30000; // Show fuel cansiter render model after 30 seconds
							eventCall = {
								eventDef = "activate";
								args = {
									num = 1;
									item[0] = {
										entity = "";
									}
								}
							}
						}
					}
				}
				item[1] = {
					entity = "multiplayer_chainsaw_refill_fuck_you_relay"; // SFX & give fuel relay
					events = {
						num = 1;
						item[0] = {
							eventTime = 100;
							eventCall = {
								eventDef = "activate";
								args = {
									num = 1;
									item[0] = {
										entity = "";
									}
								}
							}
						}
					}
				}
			}
		}
		allowClientsToStart = true;
		renderModelInfo = {
			scale = {
				x = 1;
				y = 1;
				z = 1;
			}
		}
	}
}
}
entity {
	entityDef coop_pickup_ammo_gas_1_fake_relay {
	inherit = "target/relay";
	class = "idTarget_Count";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = false; // Must be false
	disableAIPooling = false;
	edit = {
		flags = {
			noFlood = true;
		}
		networkSerializeTransforms = false;
		count = 1;
		spawnPosition = {
			x = 1;
			y = 1;
			z = 1;
		}
		targets = {
			num = 1;
			item[0] = "coop_pickup_ammo_gas_1_fake"; // Show/Hide fuel canister render model
		}
		repeat = true; // Must be true
	}
}
}