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

Script problem

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

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 752
Location: London, England
13714 Bank Notes
Items

PostPosted: Wed Aug 21, 2013 8:31 pm    Post subject: Script problem Reply with quote

EDIT: Sorted, thanks though Matteo Smile
_________________

The official Mafioso Mod thread

Last edited by AsaSK on Wed Aug 21, 2013 11:20 pm; edited 4 times in total
Back to top
View user's profile Send private message
MatteoCapoletti

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 05 Mar 2013
Posts: 522

1017 Bank Notes
Items

PostPosted: Wed Aug 21, 2013 11:13 pm    Post subject: Re: New to variables Reply with quote

AsaSK wrote:
Hey all,

This is one of the first 'if' statement scripts I have done and, as expected, it doesn't work.. when I get close to the object/actor it doesn't become inactive/disappear Sarcastic

Can anyone identify what is wrong with the script?


dim_flt 1
dim_act 2

findactor 0, "Tommy"
findactor 1, "TryGoingThatWay"

label GETDISTANCE
getactorsdist 0, 1, 0
if flt[0] < 2, DISAPPEAR, GETDISTANCE

label DISAPPEAR
act_setstate 1, inactive





Try:

if flt[0] < 2, DISAPPEAR,1

GOTO GETDISTANCE

Now I think that's half the problem, ...because as it was formated I don't think it was looping


so it went through the code on load, and when right on out the end

If your character "trygoingthatway" is still active

Is that character a real actor, or just a sign

because act set state will not remove the model, it will just turn into a "dead model"

If you want it to disappear, that's another command....which I may have to wait to get home to look up
Back to top
View user's profile Send private message
AsaSK

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 752
Location: London, England
13714 Bank Notes
Items

PostPosted: Wed Aug 21, 2013 11:39 pm    Post subject: Re: New to variables Reply with quote

MatteoCapoletti wrote:

Now I think that's half the problem, ...because as it was formated I don't think it was looping


so it went through the code on load, and when right on out the end

If your character "trygoingthatway" is still active

Is that character a real actor, or just a sign

because act set state will not remove the model, it will just turn into a "dead model"

If you want it to disappear, that's another command....which I may have to wait to get home to look up


In the end I used detector_inrange and followed your instructions to flag the hex, which I can't thank you and Axel enough for, by the way Very happy

The actor is a sign and as it happens that particular sign model can't be defined as an actor I later found out, but act_setstate does get rid of any other model defined as an actor. Putting 'off' after it leaves the "dead model" like you say, but putting 'inactive' does get rid of it. There was nothing wrong with my script, only the model I used.. just my luck!

Thanks bro Smile
_________________

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

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 08 Apr 2013
Posts: 50
Location: Grevenbroich / Germany
1254 Bank Notes
Items

PostPosted: Sat Aug 24, 2013 7:04 pm    Post subject: Script problem Reply with quote

If you have a dead or inacivated actor that doesnīt disappear you can disable itīs frame so it becomes invisible e.g.

dim_flt 1
dim_act 2
dim_frm 1

findactor 0, "Tommy"
findactor 1, "TryGoingThatWay"
findframe 0,"TryGoingThatWay"

label 101
getactorsdist 0, 1, 0
if flt[0] < 2, -1, 101

act_setstate 1, inactive
frm_seton 0,0


just if you donīt know already...
_________________


V3NT1L4T0R
Back to top
View user's profile Send private message
AsaSK

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 752
Location: London, England
13714 Bank Notes
Items

PostPosted: Sun Aug 25, 2013 1:39 pm    Post subject: Script problem Reply with quote

Thanks Ventilator, I ended up following the instructions you gave Matteo on the old MS on how to flag the detector_inrange in the hex Smile
_________________

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

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 08 Apr 2013
Posts: 50
Location: Grevenbroich / Germany
1254 Bank Notes
Items

PostPosted: Sun Aug 25, 2013 4:48 pm    Post subject: Re: Script problem Reply with quote

AsaSK wrote:
Thanks Ventilator, I ended up following the instructions you gave Matteo on the old MS on how to flag the detector_inrange in the hex Smile

I donīt remember trying to hex a detector inrange script.
Anyway i donīt think thereīs much to hex in such an easy script.

Once i tried to force an actor to return to the pedestrian traffic with the human_returntotraff command.
The actor did return to the traffic and dissapeard within pedestrians but he left a frozen shell. Shocked The only way to get rid of that shell is to find itīs frame and set it to zero. Wink
_________________


V3NT1L4T0R
Back to top
View user's profile Send private message
AsaSK

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 752
Location: London, England
13714 Bank Notes
Items

PostPosted: Mon Aug 26, 2013 12:40 am    Post subject: Script problem Reply with quote

How strange What?
Are you working on anything Mafia-wise at the moment? I enjoyed the bodyguard mod ridiculously and it's rare to find someone who can model and script as well as you can.
_________________

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

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 08 Apr 2013
Posts: 50
Location: Grevenbroich / Germany
1254 Bank Notes
Items

PostPosted: Tue Aug 27, 2013 3:07 am    Post subject: Re: Script problem Reply with quote

AsaSK wrote:
How strange What?
Are you working on anything Mafia-wise at the moment? I enjoyed the bodyguard mod ridiculously and it's rare to find someone who can model and script as well as you can.

Iīm working on a freeride extreme mod.
I added a load of scripts and some new roads to the city plus a Stunt car race track around Central Island with loopings and jumps.
Unfortunetley MWE messed up my scene2.bin a lot of times so i had to start all over again and again. Impossible
_________________


V3NT1L4T0R
Back to top
View user's profile Send private message
AsaSK

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 752
Location: London, England
13714 Bank Notes
Items

PostPosted: Wed Aug 28, 2013 9:43 pm    Post subject: Script problem Reply with quote

Ah :/ been there. Well I hope it doesn't let you down this time, I'm always curious to see extended versions of the city scene.4ds, can't wait!
_________________

The official Mafioso Mod thread
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 - Tools 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.027 | Queries: 18