Topic: mCreateMapObject  (Read 3072 times)

0 Members and 1 Guest are viewing this topic.

Centauri Vaughn

  • Guest
mCreateMapObject
« on: November 10, 2003, 07:18:37 pm »

Greetings all,

I have run into a small problem using mCreateMapObject.
It seems that for a multiplayer mission only the host will see map objects that are scripted into the game vs editing the map via "MissionMaps.cpp".

i.e: fMissionInfo->mCreateMapObject('&',13,13); creates a nebula on grid x 13 and grid y 13.  Like I said , only the host will see the nebula (along with effects) and not the other players (clients).

Any ideas?  

Thanks.  

FPF_TraceyG

  • Guest
Re: mCreateMapObject
« Reply #1 on: November 10, 2003, 11:05:13 pm »
Is this for SFC2 or SFC3? Also, is it a skirmish mission or a campaign mission?

Centauri Vaughn

  • Guest
Re: mCreateMapObject
« Reply #2 on: November 10, 2003, 11:41:14 pm »
My apologies Tracey,

Its for SFC2,  API for OP,  Multiplayer Skirmish.

Thanks.

 

FPF_TraceyG

  • Guest
Re: mCreateMapObject
« Reply #3 on: November 13, 2003, 05:34:55 am »
That's an odd one. The host is supposed to use the 'master' copy of the map so to speak. Even if the other players can't see map objects, their effects will still be applied if they exist on the host map. At least this is the case in a D2 mission. Objects added to the map by a client script that do not match the host script cause errors, and the host script map objects (such as asteroids) will still be collidable by all players, even though they can't be seen (hmmm, might make for an interesting mission...  ).
My only thoughts are simply that the client scripts are not creating the nebula, and that perhaps because the nebula is different to other map objects (it covers the whole map), that the code governing its behaviour is different to other map objects. Check where the nebula is actually being created in the script itself. I have not encountered any problems at all where the map selected from Mission Maps.cpp contains a nebula however, since this is generated during the mission load by all players. The mCreateObject method shouldn't be necessary to use at all, if the map selected contains a nebula, unless you want the nebula to appear at some point after the mission begins (a nebula creation mission? a supernova might do that).

Karnak

  • Guest
Re: mCreateMapObject
« Reply #4 on: November 13, 2003, 10:55:34 am »
Try using the gScriptInterface.mIsHost() function to ascertain if the code is being run by the host or client players.  In addition, use the  ::OnHostChanged() method to trap for any change of host due to player drops.  Put debug kScienceScript message statements or fprintf statements to HDD in these code segments to try and see if the mCreateMapObject() function is being called by the client players.
« Last Edit: December 31, 1969, 06:00:00 pm by Karnak »

Centauri Vaughn

  • Guest
Re: mCreateMapObject
« Reply #5 on: November 14, 2003, 05:59:26 pm »

Thanks all for the info.

I discovered that it was my condition statements that was the problem, not the code .

Computers...Nothing but smart dummies.

 

Karnak

  • Guest
Re: mCreateMapObject
« Reply #6 on: November 14, 2003, 06:44:56 pm »
Quote:


Thanks all for the info.

I discovered that it was my condition statements that was the problem, not the code .

Computers...Nothing but smart dummies.

   




Glad to hear it, CV.

I just hope the Computers stay as smart dummies before they get too smart and take over, hehe.