1NSANE OFF ROAD
June 06, 2023, 01:30:46 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News:

 
  Home Help Arcade Gallery Links Staff List Login Register  

imap custom objects INSANE GAME

Pages: [1]
  Print  
Author Topic: imap custom objects INSANE GAME  (Read 246 times)
pakoaguiar
Administrator
1NSANERO 100%
*

empolvado 0
Offline Offline

Posts: 890


« on: March 29, 2013, 11:48:50 pm »

To have custom objects working ingame:

you must make map style as following in .scn files : style data\maps\yourmap\
you need objtype.cfg file in your idf file
you need your objects as .fff and object textures as .png file (256x256) (use zmodeler and name material there: [child]data\maps\yourmap\yourobject.png and export it as .fff file)
also you may want to lift your objects bottom to 0 level at y axis and select your object and apply flag 1 for the object before exporting this is for easier object measurement and placement in imap and game.

This is one object of my wasted map objtype.cfg file, it is plain textfile, it can be created with notepad, just rename the extension as .cfg after saving,
;--------------------------------------------------
type      moot
draw      data\maps\mad704\moot.gem
ai_type      3
dynamics        11
collision   2
mass      0.400
bounds      {-34 0 -23} {34 45 23}
minforce        4.5000000
;--------------------------------------------------
eof

it has to have eof (and one empty line after it) to work properly
Line explanations by mtf_dav:

Properties for 1nsane objects - with explanations.

Type - Name of the object for use in .obj file in map. Also can include the parameters "need" or "group" although I can't tell that it is even used by the game.

Draw (anim) - the path to the object file to draw. Usually data\(stylename)\(objectname.geo). If the item is an animated object, this line begins with "anim" and points to the location of the .ani file.

Dynamics - numerical value, I don't know what they represent. Most static, unmovable objects have this set at 11. The animations seem to be all set at 10. Various other objects have values of 1,2, 3, 4, 5, or 255, but they all seem to be system objects that don't actually appear in maps. A few objects do not have a dynamics setting at all.

Offset - Numerical value, looks like a height offset, should be set to prevent an object from floating or sinking when its height is set to ground level.

Radius - Numerical value, looks like it is used only for animated objects, possibly to set the immediate space wherein they do the animation thing.

Bounds - X, Y, Z coordinates for opposite ends of a bounding box. This apparently is what defines the collision box for an object.

Mass - numerical value for mass of an object. No idea of scale here.

Ai_type - Numerical value; set at 4 for most objects. Other objects have settings of 0, 2, or 7. I think it has to do with how the computer trucks behave around objects - whether they go right through them or try to avoid them. 0 and 2 seem to be objects the AI does not try to avoid.

Collision - Numerical value, sets collision properties for an object. Most colliding objects have this set at 2. Other values are 6 for bridge pieces and buildings. Some animated objects have this set at 1. For no-collide, this value is left out.

Minforce - Numerical value, appears to indicate the force required to move an object. Most values range from 1 to 4. The combination of this value and mass seems to define an object as being moveable.

Counter - used in some system level animations, such as dust and water.

Flags - Again, used in some system level objects, no idea of purpose.

Sfx_start - sets sound file for 'start' variable. Not sure how this works, the 'MARKER' and 'KERITES' objects are the only ones I've found to use this.

Sfx_collide - sets sound file for collision noise.

Sfx_loop - sets sound file for continous looping sound.

Explode - explosion animation. In the form of a .xpl file. I assume it directs the action of items that fly apart when you hit them? The 'MARKER' and 'SZALAG' objects, which are the posts and flags along the stock map ORR routes, are the only two examples of this.

My experiences: dynamics: values 1: game crashes, 2-10 mostly objects move up and down when touched but not to sides, also some wierd effects and misplacements occurred, 11 is for moving objects ie when you crash to object, depending on mass and minforce values, object flies away or/and rolls
bounds: this is important, you have the values from zmodeler front view: first (x) from left edge of the object, next (y) from bottom edge of the object (i usually place object bottom to 0 y level) and third value (z) from top view and back edge of the object, see the values from example. Next three values same way but opposite sides of the object, these values make the bounding "cube" for the object, zmodeler values has to multiply with 66 (around) to have game and imap compatible values.
collision, if you want to make a ramp or road parts make the collision value to 6 and dont put dynamics value at all leave the whole line off.
draw: i use there .gem extension cause i have in my idf . gem files, these files are similar to vehicle files, you can make game run smoother by using lods (level of detail) for objects too:

8 data\maps\mad704\wheel.fff data\maps\mad704\wheellow.fff
64 data\maps\mad704\wheellow.fff data\maps\mad704\wheellow.fff
127 data\maps\mad704\wheellow.fff null
 
