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'm kindof new to all this, so what defines a "dummy" object?

I understand the principle of how to do it, but I'm not sure, ehh I'm, sure im coding it wrong:). But something like this should work?:

Code: Select all

rem *** AT25Launcher***
ObjectTemplate.create FireArms AT25Launcher
ObjectTemplate.setNetworkableInfo PlaneFireArmInfo
ObjectTemplate.aiTemplate SupplyboxGunAI
ObjectTemplate.projectileTemplate AT25SpawnProjectile
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize 1
ObjectTemplate.numOfMag 999
ObjectTemplate.velocity 0
ObjectTemplate.autoReload 1
ObjectTemplate.reloadtime 60
ObjectTemplate.roundOfFire 1
rem ObjectTemplate.setInputFire c_PIAltFire
ObjectTemplate.addFireArmsPosition 0/0/0 0/0/0
ObjectTemplate.AmmoType	10

rem *** AT25SpawnProjectile***
ObjectTemplate.create Projectile AT25SpawnProjectile
ObjectTemplate.createNotInGrid 1
ObjectTemplate.geometry Ammobox_m1
ObjectTemplate.addTemplate AT25DummySpawner
ObjectTemplate.hasDynamicShadow 1 
ObjectTemplate.setHasMobilePhysics 1
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.setHasResponsePhysics 1
ObjectTemplate.setHasPointPhysics 0
ObjectTemplate.hasCollisionEffect 0
ObjectTemplate.invisible 1
ObjectTemplate.timeToLive CRD_NONE/20/0/0
ObjectTemplate.gravityModifier 1
ObjectTemplate.dieAfterColl 0
ObjectTemplate.material 70
ObjectTemplate.mass 50
ObjectTemplate.drag 30
rem -------------------------------------



rem *** AT25Spawner ***
ObjectTemplate.create ObjectSpawner AT25DummySpawner
ObjectTemplate.setObjectTemplate 1 AT25Dummy 
ObjectTemplate.setObjectTemplate 2 AT25Dummy
rem ObjectTemplate.holdObject 1
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 20
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.spawnOffset 0/0/0
ObjectTemplate.team 2
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.damageWhenLost 10

rem *** AT25Dummy ***
ObjectTemplate.create SimpleObject AT25Dummy
ObjectTemplate.geometry Ammobox_m1
ObjectTemplate.addTemplate AT25Spawner
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.drag 2
ObjectTemplate.mass 3000
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.hasArmor 1
ObjectTemplate.hitpoints 10
ObjectTemplate.maxhitpoints 10
ObjectTemplate.material 45


rem *** AT25Spawner ***
ObjectTemplate.create ObjectSpawner AT25Spawner
ObjectTemplate.setObjectTemplate 1 AT25 
ObjectTemplate.setObjectTemplate 2 AT25
ObjectTemplate.holdObject 1
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 20
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.spawnOffset 0/0/0
ObjectTemplate.team 2
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.damageWhenLost 10
The chain works until AT25Dummy spawns, but then nothing more happens.
I want to live in a created universe. Virtual reality, here I come.
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 »

A dummy object is ...a dummy...an object without gameplay function, just used as a "helper" in workarounds. That's why they usually are invisible as well ;) .

Your code is correct. Up to the Dummy ;) . For some reason however, you use two dummy objects and spawners, that shouldn't be necessary, really. I have commented the lines with <----- you should correct.

Code: Select all

rem *** AT25Launcher***
ObjectTemplate.create FireArms AT25Launcher
ObjectTemplate.setNetworkableInfo PlaneFireArmInfo
ObjectTemplate.aiTemplate SupplyboxGunAI
ObjectTemplate.projectileTemplate AT25SpawnProjectile
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize 1
ObjectTemplate.numOfMag 999
ObjectTemplate.velocity 0
ObjectTemplate.autoReload 1
ObjectTemplate.reloadtime 60
ObjectTemplate.roundOfFire 1
rem ObjectTemplate.setInputFire c_PIAltFire
ObjectTemplate.addFireArmsPosition 0/0/0 0/0/0
ObjectTemplate.AmmoType   10

rem *** AT25SpawnProjectile***
ObjectTemplate.create Projectile AT25SpawnProjectile <---- the projectile itself can be your dummy object just fine, no need for another step
ObjectTemplate.createNotInGrid 1
ObjectTemplate.geometry Ammobox_m1
ObjectTemplate.addTemplate AT25DummySpawner <----no need, just set the "true" AT25Spawner (without dummy) objectspawner here.
ObjectTemplate.hasDynamicShadow 1 
ObjectTemplate.setHasMobilePhysics 1
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.setHasResponsePhysics 1
ObjectTemplate.setHasPointPhysics 0
ObjectTemplate.hasCollisionEffect 0
ObjectTemplate.invisible 1
ObjectTemplate.timeToLive CRD_NONE/20/0/0 <---- If your spawndelay is 20, setting a TTL of 20 can be critical in multiplayer. Best set this to 21 to make 100% certain the spawner has time to spawn.
ObjectTemplate.gravityModifier 1
ObjectTemplate.dieAfterColl 0
ObjectTemplate.material 70
ObjectTemplate.mass 50 <----- this is the mass of your dummy, best set it to a higher mass so it is more "sticky".
ObjectTemplate.drag 30
rem -------------------------------------


