Home   Help Search Login Register  

Author Topic: Roadways not working  (Read 5897 times)

0 Members and 1 Guest are viewing this topic.

Offline Absolution

  • Members
  • *
Roadways not working
« on: 18 Mar 2010, 03:09:21 »
Here's the story: I've modeled buildings, with interiors, just fine in the past. I am currently working on an amphibious warfare ship... roughly the size of the LHD featured in the game. I am working on the flight deck and can't get the game to recognize the roadway geometries I placed down; I fall straight through every time.

At first I thought it was the size of the roadway geometry (a square roughly 40m long and 30m wide) so I made smaller ones (10m x 10m). Nothing. I made sure there were no textures present. I made sure that the vectors were all normal and that the geometries weren't "inside out". I tested the exact same process on a different model I am working on and I can get those to work.

The only different I can tell so far is that, obviously, my ship is out in the water. Is there something goofy about the water that causes these holes? Why does the LHD work?

I've looked at the FSF and it works just fine out in the water so there's something I am missing. What is it?


---
Update
Well I can understand why I didn't get any replies... it wasn't a well worded question. I've done some digging and I've narrowed it down to physical size limits or in other words its too damn big. What I have not been able to figure out is what that limit literally is.

How tall, how long, and how wide can a model be before it starts bugging out? I don't mean how complex it can be, I understand polygon limits.
« Last Edit: 20 Mar 2010, 21:16:30 by Absolution »

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Roadways not working
« Reply #1 on: 21 Mar 2010, 05:43:33 »
Roadway lods will still normally work, even if the object is too large BUT its highly likely it will have "holes". i.e. as you are walking about you can suddenly fall.
So the size may not be your real problem.

As for size.
64 meters is the so called "limit", but there are other factors which seem to effect geometry and roadway loads (like exactly where you place an object on terrain believe it or not), so I highly recommend ANY dimension is no greater than 50 meters.

TIP:
For ships, the GEOMETRY LOD will generally "work" along its full length, enough for ship to ship collisions for example.
But a trick you may want to try is for ROADWAY LODS, make a separate smaller invisible addon which only has geometry, memory, 1 resolution lod with nothing in it and of course a Roadway LOD. Then use ATTACHTO to put this "deck" on your ship.
To line it all up at first, place some markers in your Resolution lod until you have finished, then delete the content in the resolution lod.

Offline Absolution

  • Members
  • *
Re: Roadways not working
« Reply #2 on: 21 Mar 2010, 05:52:21 »
Okay that helps. Is this ATTACHTO the way they pieced together the LHD? Is there a tutorial somewhere on how to make it / use it?

I was going to make several, fully functional, parts of the ship but I like your tip and would like to explore it.

*edit*
Another poorly worded question, sorry. What I meant was how can I script it so that the ATTACHTO is done ahead of time and a person would only have to place 1 object in the editor (like the "Place-able LHD" Addon).
« Last Edit: 21 Mar 2010, 05:55:48 by Absolution »

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Roadways not working
« Reply #3 on: 21 Mar 2010, 13:16:36 »
Quote
Is this ATTACHTO the way they pieced together the LHD?
No actually, its all 1 model. It is very much pushing the dimension limits but the GEO and Roadway LODs haven't failed me yet in testing.

Quote
Is there a tutorial somewhere on how to make it / use it
Arh, not that Ive seen.

Quote
What I meant was how can I script it so that the ATTACHTO is done ahead of time and a person would only have to place 1 object in the editor
Easy enough. Just a script in the INIT Event Handler in the Config. Example