these are lines from wheel.gem file first path is for the object, second path on same line is for shadow (shadow is usually lower lod) if you put null there nothing is rendered but you can hit the object.
also .geo of .fff can be used but if your object is high poly one,  but it will kill the framerate then. (in crappy comps like mine lol)

Remember when you use your own style, you still can use general objects, but not anything from other styles (in day/morning/night .scn file you can have different styles ex. day yourmap night ireland)

And then the imap part, mainly written by olderguy
What to do:
Make a custom object identification file named "custom.csv" and put it in
c:\imap\objects.
Create some bitmaps of your objects and put them in a
"c:\imap\objects\custom" folder

How to do it:
You can make the bitmaps with any screen capture program. Make them exactly 150X120 and save
them a .bmp files... MUST BE .BMP!!. The file name must agree with the
first parameter entry in the .csv file.

You MUST name your custom object file 'custom.csv'. This must be a text
file so you should create it with notepad, just make a new file called custom.txt, after you have finished it just rename it custom.csv
Look at the c:\imap\objects\general.csv (rename extension as .txt) file for this example of how you must set up
this file.

The first entry is the number of objects in the file. The below part of the
file shows that there are 60 objects. I've only copied 5.
Look at the last entry I put from the file here for the 'betonfal'.

60
"banner1",0,384,0,0,0
"banner2",0,512,0,0,0
"banner3",0,640,0,0,0
"banners",0,640,0,0,0
"betonfal",0.8,91,70,0,0

The first entry is the object name, "betonfal" (include the quotes in the file)
The next entry (0.Cool is a permanent vertical offset for the object. Some
objects must be elevated or lowered to touch the ground.
The next entry (91) is the X Width of the object ... I'll show you how to
get that number later
The next entry (70) is the Y Length of the obect... more on that later too.
The next entry (0) is the objects Y rotation angle in radians. (0-6)
The last entry (0) is the objects X rotation angle in radians (0-6)

The X (Width) and Y(Length) are used by Imap to draw the outline of the
larger objects on the map while you are adding them and looking at them.
The original object definition files use a coordinate system of 35000X35000.
Imap must translate these original coordinates to the 256X256 map grid
available to Imap. That means that your object height and width must be
scaled to 0-35000 and entered here.
Imap will take whatever this number is and multiply it by .007314 to convert it
to a 256X256 scale.
This scale is same as in objtype.cfg file bounding box value, just enter the object width from there (in .csv file: "moot",0.0000,34,23,0,0 and in .cfg file{-34 0 -23} {34 45 23} ).

OK, next step... to get Imap to place some of these objects on the map...

Make sure that all three of your .scn files state "style \data\custom\" for the map style.
You should now be able to import that map and add objects.

When you have placed objects, export map, dont close imap, go to .scn files, rename your style as data\maps\yourmap\ to make game understand your objects, then go again to imap and wrap the map. Remember change style lines always when  you want to work with your map, occasionally happened to me that imap object tool broke when style was incorrect. (i have two extra folders in imap folder other has "real" .scn files and other has "imap" .scn files, if you change .scn data in imap just copy and paste the style lines there)

When these instructions are followed, imap works with custom objects, but you must remember that when a map is imported the first time it sets the style to whatever is in the .scn file so the object tool starts up in that style. After you import the map, close imap and change the .scn file 'style' line to 'custom'. When you restart Imap, the style will change to custom and custom object pictures
are visible in object tool. This happened to me: If you don't close and reopen Imap, it will crash and break the imap.exe and you will have to resotore the Imap.exe file (so make a copy of Imap.exe just in case so you won't have to reinstall all of Imap).

When you have questions please use ih forum, iŽll be there almost every day, this is very first version and i have left sounds off cause i havent got time to work with them at all

Very special thank you belongs to mtf_dave who had the original knowledge of custom objects, and to olderguy for imap and making it compatible also with custom objects and writing instructions for them ,and to toxicfritz for general help with this issue.

happy objecting lol: Mad70
Report Spam   Logged

Share on Facebook Share on Twitter

pakoaguiar
Administrator
1NSANERO 100%
*

empolvado 0
Offline Offline

Posts: 890


« Reply #1 on: March 29, 2013, 11:51:15 pm »

;--------------------------------------------------
type      moot
draw      data\maps\mad704\moot.gem
ai_type      3
dynamics        11
collision   2
mass      0.400
bounds      {-34 0 -23} {34 45 23}
minforce        4.5000000
;--------------------------------------------------
eof
Report Spam   Logged


Pages: [1]
  Print  
 
Jump to:  

Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy