Jump to content
Sign in to follow this  
[lol]clan killer bee

Submarine depth !

Recommended Posts

Hello communityl,

I have a idea for a mission with a submarine witch has to stay static.

I found that there is the Submarine_01_F this is a Civilian Sub.

I got it to spawn with this code:

_veh = createVehicle ["Submarine_01_F", [getMarkerPos "Sub" select 0,getMarkerPos "Sub" select 1, -40], [], 0, "NONE"];

This is a invisible Helipad and added a marker called Sub.

The Sub spawns and also on the depth, problem is though that he start to go up and float at the surface.

Is there anyone who has a idea or know how to fix this ? :j:

Thank you.

Ps if this has already been asked sorry I did a search for it, but didn't find anything bout this yet.

Share this post


Link to post
Share on other sites

Thank you Greenfist for the reply.

Hmm I'm don't not know that much of scripting but if I wanted to check shouldn't I give the created object a name ( Like Sub1 ) when it is created and how and were do I place that in my script ?

If not and I would have to add the mass code were do I have to place it in mine code for it to work ?

Share this post


Link to post
Share on other sites

Thanks for the reply,

I have added to mine line like this

_veh = createVehicle ["Submarine_01_F", [getMarkerPos "Sub" select 0,getMarkerPos "Sub" select 1, -40], [], 0, "NONE"]; this setMass 10;

Sub still raises up too the surface :mad:

Is this not a code that you put in the init of the object you place on the map and given a name ?

This sub needs too spawn first or do I misunderstood you ?

Share this post


Link to post
Share on other sites
_veh = createVehicle ["Submarine_01_F", [getMarkerPos "Sub" select 0,getMarkerPos "Sub" select 1, -40], [], 0, "NONE"]; _veh setMass 10;

Share this post


Link to post
Share on other sites
_veh = createVehicle ["Submarine_01_F", [getMarkerPos "Sub" select 0,getMarkerPos "Sub" select 1, -40], [], 0, "NONE"]; _veh setMass 10;

Tried it but this gives me the following message.

local variable local space

:butbut:

Share this post


Link to post
Share on other sites

It should be "local variable in global space" i guess.. =) ...you really have to learn some elemantary scripting basics... ;)

So try:

mySub = createVehicle ["Submarine_01_F", [getMarkerPos "Sub" select 0,getMarkerPos "Sub" select 1, -40], [], 0, "NONE"]; mySub setMass 10;

Share this post


Link to post
Share on other sites

Thank you guy a lot, got it to work SP (editor) need to see if it works in MP.

Like I said thank you for the help !

Two thumb up, one subdown.

---------- Post added at 13:04 ---------- Previous post was at 13:03 ----------

This might be weird too ask but does anyone know how you can add some bubble to the sub like you do with the diver.

Some times just a few bubbles ?

Edited by [LOL]clan Killer Bee

Share this post


Link to post
Share on other sites

This is what i use for divers (put it in your init.sqf.):

if (!isDedicated) then {
_plankton = "#particlesource" createVehicleLocal (position player);
_plankton setParticleClass "PlanktonEffect";
_plankton attachto [player,[0,2,1.3]];
};

And this is what i found on BIS page, but i have newer used it and newer tested... but it seems interessting: breathingBubblesEffect

Share this post


Link to post
Share on other sites

Well got it to work !

I had to change the script to:

if (!isDedicated) then {
_plankton = "#particlesource" createVehicleLocal (position mySub);
_plankton setParticleClass "PointBubbles1";
_plankton attachto [mySub,[0,2,1.3]];};

Took me a while to find the name for the bubble (s)

Need to find out how to make a little less bubs and on more spots !

Need too look of I need to change this in the code:

[mySub,[0,2,1.3]]

or see if there is another PointBubbles1 like PointBubbles2 or maybe PointBubbles3

Here is a pic of the bubbles

http://oi59.tinypic.com/eafakm.jpg (639 kB) ;)

Edited by [LOL]clan Killer Bee

Share this post


Link to post
Share on other sites

Well seems I have cheered a little too hard !

Just got it running on a dedicated server and it went bonkers !

First off all no bubbles. :(

Second It created with 2 peeps a very fast version of the sub !

http://oi60.tinypic.com/2mmhi4l.jpg (217 kB)

I might need this on the init.sqf, but not sure ?

//---JIP Check (This code should be placed first line of init.sqf file)
if (!isServer && isNull player) then {isJIP=true;} else {isJIP=false;};

// Wait until player is initialized
if (!isDedicated) then {waitUntil {!isNull player && isPlayer player};};

This might atleast prevent the multiple copy of the one sub.

The bubbles I have no idea why it is not working in MP ?:j:

Share this post


Link to post
Share on other sites

I have no idea what you are doing... but the creation of the sub should be done only by the server! Something like : if (isServer) then {blabla};

And the bubbles have to be started at every client. So you have to start the bubble part after the sub was created by the server and the clients know what "mySub" is... ;)

Share this post


Link to post
Share on other sites

Make the sub in the initServer.sqf (search for Arma 3 Event Scripts), and use BIS_fnc_MP for the bubbles, problems should be solved.

Share this post


Link to post
Share on other sites

Thank you for the support guys, I gonna take a look at it the coming days, Christmas shopping and such.

Will take a look at is as fast as possible !

Forgot to place this LOL

Make the sub in the initServer.sqf (search for Arma 3 Event Scripts), and use BIS_fnc_MP for the bubbles, problems should be solved.

I'm not script person, will try though, always want to learn something if I got the change, so no guarantees.

---------- Post added at 23:21 ---------- Previous post was at 21:41 ----------

Holy something this is all new to me !

Use to make a lot of mission in OFP at the time :p

So far I have tested the Sub and is seems to work with the

initServer.sqf

Now after reading the Event script page I see this also these optoins.

 
initServer.sqf is executed (server only)
initPlayerLocal.sqf is executed
initPlayerServer.sqf is executed (server only)

Now as I just had it on MP by myself I wonder what if a JIPPer got in does it generate it the sub again or is the one at the start been seen and not done again, or does it get seen when it was .

When do I use the player local and when the Jip compatible ?

Share this post


Link to post
Share on other sites

Ok, so the initServer is executed once on the server only, at mission start, the initPlayerServer is executed at both mission start and for every JIP, only on the server, and the initPlayerLocal is executed once on mission start and for every JIP, but only on the client's machine. So that being said, you might want to go with initPlayerServer, but I'm currently on my phone and can only answer in a limited capacity, so hopefully someone will correct me if needed :p.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×