CONFIG.CPP
Code: [Select]
class EventHandlers
      {
init = "[_this select 0] exec ""\GNT_FSF\scr\FSFInit.sqs""; ";

FSFInit.sqs
Code: [Select]
if (!isServer) exitWith {}
_ship = _this select 0

[_ship] execvm "\GNT_FSF\scr\FSFposDeck.sqf"

FSFposDeck.sqf
Code: [Select]
_ship = _this select 0;
_Deck = "Land_FSFDeck" createvehicle[0,0,0];
_Deck attachto [_ship,[0,0.8,0.0]];
_Deck setDir (direction _ship)-180;

Offline Absolution

  • Members
  • *
Re: Roadways not working
« Reply #4 on: 24 Mar 2010, 00:58:11 »
Okay Attachto is easy enough. I took my single large model and cut it up in such a way that they fall into the correct place if you were to place each object right on top of the other in the editor.

That, however, makes it easy to goof up. So, I created a single point in the memory LOD in each of the three PBOs. These three points should be in the identical places in each PBO so that an attachto with a displacement of [0,0,0] "should" make them all line up.

It doesn't work. My models pile up on top of each other. I must have done something wrong with the memory LOD. Does it need a 3d object like a cube to work or is a single point okay?

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Roadways not working
« Reply #5 on: 24 Mar 2010, 17:19:44 »
In Property Name window, you may want to add
autocenter
=
1

or try
=
0

Offline Absolution

  • Members
  • *
Re: Roadways not working
« Reply #6 on: 04 May 2010, 04:39:41 »
I am back for more trouble and since it applies there is no sense in starting a new thread...

Roadways now work. I cut back on their overall size and chopped up the model into 3 main parts. My main goal was to provide an amphibious platform from which to launch and retrieve boats and amphibious vehicles. There are two problems I am facing:

-----
1) My ship is designed with a large well deck (similar to the FSF). I spawn a CRRC floating next to a pier so someone on the ship can access it. The problem is that I can not "get in" to the CRRC. I can access the "gear" menu. I have jumped off the pier and swam next to the CRRC and still no go.

During a test I spawned the CRRC outside the footprint of my ship and my player swimming in the ocean next to the CRRC. I can now get into the CRRC. So it appears to bug out on me only when the CRRC is spawned within the footprint of the ship. Thoughts?

-----
2) I can launch LAVs from inside the hold, down a ramp and into the water. I can "sail" the LAV to shore, drive up the beach and off into the woods. I can not go the other way. When I approach my ramp within the hold of the ship the LAV drives straight through it and tends to "freeze" in place mid way through.

The roadway LOD works fine as I can both walk and drive down the ramp. As a test I jumped into the water and attempted to walk back up the ramp. I clipped through it like in the LAV until a wave lifted my character high enough and he "snapped" onto the ramp. He was then able to walk around unimpeded.

Here's another kicker... When I grab a CRRC from shore and drive it into the hold and attempt to "drive" it up the ramp it does not clip and beaches itself accurately onto the ramp. However, when I "get out" my character is warped onto the flight deck 30m straight up.
-----

Any thoughts/help? The whole point of my adventure here is being defeated by quirkiness.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Roadways not working
« Reply #7 on: 04 May 2010, 14:38:19 »
1 - Have you looked at my FSF addon? Check the code, but I think I spawn the RHIBs at 0,0,0 then attach them.
2 - is there a GEO lod mass behind the actual ramp?
3 - "character is warped onto the flight deck 30m straight up" Normal. Because the game engine places you on "high ground" ..... highest being the deck.

Offline Absolution

  • Members
  • *
Re: Roadways not working
« Reply #8 on: 05 May 2010, 04:07:42 »
Yes, sir. I have unpacked the FSF and taken a gander. I cant open the p3d models because I get a warning about them still being binarized but I have tried to mimic your scripts... without success. I cant seem to get the attachto to work. When I test my model in game only 1 of the 3 pieces spawn. I believe I have three problems:

1) I do not know how to use the eventhandlers properly.
2) I do not know if I am calling out the 2 missing pieces properly.
3) p3d might be missing/incorrectly set up

My scripts (inspired by Gnat):

CONFIG.CPP (note I placed the eventhandlers way at the bottom. I wish the "aft" section of my ship to be the foundation of the whole set up)
Code: [Select]
class CfgPatches {
class MEU_LPD { //name of the addon
units[] = { //units which will get added
"LPD Aft Section",
"LPD Mid Section",
"LPD Bow Section"
};
weapons[] = {};
requiredVersion = 1.05;
requiredAddons[] = {}; //addons which are required when using your addon.
};
};

class CfgVehicleClasses {
class MEU_LPD { //Creates a new group under which it will be visible in the editor
displayName = "MEU LPD-17";
};
};

class CfgVehicles {
class NonStrategic; //loading old class for inheritance
class LPD_SEC_BOW : NonStrategic { // inheriter to : inherit from
scope = 1; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="MEU_LPD"; // same as CfgVehicleClasses
displayName ="LPD-17 Bow Section"; // name of the object
destrType = DestructNo;
model = "\MEU_LPD\LPD_SEC_BOW.p3d"; //path to the binarized model
                armor = 500;// strength of wall also effected by weight amount in geo lod
                mapsize = 2;// size of icon when placed in editor

};

class LPD_SEC_MID : LPD_SEC_BOW { //In this case it inherits from the first object I installed
scope = 1; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
displayName ="LPD-17 Mid Section"; //name of the object
model = "\MEU_LPD\LPD_SEC_MID.p3d"; //path to the binarized model

};

class LPD_SEC_AFT : LPD_SEC_BOW { //In this case it inherits from the first object I installed
scope = 2; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
displayName ="LPD-17"; //name of the object
model = "\MEU_LPD\LPD_SEC_AFT.p3d"; //path to the binarized model
class EventHandlers;
init = "[_this select 0] exec ""\MEU_LPD\scr\LPDInit.sqs""; ";

        };
};

LPDInit.sqs
Code: [Select]
if (!isServer) exitWith {}
_ship = _this select 0

;[_ship] execvm "\MEU_LPD\scr\LPDposMID.sqf"
;[_ship] execvm "\MEU_LPD\scr\LPDposBOW.sqf"
#quit
exit

LPDposMID.sqf
Code: [Select]
_ship = _this select 0;
_mid = "LPD_SEC_MID" createvehicle[0,0,0];
_mid attachto [_ship,[50,0.0,0.0]];
_mid setDir (direction _ship)-180;

The bow position sqf is nearly identical except where it counts. See anything amiss?

As far as #3 is concerned I have created a memory LOD in each of the three pieces and placed within it a single point. I have set the autocenter to 1 (as it is in the FSF). Is this correct?
« Last Edit: 05 May 2010, 04:10:30 by Absolution »

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Roadways not working
« Reply #9 on: 06 May 2010, 17:13:57 »
Quote
;[_ship] execvm "\MEU_LPD\scr\LPDposMID.sqf"
Youve commented out the 2 lines !?
remove the ";"
And the execvm needs a dumb out;
Quote
blahblah1 = [_ship] execvm "\MEU_LPD\scr\LPDposMID.sqf"

Otherwise at first glance it should work.

Offline Absolution

  • Members
  • *
Re: Roadways not working
« Reply #10 on: 07 May 2010, 05:39:51 »
Still no go, sir. I copied the wording from your FSF which is why I had the proceeding ";" but I have since taken your suggestion and removed them. I have also tried "preloading" the other two parts of the model.

I am not sure if I am calling out the pieces properly. In the config file I gave them a class name of "LPD_SEC_BOW" and "LPD_SEC_MID" are these what I use in the LPDposMID.sqf?

I also do not know if I am using the eventhandler correctly. Is it properly used in the config?

Here are the updated scripts based on your suggestion and some experimenting by me. I have renamed some of the call outs to line up with my records.

Config (stated for clarity)
Code: [Select]
class CfgPatches {
class MEU_LPD { //name of the addon
units[] = { //units which will get added
"LPD Aft Section",
"LPD Mid Section",
"LPD Bow Section"
};
weapons[] = {};
requiredVersion = 1.05;
requiredAddons[] = {}; //addons which are required when using your addon.
};
};

class CfgVehicleClasses {
class MEU_LPD { //Creates a new group under which it will be visible in the editor
displayName = "MEU LPD-17";
};
};

class CfgVehicles {
class NonStrategic; //loading old class for inheritance
class LPD_SEC_BOW : NonStrategic { // inheriter to : inherit from
scope = 1; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="MEU_LPD"; // same as CfgVehicleClasses
displayName ="LPD-17 Bow Section"; // name of the object
destrType = DestructNo;
model = "\MEU_LPD\LPD_SEC_BOW.p3d"; //path to the binarized model
                armor = 500;// strength of wall also effected by weight amount in geo lod
                mapsize = 2;// size of icon when placed in editor

};

class LPD_SEC_MID : LPD_SEC_BOW { //In this case it inherits from the first object I installed
scope = 1; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
displayName ="LPD-17 Mid Section"; //name of the object
model = "\MEU_LPD\LPD_SEC_MID.p3d"; //path to the binarized model

};

class LPD_SEC_AFT : LPD_SEC_BOW { //In this case it inherits from the first object I installed
scope = 2; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
displayName ="LPD-17"; //name of the object
model = "\MEU_LPD\LPD_SEC_AFT.p3d"; //path to the binarized model
class EventHandlers;
init = "[_this select 0] exec ""\MEU_LPD\scr\LPDInit.sqs""; ";

        };
};

LPDInit (revised)
Code: [Select]
if (!isServer) exitWith {}
_aft = _this select 0

