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 visitView your postsView unanswered posts

How to add usable weapon into a mission? SOLVED

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
pjakub88

Junior Member
Junior Member


Joined: 05 May 2020
Posts: 43
Location: Poland
131 Bank Notes
Items

PostPosted: Tue Jun 30, 2020 8:55 pm    Post subject: How to add usable weapon into a mission? SOLVED Reply with quote

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
View user's profile Send private message Send e-mail
Frog_808

New Member
New Member


Joined: 13 May 2020
Posts: 13

35 Bank Notes
Items

PostPosted: Wed Jul 01, 2020 9:43 am    Post subject: How to add usable weapon into a mission? Reply with quote

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
View user's profile Send private message
pjakub88

Junior Member
Junior Member


Joined: 05 May 2020
Posts: 43
Location: Poland
131 Bank Notes
Items

PostPosted: Wed Jul 01, 2020 12:29 pm    Post subject: Re: How to add usable weapon into a mission? Reply with quote

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
View user's profile Send private message Send e-mail
Muggy

Site Staff
Site Staff


Joined: 05 Jan 2005
Posts: 979
Location: Sydenham London
278002 Bank Notes
Items

PostPosted: Wed Jul 01, 2020 4:23 pm    Post subject: How to add usable weapon into a mission? SOLVED Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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.016 | Queries: 18