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

Helpful script for Zmodeler users

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Modding Tutorials
View previous topic :: View next topic  
Author Message
Cukier

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 14 Jan 2014
Posts: 53
Location: Poland
14005 Bank Notes
Items

PostPosted: Tue Dec 16, 2014 12:17 am    Post subject: Helpful script for Zmodeler users Reply with quote

Hi.
Today i was tired of changing tons of material properties to make them work ingame... so i wrote an AutoIt script. All you need to do is set amount of your materials in $Materials variable and just press F1... The script will make all dirty job for you Smile (To terminate press ESC. Also after launching script, you must give some time to zmod to calculate everything Sticking out tongue)

Script automaticly sets:
Shine to MAX
Size to MIN
Opacity to MAX
Type to Unused


Here you go:

Code:
Global $g_bPaused = False

HotKeySet("{F1}", "ZmodelerSucks")
HotKeySet("{ESC}", "Terminate")

Func ZmodelerSucks()

     WinMove ( "Material Editor", "", 0, 0)
     $Materials = 10   ;==> Amount of materials (including <default material>)

For $Start = 1 To $Materials
     MouseClick ( "left" , 333, 143 , 5 , 0)
     MouseClick ( "left" , 275, 158 , 5 , 0)
     MouseClick ( "left" , 333, 173 , 5 , 0)
     Send ( "{TAB}" )
     Send ( "{HOME}" )
     MouseClick ( "left" , 234, 200 , 1 , 0)
     ToolTip ( $Start, 0 , 0)
     Send ( "{TAB}" )
     Send ( "{DOWN}" )
   Next

EndFunc   ;==> ZmodelerSucks

Func Terminate()
     Exit
EndFunc   ;==> Terminate

While 1
     Sleep(100)
WEnd
Back to top
View user's profile Send private message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 517
Location: Dutchland
255681 Bank Notes
Items

PostPosted: Mon Dec 22, 2014 9:27 am    Post subject: Helpful script for Zmodeler users Reply with quote

Wait a minute, you made a script which automatically cleans up the materials mess when importing a model from another 3D tool?
Just a moment, let me change my pants......






..... AWESOME! Applause
You don't want to know how many hours of my life I have wasted correcting countless of materials that were imported wrongly, All sliders black, all glowing transparency, all opacity at 0,5 and what not else. On average I spend about an hour per complex model fixing this stuff.
Now that there's a script that does this -indeed- dirty work this will save me lots of valuable time. Fantastic job!

How do I get this script to run? Is there a command window in Zmodeler where I can enter this or do I need to save this script within a file somewhere? Can you give some basic instructions?
_________________


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

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 14 Jan 2014
Posts: 53
Location: Poland
14005 Bank Notes
Items

PostPosted: Wed Dec 24, 2014 5:44 am    Post subject: Helpful script for Zmodeler users Reply with quote

You need to install autoit
Link: https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe

After you install it, make new .au3 file (on Desktop RMB -> New -> AutoIt v3 Script. Or create it manually) and edit it in any text editor (or RMB on file and click Edit script).Then paste this script and change value of $Materials to your amount of materials (or 2 more for safe) and save. After you save just run the file. Now you will see AutoIt icon in tray so it says you, that script is executed. Now you going to zmodeler and open Material window. And just press F1. If anything goes wrong you can terminate it by pressing ESC button.
Also you don't need to change colors of material because game itself ignores it while material have texture (i guess).

Thats all Smile

Btw after pressing F1 you need to wait untill script change all materials. Because script are moving your mouse and clicking automaticly. So doing other stuff in this time is not possible. Also after script done his work, you must give zmodeler some time to set all Smile But in thi time you can do whatever you want (i guess Very happy) Just make some tests Very happy
Back to top
View user's profile Send private message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 517
Location: Dutchland
255681 Bank Notes
Items

PostPosted: Wed Dec 24, 2014 8:44 am    Post subject: Helpful script for Zmodeler users Reply with quote

I just had to feel if I wasn't dreaming when this script ran.
Thank you! Thank you! Thank you! Thank you! Thank you! Applause

You, sir, probably decreased the Titanic Mod development time with half a year. Salute From everything involved in mod creation this was definitely the most time consuming and most frustrating job of it all. On average, a model in my mod contains about 40 materials if not more.
And it sometimes happens that I notice a bug only after the model has been exported, meaning that I need to re-import the updated model in Zmodeler and fix the 40+ textures all over again. Sometimes I'm spending a whole day just doing this stuff. Now I can finally export models towards Mafia in a quick and modern fashion and spend my time on some actual productive things. Hats off to you!

Also no more frustration where I forget to put one slider all the way to the max from one of the many materials causing the game to crash. That also usually takes more than an hour before I find out what's wrong.

Fantastic job! Thumbs up (left)
_________________


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

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 556
Location: London, England
7696 Bank Notes
Items

PostPosted: Wed Dec 24, 2014 10:00 am    Post subject: Helpful script for Zmodeler users Reply with quote

It's a beauty of a script! The .4ds export script from MAX doesn't work too well on some models so I still need to use Zmodeler Sad

Rob, do you still have you add all the materials manually when importing .3ds into Zmodeler? I get so sick of adding the same materials over and over again in the textures browser..
_________________

The official Mafioso Mod thread
Back to top
View user's profile Send private message
Cukier

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 14 Jan 2014
Posts: 53
Location: Poland
14005 Bank Notes
Items

PostPosted: Wed Dec 24, 2014 12:14 pm    Post subject: Helpful script for Zmodeler users Reply with quote

I'm glad to help you Smile
Back to top
View user's profile Send private message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 517
Location: Dutchland
255681 Bank Notes
Items

