FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visit View your posts View unanswered posts

Create Breakable Glass

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
flovivi

Junior Member
Junior Member


Joined: 22 Dec 2014
Posts: 29

557 Bank Notes
Items

PostPosted: Mon Nov 14, 2016 11:39 pm    Post subject: Create Breakable Glass Reply with quote

i have a little problem with creating a breakable glass. i created a model in my map (9italian.i3d) and in the mission where paulie is supposed to gun down morellows brother, all of the restaurants glass can be shot and it will break into pieces. i wanted to create this too. i created the model in my map and i created a OBB collision and made the glass to its parent. (in my case it was bar.sklo3, so the OBB collision's parent would be bar.sklo3. "bar" is my models name.) and then set the material of the OBB to breakable glass (24).

in the game, however, when i shot at the windows, i can hear the glass breaking sound, but the window doesnt break into pieces but simply disappear...

and my question is... why won't it break into pieces? what did i do wrong? is it even possible for us modders to do that?

i would be very thankful if someone could help me

i hope i explained it clearly enough. my english is not that good..
Back to top
View user's profile Send private message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 528
Location: Dutchland
255709 Bank Notes
Items

PostPosted: Tue Nov 15, 2016 8:14 am    Post subject: Create Breakable Glass Reply with quote

Not sure if I'm right, but you can setup the object surface properties in Zmodeler as well before exporting. One of the properties is glass, which is required for car windows to break. My guess is if you assign the same property to your window as you would with a car window, it could work.

If I remember correctly there should be a filters menu inside zmodeler and within there a tab for Mafia which contains the object properties.
_________________


www.Robville.net
Back to top
View user's profile Send private message Visit poster's website
flovivi

Junior Member
Junior Member


Joined: 22 Dec 2014
Posts: 29

557 Bank Notes
Items

PostPosted: Tue Nov 15, 2016 11:15 pm    Post subject: Create Breakable Glass Reply with quote

thanks for your reply!

i havent thought about this yet. this is definetly worth a try. but i guess for that, i would need to turn the bar into a physical object. don't know if that works. but i will try, as soon as i have time. university gets busy during that time (exams, new courses,...)

i have, however, removed the obb that was linked to the models window in the original mission (the mission where it is possible to let it break into pieces) and created a new one obb collision, with the same size and location like the old one, also liked to the specific glass. so basically, it looked like before. but it didn't work anymore. the glass-break sound appeared, but the glass disappeared immedietly withozt breaking.

either i missed something or it simply isn't possible the way the developers made.

i wish the developers of mafia would just realse their tools... someone should make them an offer they can't refuse


edit: i used Boz4dsFullManager to open the model of the bank robbery mission (scene.4ds) the glass-models are having "glass" as a parameter. when i use zmodeler to change it, the parameter says [DEFORMING GLASS] (it doesnt work with this either) so my last hope was to rename the parameter to glass. well, that doesnt work either since once i click away, the old parameter comes back. i simply can't change it with the Boz4dsFullManager, which is a pity. maybe that would be the solution. i can change other values, but some of them, including the "parameter" value, i can't change. Impossible
Back to top
View user's profile Send private message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 528
Location: Dutchland
255709 Bank Notes
Items

PostPosted: Wed Nov 16, 2016 8:20 am    Post subject: Create Breakable Glass Reply with quote

Hmm, it should be possible as Djbozkosz showed footage of him creating huge glass domes which could shatter completely.
Are the glass panels separate meshes from the rest of the model? Maybe you could try exporting them separately. Also, each window should have its own separate mesh.
If you're still stuck with it, I would recommend asking Djbozkosz about it. I'm sure he can explain it to you. His knowledge of LS3D is scary. Sticking out tongue


I once mailed a letter to 2K Czech asking if I could use the SDK for LS3D Engine to enhance the mod I was working on. Their reply was rather succinct. A no-go without going into detail about anything.
http://www.moddb.com/mods/mafia-titanic-mod/images/letter-to-2k-czech

I doubt my letter got any further than administration and never reached the actual developers. In fact, I reckon barely anyone at 2K Czech is aware of the Titanic mod. Vavra knew, but he left. Now that Hangar13 owns the license for the Mafia franchise, the whole notion is just out of the picture to try getting an SDK. Considering their ignorance of the franchise itself, I'm pretty confident that no one in their office has ever even heard of the modding community such as Mafiascene, let alone the mods themselves.

So thank god for guys like Djbozkosz who can not only create new editors that enlarge modding capabilities, but also add entirely new functionalities to the game as well. So I'm slowly starting to wonder if we really need an SDK from the 90's when there are these great tools around that work perfectly on the latest operating systems and are still in active development.
_________________


www.Robville.net
Back to top
View user's profile Send private message Visit poster's website
Duelist

Junior Member
Junior Member


Joined: 06 Nov 2016
Posts: 27

48 Bank Notes
Items

PostPosted: Thu Nov 17, 2016 3:06 pm    Post subject: Create Breakable Glass Reply with quote

Hi, I've just recently started trying to modify Mafia and came across the same problem. After importing Salieri's bar into freeride I tried to make windows shatter nicely but it wouldn't work if set up the same way as in mission (4th mission bar). So I messed around and found some strange workaround:




It is perfect for doors but quite bad for windows. I have few other ideas, we will see how it goes.
Back to top
View user's profile Send private message
flovivi

Junior Member
Junior Member


Joined: 22 Dec 2014
Posts: 29

557 Bank Notes
Items

PostPosted: Thu Nov 17, 2016 11:46 pm    Post subject: Re: Create Breakable Glass Reply with quote

Duelist wrote:
Hi, I've just recently started trying to modify Mafia and came across the same problem. After importing Salieri's bar into freeride I tried to make windows shatter nicely but it wouldn't work if set up the same way as in mission (4th mission bar). So I messed around and found some strange workaround:




It is perfect for doors but quite bad for windows. I have few other ideas, we will see how it goes.


it would be great if you would leave me a private message about your ideas and ways, maybe we can help and or learn from each other. i may not able to create breakable glass, but i can write and understand mafia scripts. Salute
Back to top
View user's profile Send private message
Duelist

Junior Member
Junior Member


Joined: 06 Nov 2016
Posts: 27

48 Bank Notes
Items

PostPosted: Fri Nov 18, 2016 9:23 pm    Post subject: Create Breakable Glass Reply with quote

I will write it here so others can use this workaround untill we find out some better option. It seems that MWE loses some parameters of collision objects upon editing and saving. That's why it doesn't work like in missions.

Basically, I have found out that to get the glass to shatter you have to set object parameter to glass (boz4ds manager can't do it, but it's piece of cake to hex it - done on first try without knowing what I'm doing) and set that object in DCED/bsv6 as a door... Yep, that's right, my Salieri's bar windows are considered doors by game.

That's why I wrote it's perfect for doors (windows are linked to doors, doors are set up in DCED) they move upon interacting. It works nicely. But there are few problems with windows;
- you get action button when you get close (you have to lock them in DCED) although there's a workaround for it as well,
- apparently game creates invisible box that covers all objects linked to the door, for e.g. I've tried to link front windows to doors in the garage behind the bar, I thought it would make action button appear only at that door at back and since it would be closed everything would be ok, but instead game created invisible box going from that garage doors to front which can't be crossed. Just like collision walls,
- that means you can't cross such "window" even if you break it,
- to get rid of action sign (I didn't try it yet) you would probably have to make advantage of what I wrote above and "resize" that invisible box in 2D plane in height, so action button would end up in the middle, underground for example.

I can write some tutorial if needed.
Back to top
View user's profile Send private message
flovivi

Junior Member
Junior Member


Joined: 22 Dec 2014
Posts: 29

557 Bank Notes
Items

PostPosted: Fri Nov 18, 2016 10:12 pm    Post subject: Create Breakable Glass Reply with quote

thank you very much..

however, as you said, you can't define the windows as glass with boz4ds manager, so you used hex. when i used hex and added the parameter after the mesh. with the dot, i couldnt use the model anymore.

so how exactly did you use hex and where did you add it? should i overwrite something?
Back to top
View user's profile Send private message
Duelist

Junior Member
Junior Member


Joined: 06 Nov 2016
Posts: 27

48 Bank Notes
Items

PostPosted: Fri Nov 18, 2016 10:42 pm    Post subject: Create Breakable Glass Reply with quote

1. Open Mise04-Saliery
2. Find and copy:



3. Open your model file and find your object (in my case it's the same one) select like this (I don't know if it's a single byte or what):



4. Copy into it:



5. Save and open boz 4ds manager to confirm it works.



Edit:
I forgot - don't add lightmaps to window objects! It makes them solid again.
Back to top
View user's profile Send private message
flovivi

Junior Member
Junior Member


Joined: 22 Dec 2014
Posts: 29

557 Bank Notes
Items

PostPosted: Fri Nov 18, 2016 11:39 pm    Post subject: Create Breakable Glass Reply with quote

does this work with other objects too?

i created a .4ds file by myself. the mesh name is sklod2. then i add the ".glass", so it looks like "sklod2.glass" (basically like on your screenshots) but when i want to open that model with boz4ds, it says "unsupported object type: 0 on adress 0x6314 last object: "

anyways, thanks for your effort in showing me step by step!
Back to top
View user's profile Send private message
Duelist

Junior Member
Junior Member


Joined: 06 Nov 2016
Posts: 27

48 Bank Notes
Items

PostPosted: Fri Nov 18, 2016 11:57 pm    Post subject: Create Breakable Glass Reply with quote

Yes, it is just a parameter, you can put there deformed glass or sector or any other.

Hmm, I did get such error when I was trying to hex cut objects from 4ds file. I think I was able to fix it by hexing the right amount of objects in the file and hex removing all parents data. This is the tutorial I was using: http://blog.mafia-forever.ru/tutorial-by-sergey-malov/ You have to use google translate, unless you know russian of course Sticking out tongue

EDIT:
I've just managed to get rid of action sing by using such script:

Code:
dim_act 1
dim_flt 1

findactor 0,"Salieri.vyloha_ram1"
DOOR_ENABLEUS 0,0


vyloha_ram1 is window frame I've linked my window objects to.

EDIT2:
Maybe you should try to hex existing model, like that Italiani you mentioned to rule out other possible errors.
Back to top
View user's profile Send private message
flovivi

Junior Member
Junior Member


Joined: 22 Dec 2014
Posts: 29

557 Bank Notes
Items

PostPosted: Sat Nov 19, 2016 12:16 am    Post subject: Create Breakable Glass Reply with quote

thank you soo much!!

seems i need to delete 00 afterwards (after the .glass) now it works perfectly.

thousand thanks!
Back to top
View user's profile Send private message
Duelist

Junior Member
Junior Member


Joined: 06 Nov 2016
Posts: 27

48 Bank Notes
Items

PostPosted: Sat Nov 19, 2016 3:27 pm    Post subject: Create Breakable Glass Reply with quote

Glad it worked Smile I have found something even better for windows. It is djbozkosz tutorial on how to create destructible objects. I've tried it and it has solved my windows problems. The only disadvantage of this method is that it needs a lot of objects instead of 1. For e.g. my Salieri's bar windows are made out of 5 objects each. So I need to cut them from main model, divide into 19 files and create 38 model files Sticking out tongue I'll mess around it, maybe I'll find a way to keep it in 1 file. Meanwhile it's best to use my method for glass in doors and djbozkosz for windows.

The link: https://yadi.sk/d/fk4xkqfCMDuDx go to View -> Programm & Tutorial -> Tutorial -> Word Tutorial -> Tutorial`s by djbozkosz.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.043 | Queries: 19