->-<-<-<-<->_ Delete the paragraph below
rem *** AT25Spawner ***
ObjectTemplate.create ObjectSpawner AT25DummySpawner
ObjectTemplate.setObjectTemplate 1 AT25Dummy 
ObjectTemplate.setObjectTemplate 2 AT25Dummy
rem ObjectTemplate.holdObject 1
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 20
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.spawnOffset 0/0/0
ObjectTemplate.team 2
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.damageWhenLost 10

->-<-<-<-<->_ Delete the paragraph below
rem *** AT25Dummy ***
ObjectTemplate.create SimpleObject AT25Dummy
ObjectTemplate.geometry Ammobox_m1
ObjectTemplate.addTemplate AT25Spawner
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.drag 2
ObjectTemplate.mass 3000
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.hasArmor 1
ObjectTemplate.hitpoints 10
ObjectTemplate.maxhitpoints 10
ObjectTemplate.material 45


rem *** AT25Spawner ***
ObjectTemplate.create ObjectSpawner AT25Spawner
ObjectTemplate.setObjectTemplate 1 AT25 
ObjectTemplate.setObjectTemplate 2 AT25
ObjectTemplate.holdObject 1
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 20
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.spawnOffset 0/0/0
ObjectTemplate.team 2
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.damageWhenLost 10
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Need help with custom objects in map

Post by Psycho »

That is very much like my current working code I began with.

Code: Select all

rem *** AT25Launcher***
ObjectTemplate.create FireArms AT25Launcher
ObjectTemplate.setNetworkableInfo PlaneFireArmInfo
ObjectTemplate.aiTemplate SupplyboxGunAI
ObjectTemplate.projectileTemplate AT25SpawnProjectile
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize 1
ObjectTemplate.numOfMag 999
ObjectTemplate.velocity 0
ObjectTemplate.autoReload 1
ObjectTemplate.reloadtime 60
ObjectTemplate.roundOfFire 1
rem ObjectTemplate.setInputFire c_PIAltFire
ObjectTemplate.addFireArmsPosition 0/0/0 0/0/0
ObjectTemplate.AmmoType	10


rem *** AT25SpawnProjectile***
ObjectTemplate.create Projectile AT25SpawnProjectile
ObjectTemplate.geometry Ammobox_m1
ObjectTemplate.hasDynamicShadow 1 
ObjectTemplate.setHasMobilePhysics 1
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.setHasResponsePhysics 0
ObjectTemplate.setHasPointPhysics 0
ObjectTemplate.hasCollisionEffect 0
ObjectTemplate.invisibleAtEndEffect 1
ObjectTemplate.hasArmor 1
ObjectTemplate.hitPoints 100
ObjectTemplate.maxHitPoints 100
ObjectTemplate.explosionDamage 0
ObjectTemplate.timeToLive CRD_NONE/22/0/0
ObjectTemplate.gravityModifier 1
ObjectTemplate.dieAfterColl 0
ObjectTemplate.radius 0
ObjectTemplate.material 70
ObjectTemplate.noFFSound 1
ObjectTemplate.mass 5000
ObjectTemplate.drag 30
rem -------------------------------------

ObjectTemplate.addTemplate AT25Spawner

rem -------------------------------------


rem *** AT25Spawner ***
ObjectTemplate.create ObjectSpawner AT25Spawner
ObjectTemplate.setObjectTemplate 1 AT25 
ObjectTemplate.setObjectTemplate 2 AT25
ObjectTemplate.holdObject 1
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 20
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.spawnOffset 0/0/0
ObjectTemplate.team 2
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.damageWhenLost 10
But, When the spawner is created so is the spawning object. How exactly do I delay the first object spawn?
As now the spawner spawns the AT25 before it reach the ground.

ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 20
or
ObjectTemplate.SpawnDelay 20
only start counting from the first spawned object has died.
And "ObjectTemplate.SpawnDelayAtStart 20" only apply at the round start.

Maybe its easier to make the cannon mobile and adjust mass and inertia modifier so it stands still on ground?
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 »

Psycho wrote: Maybe its easier to make the cannon mobile and adjust mass and inertia modifier so it stands still on ground?
that could be a good idea to try.

how to using a effect to spawn something could be something like this:

Code: Select all

ObjectTemplate.create "your_object"
ObjectTemplate.hitpoints 20
ObjectTemplate.maxhitpoints 20
ObjectTemplate.criticalDamage 20
ObjectTemplate.hpLostWhileCriticalDamage 2.5
ObjectTemplate.addArmorEffect 10 name_of_your_Spawner 2/5/0
heres some example for explain it a bit more, the Elco80 and Type38 original have some code to spawn rafts but its broken in multiplayer, so i use this code to correct the problem.

Code: Select all

ObjectTemplate.Active Elco80
ObjectTemplate.addArmorEffect 100 ArtillerySpawner 2/5/0

ObjectTemplate.Active Type38
ObjectTemplate.addArmorEffect 100 ArtillerySpawner 2/5/0

ObjectTemplate.create ObjectSpawner ArtillerySpawner
ObjectTemplate.setObjectTemplate 3 Elco80Raft
ObjectTemplate.SpawnDelay 0
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 120
ObjectTemplate.Distance 200
ObjectTemplate.team 3
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 »

Going via effect works too, but in no way better than the PCO approach. Mainly due to possible MP issues (effects not always are executed correctly via network things).

Well, the SpawnDelay issue is odd, indeed. I didn't think of that. In that case, your previous approach was probably the only workaround...
On the other hand, making your weapon mobile would be a smart idea in any case, there's a reason it is done that way by every other mod for static deployable weapons :) . You will always have quirks if you leave it static, the random chance of it settling "good" is too bad. Just add mobilePhysics 1, a good amount of mass (some dozen thousands) and give it a material (tank works best for cannons, this means they behave like a tank when they are rammed: They can be moved, but not easily and they don't flip all over the world like a jeep.). Drag is not required, it's mostly for air vehicles as it describes air resistance. Not really necessary for a static ground weapon.
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Need help with custom objects in map

Post by Psycho »

Thanks for all your insights. I will rest my brain about this for a while, and get back to it with a fresh mind I hope;).
Until that time I made a temporary "fix".

I spawn the cannon not as a mobile object, and very close to the rear of the vehicle. In that way I minimize the offset to the ground as much as possible. And I also spawn it a little bit low, since it looks better if the spawned object wheels is a little bit down in the ground compared to floating in the air.

It is kind of strange, that when they made the game didn't think of triggerable spawnpoints....
I want to live in a created universe. Virtual reality, here I come.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Need help with custom objects in map

Post by freddy »

Senshi wrote:Going via effect works too, but in no way better than the PCO approach. Mainly due to possible MP issues (effects not always are executed correctly via network things).
after using this tehnique some years in our public server i can testify it works very satisfactly.

how long have you used it?
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 »

I tried the effects thingie several times on our project server for our campaign mod. When playing on it "solo" or when playing offline everything worked like a charm, but online there was a random number of quirks. Sometimes the effect would not "play" because it was out of the field of view of a player (especially on very large maps or maps with a short viewdistance) and cause the spawned object to not be available on the client PC until it was "forced" to appear once it hits the viewdistance or enters the field of view. This obviously is not visible but it's audible (I had some extensive work done on the sound ranges in our mod, allowing identification of noisy vehicles long before you saw them, usually).

As the dummy object approach worked just fine I did no further research on the effect object method, true. It's been some years I worked on this, anyway. And as long as it works...;)
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Need help with custom objects in map

Post by Psycho »

As I'm resting from that spawner issue, I'm currently working on turning a TU4 into a B29 StratoFortress. for those who not know, The Tu4 is a pirate copy of a B29.
Anyway, Since the TU4 is russian, I have to change the skin so it looks american.

This is how the modders presented the TU4: http://operationanubis.uat.edu/screens/screen024.jpg.
But in game it doesent look that nice I'm sorry to say.

How do I make the skin reflect in that metal way as in the picture?

Changing markings to american I think I can handle. Made som testskins allready in tga.
Is there any difference to have the game use tga instead for dds?

Or, if there are someone here that are skilled in 3dsmax, modelling and skinning and would like to fix up this TU4 into a B29 for me I would be very happy:).

There are also som minor sloppy moddeling things in the model that maybe need fixing.
Som bad alignment between the fuselage and the canopy.
And other visual problems with the cockpit.

I also had to change propellers because they was bigger then the blur, and in another colour hehe. So I just used the propeller from the mustang.

Or is there anyone that allready have a B29 finished? I can't find any mods that contain that plane..... only that TU4.
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 »

Ok, I had to learn some photoshop. So now I have fixed up that B29 superfortress. It looks more made in metal now, though not at the level I wanted.
Added stickers and some nose art. Also I added another turret and had to move the nose wheel to the correct position. And I adjusted all the turrets so it looks more like the real plane.
The plane still lacks some minor details, like windows for the rear gunner and proper wheelbays and bay doors. IF I knew how, I also would correct the meshes shape and adjust the textures.

Here is a video of the plane: http://www.youtube.com/watch?v=kSzrTJVsO8I
I want to live in a created universe. Virtual reality, here I come.
Post Reply