View previous topic :: View next topic |
Author |
Message |
pjakub88
Junior Member


Joined: 05 May 2020 Posts: 43 Location: Poland 131 Bank Notes
Items
|
|
Hello everyone,
i would like to add usable baseball bat weapon to the Mission 17 - Prison.
How can I do this?
I added a baseball bat model using Mafia World Editor, but the player wasn't able to take it and use as a weapon. Maybe i need to add a specific script for that?
It certainly could be done in the game, because in few missions we are able to pick up various weapons and use them in combat (like knive in the Hotel Corleone, Thompson 1928 in Clark's Motel, etc).
Last edited by pjakub88 on Wed Jul 01, 2020 12:29 pm; edited 1 time in total |
|
Back to top |
|
 |
Frog_808
New Member


Joined: 13 May 2020 Posts: 16
44 Bank Notes
Items
|
|
Hello, it's very easy.
You need DC ED 2 Editor for this. Open the mission\scene2 and click on "add object". Then select Object Defintions\Script in the window and name the script exactly like the object you created in the MWE.
Now check whether there is an object of the same name for your created object definitions. (right click on your script in the left tree and "Switch to Object"; it must switch to the Object!) if so, your path works.
Now open your script and enter the following (for a weapon that disappears when you pick it up):
_______________________________________________________
dim_act 1
dim_frm 1
findactor 0, "Tommy" (this line isn´t n necessary I guess)
findframe 0, "NAME OF YOUR BASEBALLBAT IN MWE"
createweaponfromframe 0,4,0,0
end
____________________________________________________
If you want to pick up many weapons on the object, write:
__________________________________________________
dim_act 1
dim_flt 1
findactor 0, "Tommy"
label a
detector_waitforuse
human_addweapon 0,4,0,0
goto a
__________________________________________________
You could also include commands so it's not free, as well as console_addtext, but as I wrote it is the simplest.
If you have any questions or something doesn't work, just ask.
(It would be very helpful for you if you download the mafia "Script and data reference"!, there you can find all commands) |
|
Back to top |
|
 |
pjakub88
Junior Member


Joined: 05 May 2020 Posts: 43 Location: Poland 131 Bank Notes
Items
|
|
Frog_808 wrote: | Hello, it's very easy.
You need DC ED 2 Editor for this. Open the mission\scene2 and click on "add object". Then select Object Defintions\Script in the window and name the script exactly like the object you created in the MWE.
Now check whether there is an object of the same name for your created object definitions. (right click on your script in the left tree and "Switch to Object"; it must switch to the Object!) if so, your path works.
Now open your script and enter the following (for a weapon that disappears when you pick it up):
_______________________________________________________
dim_act 1
dim_frm 1
findactor 0, "Tommy" (this line isn´t n necessary I guess)
findframe 0, "NAME OF YOUR BASEBALLBAT IN MWE"
createweaponfromframe 0,4,0,0
end
____________________________________________________
If you want to pick up many weapons on the object, write:
__________________________________________________
dim_act 1
dim_flt 1
findactor 0, "Tommy"
label a
detector_waitforuse
human_addweapon 0,4,0,0
goto a
__________________________________________________
You could also include commands so it's not free, as well as console_addtext, but as I wrote it is the simplest.
If you have any questions or something doesn't work, just ask.
(It would be very helpful for you if you download the mafia "Script and data reference"!, there you can find all commands) |
It works now! Thanks a lot for help Frog_808!
Looks like i was really close to figure out the problem myself, but i missed some lines in my script...
I already downloaded the Script and data reference document - very usefull info for scripting. I also have the "Mafia Script Helper 2" program. |
|
Back to top |
|
 |
Muggy
Site Staff


Joined: 05 Jan 2005 Posts: 1008 Location: Sydenham London 278064 Bank Notes
Items
|
|
I see this request has been solved so
I will lock this for now.
Should you need to add anything please
PM either myself or Mnich. _________________
 |
|
Back to top |
|
 |
|
|
|
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
|