_xx = 10 preloadObject "LPD_SEC_BOW"
_xx = 10 preloadObject "LPD_SEC_MID"
001 = [_aft] execvm "\MEU_LPD\scripts\LPDposMID.sqf"
002 = [_aft] execvm "\MEU_LPD\scripts\LPDposBOW.sqf"
#quit
exit

LPDposMID (revised, coordinates intentional to test to see if they load at all)
Code: [Select]
_aft = _this select 0;
_mid = "LPD_SEC_MID" createvehicle[0,0,0];
_mid attachto [_aft,[0,0,0]];
_mid setDir (direction _aft)-180;
« Last Edit: 07 May 2010, 05:41:25 by Absolution »

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Roadways not working
« Reply #11 on: 07 May 2010, 11:42:15 »
!! yes, you should be getting errors!
Event handlers are done with brackets, like
Quote
      class EventHandlers
      {
         init = "[_this select 0] exec ""\rktcoaler\scr\common_init.sqs"";_scr = _this execVM ""\ca\Data\ParticleEffects\SCRIPTS\init.sqf"";";
      };

Offline Absolution

  • Members
  • *
Re: Roadways not working
« Reply #12 on: 07 May 2010, 21:41:32 »
GAH! FINALLY! It's now working to a point where I can tweak it to get it all perfect. Thanks for the help Gnat I greatly appreciate it.
-----------------------------

Next challenge... getting the attachto to recognize the Memory LOD points I have defined. In each of the three models I created a single point and named them "pos aft" "pos mid" "pos bow" as appropriate. In the config file I believe I called them out as a "position". When I load the model in game they ignore the memory point.

Here is a snippet of what I tried in the config. Is this correct?:
Code: [Select]

class LPD_SEC_BOW : NonStrategic { // inheriter to : inherit from
scope = 1; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="MEU_LPD"; // same as CfgVehicleClasses
displayName ="LPD-17 Bow Section"; // name of the object
destrType = DestructNo;
model = "\MEU_LPD\LPD_SEC_BOW.p3d"; //path to the binarized model
                armor = 500;// strength of wall also effected by weight amount in geo lod
position = "pos bow";

};

The other problem I am having is when I attach a CRRC to my ship in the same way the RHIB is attached to the FSF the CRRC bounces up and down in place... even if its floating in the middle of empty space. Thoughts?

dock code (modified from Gnat's dock script of the FSF):
Code: [Select]
//if (!isServer) exitWith {};
private["_aft","_CRRC1"];
_aft = _this select 0;
_CRRC1 = "Zodiac" createvehicle[0,0,0];

_CRRC1 attachto [_aft,[0,0,0]];
_CRRC1 setDir (direction _aft)0;

I noticed you had a series of code after the above referencing animations... I assumed this was to keep the RHIB in place while the FSF was in motion. Since my ship doesn't move I just removed the code. Maybe that was a mistake?


This was Gnat's original code:
Code: [Select]
//----------------------------------------
//script by Gnat
//----------------------------------------
// if you use it, credit me as appropraite
//----------------------------------------
//if (!isServer) exitWith {};
private["_ship","_boat"];
_ship = _this select 0;
_boat = "RHIB" createvehicle[0,0,0];

_boat attachto [_ship,[-3,-20.5,-2]];
_ship animate ["ZL1",1];

sleep 2;
while {(alive _boat) and (alive _ship) and (_ship animationPhase "ZL1" == 1)} do {};
detach _boat;
« Last Edit: 08 May 2010, 02:43:56 by Absolution »

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Roadways not working
« Reply #13 on: 08 May 2010, 03:28:33 »
Quote
I assumed this was to keep the RHIB in place while the FSF was in motion
No
Once a RHIB is attached, you have to give some way for a player to release.
In the FSF theres an user action that allows you to Release RHIB.
This animates an invisible section called "ZL1"
The script is simply waiting for the "ZL1" animation to change state. When it does, it drops/detachs the RHIB
And obviously it also drops it if the FSF or RHIB is destroyed.

When you then attach a RHIB, it then animates the "ZL1" to the reverse state.
.... and so the system loops so you can always attach/detach.

Theres a "ZL1" and a "ZL2", 1 for each RHIB

Offline Absolution

  • Members
  • *
Re: Roadways not working
« Reply #14 on: 08 May 2010, 05:51:43 »
Oh that makes sense.

Is this how you define "ZL1"? Then I can call on it later to attach/detach?
Code: [Select]
_ship animate ["ZL1",1];

But that wont solve the bouncing issue. Any ideas on that?