PostPosted: Wed Dec 24, 2014 12:22 pm    Post subject: Helpful script for Zmodeler users Reply with quote

You mean the textures assigned to the materials?
Usually no, Zmodeler automatically imports them but has very strict conditions;
1. Textures must be located within the same folder as where the exported .3ds file is located.
2. The texture assigned to the material must be loaded from the folder where the 3ds file is going to be saved.
3. 3ds files can only read texture bitmaps if the filenames contain no more than 7 characters. So if you have loaded a texture "Wall_Tiles_GreenFinish13.bmp" then Zmodeler won't import it. On the other hand, naming it "Wall13.bmp" should work fine.
4. Do not export any other channels other than the color/diffuse channel. So do not assign any alpha maps, bump maps, light maps or anything else just yet. This is not always the case but can sometimes matter.

This was one of the first issues I wanted to get rid off because it's indeed a tedious job.

Also to prevent any other random issues, always make sure your textures are binary. E.G. 512X512, 1024X1024, 128X512 etc. Resolutions of 700X300, 250X250 or 900X66 can cause shading issues within the game.
_________________


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

New Member
New Member


Joined: 25 Dec 2014
Posts: 9
Location: Russian
17 Bank Notes
Items

PostPosted: Thu Dec 25, 2014 11:09 am    Post subject: Helpful script for Zmodeler users Reply with quote

Hello!
Can you make a video instruction on how to use this script in detail? Please!
_________________

Lost Heaven modding

Video tutorials on modding
Back to top
View user's profile Send private message
Cukier

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 14 Jan 2014
Posts: 53
Location: Poland
14005 Bank Notes
Items

PostPosted: Thu Dec 25, 2014 12:08 pm    Post subject: Helpful script for Zmodeler users Reply with quote

Already i wrote post to tells you what you need to do, step by step.
There is no need for making video about it Smile
Back to top
View user's profile Send private message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 517
Location: Dutchland
255681 Bank Notes
Items

PostPosted: Sat Sep 17, 2016 5:17 pm    Post subject: Helpful script for Zmodeler users Reply with quote

Been a while since you made it, but I've made some changes to your script:

Quote:
Global $g_bPaused = False

HotKeySet("{F1}", "ZmodelerSucks")
HotKeySet("{ESC}", "Terminate")

Func ZmodelerSucks()

WinMove ( "Material Editor", "", 0, 0)
$Materials = 98 ;==> Amount of materials (including <default material>)

For $Start = 1 To $Materials
MouseClick ( "left" , 333, 98 , 1 , 0)
Send ( "{END}" )
MouseClick ( "left" , 333, 113 , 1 , 0)
Send ( "{END}" )
MouseClick ( "left" , 333, 128 , 1 , 0)
Send ( "{END}" )
MouseClick ( "left" , 333, 143 , 1 , 0)
Send ( "{END}" )
MouseClick ( "left" , 275, 158 , 1 , 0)
Send ( "{END}" )
MouseClick ( "left" , 333, 173 , 1 , 0)
Send ( "{END}" )
Send ( "{TAB}" )
Send ( "{HOME}" )
MouseClick ( "left" , 234, 200 , 1 , 0)
ToolTip ( $Start, 0 , 0)
Send ( "{TAB}" )
Send ( "{DOWN}" )
Next

EndFunc ;==> ZmodelerSucks

Func Terminate()
Exit
EndFunc ;==> Terminate

While 1
Sleep(100)
WEnd


What I've changed is that it presses the "END" button before skipping to a new slider. Zmodeler has an issue where it not always places the slider at 100% even if it's instructed to. This only seems to happen with the shine slider which is ever so important.

Also, any imported models from Cinema 4D have messed up colors. It now also forces the material color sliders to white.

Plus, I seem to have made it a little faster as well. Sticking out tongue
_________________


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

New Member
New Member


Joined: 07 Mar 2013
Posts: 15
Location: Slovakia
48 Bank Notes
Items

PostPosted: Sat Sep 17, 2016 10:09 pm    Post subject: Helpful script for Zmodeler users Reply with quote

Not work for me. Do you have any idea what could be wrong? I have Windows 10.



Thanks
Back to top
View user's profile Send private message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 517
Location: Dutchland
255681 Bank Notes
Items

PostPosted: Sat Sep 17, 2016 11:43 pm    Post subject: Helpful script for Zmodeler users Reply with quote

Could be that the position is off. The script pretty much just tells the mouse to go to a specific pixel on the screen. I guess that a change in font size or character use affects the size of the buttons and material editor. Try installing Zmodeler in English.
Alternatively you can also easily open the script with notepad and fiddle with the values of the mouseclick commands. First number is the horizontal position, second number is the vertical position. Third number I think is the amount of time the mouse is held. Perhaps this number needs to be set higher in case your PC experiences performance issues.
_________________


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 Sep 20, 2016 3:45 pm    Post subject: Helpful script for Zmodeler users Reply with quote

good afternoon gentlemen!

i am having problems using this script. when i run it, and press F1 (on my desktop), the script works. the mouse is moving, but it has no effect, since its on the desktop. when i move to zmodeler and press F1 (after i run the script) nothing happends. it seems to only work on the desktop, but not in zmodeler...

can someone help me? i am creating a new map for mafia, and i honestly do not want to do this manually...

greetings from an austrian mafia-fan


EDIT: i run the autoit as administrator and then opend the script, then it seems to be ok.

thanks for this wonderful script
Back to top
View user's profile Send private message
MatteoCapoletti

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 05 Mar 2013
Posts: 506

973 Bank Notes
Items

PostPosted: Wed Oct 05, 2016 11:08 pm    Post subject: Helpful script for Zmodeler users Reply with quote

I am amazed that this is all a complete mystery to me Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Modding Tutorials 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.031 | Queries: 19