Page 1 of 1

Character instantly leaves from my vehicle

Posted: Mon Apr 25, 2011 10:38 am
by Ruuga
So I made a "vehicle" called sauna. The problem is that mostly every time when I enter the sauna the character leaves from it. Sometimes it stays in the sauna but mostly it exits. What have I done wrong?

Code: Select all

ObjectTemplate.create PlayerControlObject sauna_heal
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.setNetworkableInfo sauna_heal_body
ObjectTemplate.geometry sauna
ObjectTemplate.loadSoundScript Sounds/sauna.ssc
objectTemplate.cullRadiusScale 3.0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.explosionRadius 5
ObjectTemplate.explosionDamage 4
ObjectTemplate.setVehicleIcon "Vehicle/empty.dds"
ObjectTemplate.exitTimer 1
ObjectTemplate.drag 2
ObjectTemplate.mass 200000
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.hasArmor 1
ObjectTemplate.hitpoints 100
ObjectTemplate.maxhitpoints 100
ObjectTemplate.material 121
ObjectTemplate.speedMod 1
ObjectTemplate.criticalDamage 20
ObjectTemplate.explosionForceMod 1
ObjectTemplate.addArmorEffect 0 e_ExplAni01 0/0/0
ObjectTemplate.damageFromWater 0
ObjectTemplate.timetoliveafterdeath 0
ObjectTemplate.FadeAtTimeToLiveAfterDeath 0
ObjectTemplate.setMinimapIcon "empty.dds"

ObjectTemplate.addTemplate sauna_Entry
ObjectTemplate.setPosition 3/1.5/5
ObjectTemplate.addTemplate paikka1
ObjectTemplate.setPosition 3/1.5/5
ObjectTemplate.setRotation 180/0/0
ObjectTemplate.addTemplate mediclockerRepairpoint
ObjectTemplate.setPosition 5/1/0
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.addTemplate sauna_Camera
ObjectTemplate.setPosition 3/1.75/5
ObjectTemplate.setRotation 180/0/0

ObjectTemplate.create EntryPoint sauna_Entry
ObjectTemplate.setEntryRadius 3

rem *** Seat ***
ObjectTemplate.create SeatObject paikka1
ObjectTemplate.seatFlags c_SeatShowFullBodySoldier

rem *** Kamera ***
ObjectTemplate.create Camera sauna_Camera
ObjectTemplate.setMinRotation -80/-45/0
ObjectTemplate.setMaxRotation 70/45/0
ObjectTemplate.setPivotPosition 0/0.25/0.2
ObjectTemplate.setMaxSpeed 200/200/0
ObjectTemplate.setAcceleration 100000/100000/0
ObjectTemplate.setInputToYaw c_PIMouseLookX
ObjectTemplate.setInputToPitch c_PIMouseLookY
ObjectTemplate.setInputToRoll c_PIMenuSelect3

ObjectTemplate.create SupplyDepot mediclockerRepairpoint
ObjectTemplate.radius 4
ObjectTemplate.team 0
ObjectTemplate.workOnVehicles 0
ObjectTemplate.workOnSoldiers 1
ObjectTemplate.setHealth -1 4.0 0
Pastebin:
http://pastebin.com/ekUgQw7Z

Re: Character instantly leaves from my vehicle

Posted: Mon Apr 25, 2011 12:10 pm
by archer
It happened to me once when I had forgotten to add a NetworkableInfo to my PCO. Make sure that sauna_heal_body is defined.
The fact that your PCO has no LodObject (or any kind of geometry) may also be a problem. Theoretically it's not needed, but BF doesn't like it when you don't add it.
Also, try adding hasMobilePhysics 0 to your PCO.

Anyway, if I were you, I'd rather copy flak38 or aa_allies and then modify it to do what you want it to do. In BF there are lots of properties that in theory are not required, but in practice the game goes crazy when they are not present. That's why it's always safer to copy existing vehicles and work from there. I always do my static PCOs like that.

If you happen to have the Galactic Conquest mod installed, you can take a look at bacta tank, it seems to do exactly what you want.

Re: Character instantly leaves from my vehicle

Posted: Mon Apr 25, 2011 4:39 pm
by Apache Thunder
Also note that network info is case sensitive. If you define network info, the network info template you create must also match what you used on the PCO letter by letter. That includes any capital letters you may have used.

Re: Character instantly leaves from my vehicle

Posted: Mon Apr 25, 2011 5:26 pm
by Swaffy
Simply looking at threads in the past would have answered the question for you.
We have many threads here on this forum, and so most of your issues have been found by other people.

Re: Character instantly leaves from my vehicle

Posted: Mon Apr 25, 2011 10:21 pm
by fo0k
I can't say I remember any threads on this. Certainly not worthy of a bit of trolling swaffy. :/

Re: Character instantly leaves from my vehicle

Posted: Tue Apr 26, 2011 7:31 pm
by Swaffy
I did see a thread about "Make player not be able to leave vehicle," so that's probably what got me hung up.
viewtopic.php?f=6&t=781

Re: Character instantly leaves from my vehicle

Posted: Tue Apr 26, 2011 9:43 pm
by Senshi
The instantexit always is caused by messed up networkinfo. Heed the info the others elaborated on and you should be fine. NetworkInfo is not very obvious to understand, but it's relatively easy to go with a I-don't-know-what-I-actually-code-but-it-works-so-who-cares approach. Just take a look at the network.con of any other object and code it according to the same template (always use Linear method, that is the correct one in 99% of cases and the most stable one anyway).

If you'd try your map on a LAN server (dedicated one, even local) you would get an insta-CTD due to the faulty networkinfo.

Re: Character instantly leaves from my vehicle

Posted: Wed Apr 27, 2011 11:12 am
by Jeronimo
Senshi wrote:[the] I-don't-know-what-I-actually-code-but-it-works-so-who-cares approach
I lawled hard! Sounds so familiar :mrgreen:

Re: Character instantly leaves from my vehicle

Posted: Wed Apr 27, 2011 7:39 pm
by Ruuga
I don't really understand the network.con but I have this code in it:

Code: Select all

NetworkableInfo.createNewInfo sauna_heal_body
NetworkableInfo.setPredictionMode PMLinear