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

Can I connect two scripts?

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

New Member
New Member


Joined: 13 May 2020
Posts: 13

35 Bank Notes
Items

PostPosted: Thu Jun 25, 2020 1:02 pm    Post subject: Can I connect two scripts? Reply with quote

Hello, I would like to ask if it is possible to connect two scripts so that when I use the detector_waitforuse command in one of them, both scripts start working.

Or is there a way to relate the detector_waitforuse command to a specific frame?


For example: I have two boxes (and a script for each). If I go to one box and press the action button (detector_waitforuse), the other box should explode (explosion).
I found that the explosion command cannot be related to a specific frame, it always explodes the object that bears the script name.

(The same problem with the detector_waitforuse command, it also only applies to the script name.)

Is there a way to use one script to press the action button on one object to explode another (which may be far away)?
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 Jun 26, 2020 3:20 pm    Post subject: Can I connect two scripts? Reply with quote

If I understand correctly, you need to use command "detector_waitforuse" in one frame, and then another frame "explosion"? It is very simple to implement with the command "act_setstate".


First frame:
Code:
dim_act 1
findactor 0, "name of the second frame"

detector_waitforuse
act_setstate 0, active


Second frame:
Code:
.
.
.
act_setstate -1, inactive //write a string at the necessary stage of the script
explosion 25, 3000

_________________

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

New Member
New Member


Joined: 13 May 2020
Posts: 13

35 Bank Notes
Items

PostPosted: Sun Jun 28, 2020 7:25 am    Post subject: Can I connect two scripts? Reply with quote

Thank you!
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 - 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.015 | Queries: 18