Home   Help Search Login Register  

Author Topic: SP buildings sitting right, MP buildings all wrong  (Read 1241 times)

0 Members and 1 Guest are viewing this topic.

xXNismoXx

  • Guest
SP buildings sitting right, MP buildings all wrong
« on: 07 Jan 2004, 21:41:54 »
ok, this is what I've done,

used game logic's to place buildings, eyed each one to sit them perfect in the editor, (sry not single player), everything honky dory then when I exported to multi, some of the buildings doubled, and some switched direction back to the original direction.  grrrrrrrrrrrrrrrrrrrr! none of the "game logics" are grouped,

I used this in the init field:

house= "Houseafdum_mesto2" createvehicle getpos this; house setdir getdir this


1. why is it happening, is this just how it works with "game logic" technique?

2. is there a better way of going about this?

3. wtf!!!!  >:(
« Last Edit: 07 Jan 2004, 21:43:16 by =TERA=-Forrest »

deaddog

  • Guest
Re:SP buildings sitting right, MP buildings all wrong
« Reply #1 on: 08 Jan 2004, 01:32:59 »
Game logics are only local to the server, not remote tools.  So any remote tool relying game logics will have a problem.  Use "empty markers" instead.

You can use Kegetys Editor addon to place houses the easy way.

xXNismoXx

  • Guest
Re:SP buildings sitting right, MP buildings all wrong
« Reply #2 on: 08 Jan 2004, 04:49:37 »
SWEAT! thanks dude, I'll give it a try, I was hoping no one would post saying I'd have to do it a totally diferent way ;)

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:SP buildings sitting right, MP buildings all wrong
« Reply #3 on: 08 Jan 2004, 15:12:47 »
I have also found that it helps to put in a game logic called server, that seems to keep a whole lot of weird things from happening

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:SP buildings sitting right, MP buildings all wrong
« Reply #4 on: 08 Jan 2004, 15:20:45 »
You can also place buildings the HARD way:

In the editor place a jeep, flagpole, etc, really any "empty" object and name it something easy to remember, I used to use BB1,BB2 etc
Then save the mission
Then open the mission.sqm file, find your building name, bb2 for example,
and change the vehicle to whatever building name you need and save the change.  Then go back and reload the map in the editor and when you preview you will have a building there!  Problem is, if you open the building in the editor to change the name, orientation or anything else, it will revert back to the unit!  This technique does work, but you will soon see why it is the hard way!

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:SP buildings sitting right, MP buildings all wrong
« Reply #5 on: 09 Jan 2004, 00:13:31 »
I believe the problem is not that the gamelogics are not
local on clients - why?

Gamelogic is local at the host (yep that's true)

But that doesn't mean that the gamelogic cannot
do things on clientside.

e.g: AI soldiers are local at the server, but they do also
exist on clientside (or who would then be the enemy).
A script executed from a server-local-ai will also run on
clientside.

A script executed from the waypoints of a gamelogic will
also run everywhere (even if the gl is not local there).

In your case you're using the gamelogic's init fields to
createvehicle something. Now createvehicle should only
run on one machine. Usually ppl go for the server here,
as the server exists in every mp game for sure.

Createvehicle being executed on only one machine will still
create a vehicle on the other machines (not like camcreate).

Now imagine there are 10 players being connected on a
dedicated server (+ server makes 11 * createVehicle)

Now even on a non-dedicated server there would be
10 vehicles being created.

Ah yeah Zombie: just putting in a gamelogic, called server,
does nothing but nothing. You surely need to use this
gamelogic, called server in conditions to decide, wether
a command will be executed on the server or not.

in scripts:
?(local Server): blablabla

or in an ingame condition field:

local Server

or vice versa:

?!(local Server): blablabla

or

? not (local Server)

or ingame:

!local Server

or

not local Server


Placing buildings the hard way is really an ancient OFP cwc
technique (where there we had no createVehicle commands).

Anyway, to put in a couple of gamelogics, just for getting
locations may cause unnecessary performance requirements,
therefore you could do another thing:

place one gamelogic onto the map
name it Server

place another gamelogic on the map (not grouped to the
Server)

Now make waypoints for this gamelogic, to all locations, where
you wanna create a building.

Into the first waypoint's condition field type: local Server
(this will ensure to let the gamelogic continue only on server
side).

use each waypoints onActivation field to create a building

like: house1 = "Houseafdum_mesto2" createvehicle getpos this; house setdir getdir this

The only part to change is: setdir xxx
instead of getdir this, as when using waypoints, you aren't really in control of the gamelogic's direction (should be easy
0 - 360)

That should it be

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted