[SSM] Killing dummy objects easy code

Lots of cool and useful tips to mod either serverside or clientside

Killing dummy objects easy code

Postby freddy » Thu Feb 07, 2013 8:08 pm

Easy way to "kill" dummy objects instead of using deathbubbles or fiddling with the criticalDamage values. No extra code for taking care of the wreck or such needed.

Code: Select all
ObjectTemplate.Active BF109
ObjectTemplate.timeToLiveAfterDeath 6
ObjectTemplate.destroyed 1


As it spawns already "destroyed" it exists for the time set in the timeToLiveAfterDeath code before it vanish, it works fine to addtemplate spawners, soldierspawns and so on. The engine is disabled by default but weapons still work.

User avatar
freddy
 
Posts: 1221
Joined: Sun Oct 18, 2009 4:58 pm

Re: Killing dummy objects easy code

Postby fo0k » Fri Feb 15, 2013 2:16 pm

so a solution to this is good but could you put this into perspective a bit more.. why would someone want to 'kill dummy objects' ?
User avatar
fo0k
 
Posts: 1411
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Killing dummy objects easy code

Postby freddy » Fri Feb 15, 2013 7:29 pm

Well its often needed to use dummy objects to fulfil a function of two parameters, in ssm modding theres not much to choose from either.

Lets try this as an example, say you have two flags and you want a soldierspawn to apear for one team when both flags are taken by the other team, so we use for example a sub for its soldierspawn, rip it from the sub and add it to a jeep and let the flags spawn these vehicles and so when both conditions are met the soldierspawn shows up.

so far so good but we cant have that spawn there forever, if the flags get taken back we want the soldierspawn to dissapear again, and this is where the "kill the dummy object" code comes in. its much easier then using hpLostWhileCriticalDamage or deathbubbles or even let the object fall to its death etc, you can set the time for creation (SpawnDelay) and dissapearence (timeToLiveAfterDeath) with ease, it think even in decimals (havent tried that yet tho)

Another but perhaps not so common example of when you would want to remove a dummy object in a certain timeframe
viewtopic.php?f=43&t=56
or
viewtopic.php?f=43&t=1611
User avatar
freddy
 
Posts: 1221
Joined: Sun Oct 18, 2009 4:58 pm

Re: Killing dummy objects easy code

Postby fo0k » Sat Feb 16, 2013 3:48 am

I see.. yeah that is simple and useful when you put it like that. I'm not so ssm minded.

I like anything like this though.. its a 'switch' basically.. and bf could use more switches.. they do fun stuff.
User avatar
fo0k
 
Posts: 1411
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Killing dummy objects easy code

Postby Shrooms » Sun Feb 24, 2013 8:01 pm

Freddy, I like the idea. I want to change it up. Make the dummy objects indestructible, preventing base campers from destroying planes and such. I'm not sure how I can achieve this though. Repair points is my current solution. You know of an alternative?
Shrooms
 
Posts: 70
Joined: Wed Aug 11, 2010 12:35 am

Re: Killing dummy objects easy code

Postby freddy » Sun Feb 24, 2013 9:41 pm

Shrooms wrote:Freddy, I like the idea. I want to change it up. Make the dummy objects indestructible, preventing base campers from destroying planes and such. I'm not sure how I can achieve this though. Repair points is my current solution. You know of an alternative?

changing the materials of the dummy object should work fine ssm, or perhaps try something with the AddToCollisionGroup argument
"c_CGProjectiles - Allows bullets to pass through it (e.g., fencing) "

http://bfmods.com/mdt/scripting/ObjectT ... Group.html
User avatar
freddy
 
Posts: 1221
Joined: Sun Oct 18, 2009 4:58 pm

Re: Killing dummy objects easy code

Postby freddy » Sun Feb 24, 2013 9:57 pm

i just come to think of that you can spawn indestructible and visible objects ssm, aslong as they have the networkinfo.

theres a thread somewhere with the things you can spawn, i remember the Katyusha rocketramp and the ptboats sidegunner as an example

edit: http://battlefieldmodding.com/ssm/phpBB ... 543c01f1c5
User avatar
freddy
 
Posts: 1221
Joined: Sun Oct 18, 2009 4:58 pm


Return to General Modding Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest