Need help with custom objects in map

Give a clear description of what you need and maybe Santa will deliver
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Need help with custom objects in map

Post by Psycho »

I have learned how to:
Set up physics.
Get all sounds working.
Have all weapons working (used the bazookaprojectile as the Typhoon's rockets).

The thing now is, that the damn plane takes damage when entering a hangar. But it survives unharm when krasching into the ground.
And if the plane so much as touch another vehicle, that vehicle will be destroyed.

The files if someone want to look, or use them: http://uppit.com/fqqgx58y6ysu/typhoon_files_08.zip
I want to live in a created universe. Virtual reality, here I come.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

They may be using a bit of their own material numbers in FH.

check out this thread http://bfmods.com/viewtopic.php?f=6&t=887&hilit=meshes
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re:

Post by Psycho »

freddy wrote:They may be using a bit of their own material numbers in FH.

check out this thread http://bfmods.com/viewtopic.php?f=6&t=887&hilit=meshes
that was what I was affraid of:). Thanks for the information. over ten years since I sat with 3dsmax.... I have to sleep on it I think hehe.
I want to live in a created universe. Virtual reality, here I come.
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Need help with custom objects in map

Post by Psycho »

Now I'm almost finished with my map. Got all vehicles, and tweaks working as supposed.
And now I just have this little sound scripting problem. I am adding alarms and sirens to activate with alternate fire for those operators that not have other functions on altfire.
So I started up with using the stuff from a willys horn. I added a "whoop whoop" siren for sea vessels (the one the destroyers in "The Guns of Navarone" use in the end of the movie). It isnt exactly the same sound, but close enogh for me, very har to find a proper wav sampling for that sound.

Anyway, to make the sampling only play once, I have to click very fast on alternate fire. If I press to slowly the sample plays several times and creates this weird echoing sound.

Here is the ssc:

Code: Select all

newPatch

load @ROOT/Sound/@RTD/whoopwhoop.wav
minDistance 180
dopplerOff
priority 1

*** Distance Volume ***
beginEffect
	controlDestination Volume
	controlSource Distance
	envelope Ramp
	param 30
	param 1000
	param 1
	param -1	
endEffect


And here is the con:

Code: Select all

rem *** whoopwhoopsiren ***
ObjectTemplate.create FireArms whoopwhoopsiren
ObjectTemplate.setNetworkableInfo PlaneFireArmInfo
ObjectTemplate.loadSoundScript Sounds/whoopwhoopsiren.ssc
rem ObjectTemplate.projectileTemplate MG42_Projectile
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize -1
ObjectTemplate.numOfMag 1
ObjectTemplate.magType 0
ObjectTemplate.fireOnce 1
ObjectTemplate.reloadtime 1
ObjectTemplate.roundOfFire 1
ObjectTemplate.AmmoType	6
ObjectTemplate.velocity 0
ObjectTemplate.setInputFire c_PIAltFire
How do I set it up so that you only can fire once, and then for example only can activate it after 10 seconds?

BTW, here are the samplings if anybody wants them: http://uppit.com/oox8d3e9qj9b/whoopwhoo ... ren_01.zip
I want to live in a created universe. Virtual reality, here I come.
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Need help with custom objects in map

Post by Psycho »

Solved the sound issue.
Since "ObjectTemplate.fireOnce 1" apparently only works on primary fire, I couldn't use the willys horn code as it was.
I hade to add a "fake" projectile also.

Code: Select all

rem *** whoopwhoopjsiren ***
ObjectTemplate.create FireArms whoopwhoopjsiren
ObjectTemplate.setNetworkableInfo PlaneFireArmInfo
ObjectTemplate.loadSoundScript Sounds/whoopwhoopjsiren.ssc
ObjectTemplate.projectileTemplate whoopwhoopjProjectile
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize 1
ObjectTemplate.numOfMag 999
ObjectTemplate.magType 0
rem ObjectTemplate.fireOnce 1
ObjectTemplate.autoReload 1
ObjectTemplate.reloadtime 3.5
ObjectTemplate.roundOfFire 1
ObjectTemplate.AmmoType	6
ObjectTemplate.velocity 0
ObjectTemplate.setInputFire c_PIAltFire

rem *** whoopwhoopjProjectile ***
ObjectTemplate.create Projectile whoopwhoopjProjectile
ObjectTemplate.createNotInGrid 1
ObjectTemplate.hasMobilePhysics 
ObjectTemplate.hasCollisionPhysics 
ObjectTemplate.hasResponsePhysics 
ObjectTemplate.timeToLive CRD_NONE/0/0/0
ObjectTemplate.gravityModifier 0
ObjectTemplate.material 213
ObjectTemplate.material2 -1
ObjectTemplate.stopAtEndEffect 1
ObjectTemplate.hasCollisionEffect 1
Adjusted the reloadtime so the sampling can't start before the first sample have played to end.


Another question: If I'm understanding right, the sonar is hard coded in the game? And the destroyer can detect a sub, but the sub's sonar can only detect the destroyers active sonar? I have tried to create a new sonar object just for test, but it won't work.
And if I understand it correctly you can alter the sonar to become a radar?
I want to live in a created universe. Virtual reality, here I come.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

i dont have much experience with sonars and radars but i know there´s radartowers in Battle of Britain so i guess you could look at that code if you need to build a radar.
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Need help with custom objects in map

Post by Senshi »

For full-fledged working radar, check Battle of Britain (radar towers) or check Desert Combat, where about every plane has radar.
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Need help with custom objects in map

Post by Psycho »

Strange, I just can't get it to work. Checked Battle of Britain and Desert Combat. And I'm quite sure I'm doing it right.

Code: Select all

rem *** GatoComplex ***
ObjectTemplate.create Bundle GatoComplex
ObjectTemplate.setNetworkableInfo GatoBodyInfo
ObjectTemplate.geometry Gato_Hull_m1
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate SubmarineSonar2
ObjectTemplate.sonarPos 1
ObjectTemplate.addTemplate GatoEngine
ObjectTemplate.setPosition 0/0/-30
ObjectTemplate.addTemplate GatoRudder
ObjectTemplate.setPosition 0/-3/-30
ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate GatoHullWing
ObjectTemplate.setPosition 0/-3/30
ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate GatoDriverSoldierSpawn
ObjectTemplate.setPosition 0/2.75/8.8
ObjectTemplate.addTemplate GatoEntry
ObjectTemplate.setPosition 5/1.9/18.5
ObjectTemplate.addTemplate GatoEntry
ObjectTemplate.setPosition 5/1.9/10.5
ObjectTemplate.addTemplate GatoEntry
ObjectTemplate.setPosition -5/1.9/18.5
ObjectTemplate.addTemplate GatoEntry
ObjectTemplate.setPosition -5/1.9/10.5
beginrem
ObjectTemplate.addTemplate GatoDaiHatsuSpawner
ObjectTemplate.setPosition 10.54/2.55/5.44
endrem

Code: Select all

rem *** GatoEntry ***
ObjectTemplate.create EntryPoint GatoEntry
ObjectTemplate.setEntryRadius 8

rem *** SubmarineSonar2 ***
ObjectTemplate.create SonarObject SubmarineSonar2
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.detectionRadius 800.0
rem ObjectTemplate.scanForEnemySonars c_True
ObjectTemplate.loadSoundScript ../../../../../objects/vehicles/sea/common/Sounds/sonarsub.ssc

rem *** divealarm ***
ObjectTemplate.create FireArms divealarm
ObjectTemplate.setNetworkableInfo PlaneFireArmInfo
ObjectTemplate.loadSoundScript Sounds/divealarm.ssc
ObjectTemplate.projectileTemplate whoopwhoopjProjectile
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize 1
ObjectTemplate.numOfMag 999
ObjectTemplate.magType 0
rem ObjectTemplate.fireOnce 1
ObjectTemplate.autoReload 1
ObjectTemplate.reloadtime 2
ObjectTemplate.roundOfFire 1
ObjectTemplate.AmmoType	6
ObjectTemplate.velocity 0
ObjectTemplate.setInputFire c_PIAltFire


rem *** GatoDaiHatsuSpawner ***
ObjectTemplate.create ObjectSpawner GatoDaiHatsuSpawner
ObjectTemplate.geometry spawnbutton_m1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.setObjectTemplate 1 DaiHatsu
ObjectTemplate.setObjectTemplate 2 DaiHatsu
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 20
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.useButtonRadius 2
ObjectTemplate.spawnOffset -5.5/-2/0
ObjectTemplate.damageWhenLost 10
Am I missing something?
I want to live in a created universe. Virtual reality, here I come.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

perhaps this line shouldn´t be remmed?

Code: Select all

rem ObjectTemplate.scanForEnemySonars c_True
http://bfmods.com/mdt/scripting/ObjectT ... onars.html
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re:

Post by Psycho »

freddy wrote:perhaps this line shouldn´t be remmed?

Code: Select all

rem ObjectTemplate.scanForEnemySonars c_True
http://bfmods.com/mdt/scripting/ObjectT ... onars.html
Tried both variants. That is the flag to detect other sonars. Without it the sonar should work as on the destroyer.
I want to live in a created universe. Virtual reality, here I come.
Post Reply