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

Problem with script
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
christian000

New Member
New Member


Joined: 17 Mar 2018
Posts: 2

4 Bank Notes
Items

PostPosted: Tue Mar 27, 2018 8:40 pm    Post subject: Re: Problem with script Reply with quote

Help. How could a door improve? the door looks black. already has moelo. but the model looks black when I open it. and when I open it, it's the color of the texture

Back to top
View user's profile Send private message
christian000

New Member
New Member


Joined: 17 Mar 2018
Posts: 2

4 Bank Notes
Items

PostPosted: Wed Mar 28, 2018 1:44 am    Post subject: Re: Problem with script Reply with quote

do you know if you could help me so that the door does not change to black in the game?






Back to top
View user's profile Send private message
ASM.

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 10 Jan 2014
Posts: 315

653 Bank Notes
Items

PostPosted: Tue Apr 24, 2018 9:36 pm    Post subject: Re: Problem with script Reply with quote

goodness wrote:
do you know if you could help me so that the door does not change to black in the game?

Try attaching the doors to bar_chodba instead of Primary sector.
Back to top
View user's profile Send private message
MrSpudnik

Junior Member
Junior Member


Joined: 31 Oct 2015
Posts: 51
Location: Ukraine
111 Bank Notes
Items

PostPosted: Sat Apr 04, 2020 1:38 pm    Post subject: Problem with script Reply with quote

Does anyone know how to determine the amount of ammunition in a weapon of an enemy or player? The problem is that the command "human_isweapon" determines the weapon regardless of the number of ammunition dropped out. Even if the remainder is 0, it will be defined as a weapon collected. Thinking
_________________

Back to top
View user's profile Send private message Visit poster's website
ASM.

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 10 Jan 2014
Posts: 315

653 Bank Notes
Items

PostPosted: Fri Apr 10, 2020 2:22 pm    Post subject: Re: Problem with script Reply with quote

MrSpudnik wrote:
Does anyone know how to determine the amount of ammunition in a weapon of an enemy or player? The problem is that the command "human_isweapon" determines the weapon regardless of the number of ammunition dropped out. Even if the remainder is 0, it will be defined as a weapon collected. Thinking

I'm not aware of a command for that. However I think it should be fairly straightforward to add such a command to MSE. Thinking

Also, free bump for you. Smirking
Back to top
View user's profile Send private message
MrSpudnik

Junior Member
Junior Member


Joined: 31 Oct 2015
Posts: 51
Location: Ukraine
111 Bank Notes
Items

PostPosted: Wed Apr 22, 2020 3:38 pm    Post subject: Re: Problem with script Reply with quote

ASM. wrote:
I'm not aware of a command for that. However I think it should be fairly straightforward to add such a command to MSE. Thinking

Also, free bump for you. Smirking

I doubt that I can edit this tool. Confused I need more information on MafiaScript Extensions.
_________________

Back to top
View user's profile Send private message Visit poster's website
ASM.

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 10 Jan 2014
Posts: 315

653 Bank Notes
Items

PostPosted: Thu Apr 23, 2020 8:47 pm    Post subject: Problem with script Reply with quote

What I meant is it should be fairly easy for me to add such a command since the in-memory structure of the inventory is documented. The question is what exactly you need. Going by your initial post it sounds like you need a modified variant of human_isweapon that only returns true for weapons with ammo. Is that correct?
Back to top
View user's profile Send private message
MrSpudnik

Junior Member
Junior Member


Joined: 31 Oct 2015
Posts: 51
Location: Ukraine
111 Bank Notes
Items

PostPosted: Fri Apr 24, 2020 3:26 pm    Post subject: Re: Problem with script Reply with quote

ASM. wrote:
What I meant is it should be fairly easy for me to add such a command since the in-memory structure of the inventory is documented. The question is what exactly you need. Going by your initial post it sounds like you need a modified variant of human_isweapon that only returns true for weapons with ammo. Is that correct?

Is that correct. It would be even better to write the amount of ammunition into a variable flt. I am aware that the game always remembers the amount of each weapon in the inventory, even jumping on locations does not forgot anything for the player, therefore, assuming that it can be used somehow in the script.
_________________

Back to top
View user's profile Send private message Visit poster's website
ASM.

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 10 Jan 2014
Posts: 315

653 Bank Notes
Items

PostPosted: Sat Apr 25, 2020 4:44 pm    Post subject: Re: Problem with script Reply with quote

MrSpudnik wrote:

It would be even better to write the amount of ammunition into a variable flt.

Yeah, that would definitely be more general. Here's what I have in mind:
Code:

mse_human_getammo xx, yy, zz

xx - The actor to check
yy - The weapon ID
zz - The flt to store the amount of ammo in (flt[zz] for loaded ammo and flt[zz+1] for pocket ammo; returns -1 if the actor doesn't have the specified weapon)
Back to top
View user's profile Send private message
MrSpudnik

Junior Member
Junior Member


Joined: 31 Oct 2015
Posts: 51
Location: Ukraine
111 Bank Notes
Items

PostPosted: Sun Apr 26, 2020 10:12 am    Post subject: Re: Problem with script Reply with quote

ASM. wrote:
Code:

mse_human_getammo xx, yy, zz

xx - The actor to check
yy - The weapon ID
zz - The flt to store the amount of ammo in (flt[zz] for loaded ammo and flt[zz+1] for pocket ammo; returns -1 if the actor doesn't have the specified weapon)

This is it! If this is added to MSE.asi, then I can offer a couple more command. In the same way, you can write to a variable whether the car has become available for use which were opened by commands "garage_enablesteal" and "freeride_enablecar".

This may be of the form:
Code:
mse_garage_getenablesteal xx, yy

xx - letter assigned to each brand of car.
yy - recorded variable flt (0 = not available 1 = available)

This could be a recognizable progress status of the player, but the problem is that the "garage_enablesteal" and "freeride_enablecar" commands do not work for reset (or I don’t know how to reset them). Therefore, need one more command:

Code:
mse_garage_setenablesteal xx, yy

xx - letter assigned to each brand of car.
yy - assign status to use the car (0 = not available 1 = available)

The "freeride_enablecar" command needs the same thing, since a number of car brands work with this command, another one with the "garage_enablesteal".
Is it possible?
_________________

Back to top
View user's profile Send private message Visit poster's website
ASM.

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 10 Jan 2014
Posts: 315

653 Bank Notes
Items

PostPosted: Sun Apr 26, 2020 10:16 pm    Post subject: Re: Problem with script Reply with quote

MrSpudnik wrote:

Is it possible?

Theoretically yes I guess. However it would require some RE work as I haven't looked into how garage_enablesteal and freeride_enablecar work under the hood yet.
Back to top
View user's profile Send private message
MrSpudnik

Junior Member
Junior Member


Joined: 31 Oct 2015
Posts: 51
Location: Ukraine
111 Bank Notes
Items

PostPosted: Tue Apr 28, 2020 9:06 am    Post subject: Problem with script Reply with quote

I can only give a description of the work in the game:
Code:
garage_enablesteal nn
allows a car of this type to be stolen during the mission
nn - type of car (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z)

Each car brand is assigned a letter in the files "carcyclopedia.def", "carindex.def". Is the car available for the player is recorded in the file "mafia000.sav" ("A" available by default).
After the introduction of the command, the possibility of hacking a car only works in the current mission. After saving and loading, Tommy forgets how to get into this car and now he has never seen such a lock before. So that he remembers forever, after the introduction of the command, need to take this brand of car to Salieri's garage. As soon as the car enters the garage area, it is recorded in the file "mafia000.sav" (even without saving game!). The car appears on the list of freeride cars and Tommy knows how to open the lock. This is not always convenient, therefore, in order not to go to Salieri, can add a car to the garage (not physically, of course) with a command "garage_addcar":
Code:
garage_addcar xx
xx - actor ID of car to add in garage.

But this command does not require a type of car, but an actor, which can also be difficult if the car is taken from traffic. To check, I used another separate script that adds to the garage all the cars in which Tommy gets on:
Code:
dim_act 2
getactiveplayer 0
findactor 1,"NULL"

label 101
wait 100
compareownerwithex 0,1,101,-1
human_getowner 0,1
garage_addcar 1
goto 101

Thus, the "garage_addcar" command wrote to car in file "mafia000.sav", and the "garage_enablesteal" command was needed to steal the car from city traffic.


Code:
freeride_enablecar nn
allows a car of this type to be used in freeride
nn - type of car (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z)

The "freeride_enablecar" command works on opening cars that do not participate in traffic, that is, bonus hot rods. It works a little differently, immediately after entering "freeride_enablecar" the information is saved in the file "mafia000.sav" and the car is available in the list and in the carcyclopedia. But here, too, is not without a catch. If you add such a car to city traffic (what was not provided in the game), in any case, Tommy never saw such a lock. Oops!
_________________

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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: 1.068 | Queries: 18