I'm sure this has been attempted before, but I'll explain the concept anyway. Let's say you want to make "knife-traps" in a close-quarters map, preferably in a tunnel, where a player would have to dodge knives or other obstacles coming at him from the surrounding walls. It's pretty easy with the method I'll describe, and if you have a good knowledge of the distance system in Battlefield 1942 and of how objects spawn and "live", this will be a breeze for you. Only problem is the time it takes depending on the distance and path you want your object to cover.
Create an object spawn template for the knife. I hope you know how it is done, as it is one of the most basic concepts of modding, especially with WYSIWYG (What You See Is What You Get) editors such as Battlecraft 1942 or Editor42.
A) Create that new object spawner, and call it, say, "moveable statics". You're going to change the "TimeToLive" setting, which is in seconds, to 0.1 (a tenth of a second). Notice that if you set the time to live setting high, the movement of the object in time will look very choppy, that's why the smallest time to live is the better option here. The "TimeToSpawn" settings can be edited to your liking. I have it set to 60 seconds, for continuous movement.
B) Place the new spawner you've made in your map at a strategic ambush location. Remember, the shorter the distance, the better. Say your object has to cover a distance of 10 "Battlefield" meters on the x axis (east and west), which is the first number that appears on the position coordinates (x/y/z). Create a copy of the spawner you just made, placing it 0,1 "meters" in front of the first spawner you've placed while keeping the other coordinates (in this case "z" and "y") the same as the original. So if the position of the first spawner was 50/100/200, the next spawner would be 50.1/100/200, the third, 50.2 and so on, until you've reached 10 "meters", so 100 spawners. This should make the object move from point A to point B on the axis you've chosen very smoothly, as it covers 0.1 "meters" in 0.1 seconds. This gives us a velocity of one meter per second. You can even lower these numbers to your liking to make everything smoother, but the smaller the distance, the more spawners you will have to make for the same distance.
C) At this stage, the knife still cannot kill you. You need to find the barbwire code that makes your health drop when you go through it (is it located in the objects.rfa, extract it and search for it, it's probably in "Props" or "Buildings", "stebarbwire"), copy it to the knife's code in Handweapons/Knife Allies/Axis (depending on which knife you edited) and tweak that code so a contact with the knife is an instant death in one or two shots.
This hasn't been tested yet, feel free to test it and report any bugs/glitches with this workaround.
Last edited by samrtguy on Wed Aug 19, 2009 5:39 pm, edited 2 times in total.
|