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 - "compareactors"

 
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: 575
Location: London, England
8240 Bank Notes
Items

PostPosted: Thu Sep 19, 2013 2:18 am    Post subject: Script problem - "compareactors" Reply with quote

I've thrown together this script with the intention of "turning off" 'actor 1' once 'actor 2' has come close enough to it, but my luck being what it is the script is not working.
Has anyone got any ideas why?

Code:
dim_flt 5
dim_act 2

findactor 0, "RTtrain"
findactor 1, "brickwall"

label CHECKDIST
findnearactor 0, 1
findnearactor 1, 2
compareactors 1, 2, 0
if flt[0] = 5, -1, CHECKDIST

act_setstate 0, off


Note: The first actor is a train model that I've made move with a script designed to move any frame/physical object, so it's not really supposed to move, but surely once the frame/model itself is close enough to the second actor, the second actor should still "turn off"?

Below, for reference, is the script used to make the train move in the first place:

Code:
dim_flt 20
dim_frm 3
dim_act 1

findactor 0, "RTtrain"
findframe 0, "RTtrain"
findframe 1, "vrch"
findframe 2, "vrch2"

frm_seton 2, 0

detector_waitforuse

commandblock 1
frm_seton 1, 0
frm_seton 2, 1
commandblock 0

label TRAIN_MOVE
frm_getpos 0, 0
let flt[0] = flt[0]+0.1
frm_setpos 0, 0
actor_setdir 0, 2
let flt[9] = flt[9]-8
commandblock 0
commandblock 1
goto TRAIN_MOVE

_________________

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

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 575
Location: London, England
8240 Bank Notes
Items

PostPosted: Fri Sep 20, 2013 5:25 pm    Post subject: Script problem - "compareactors" Reply with quote

Thanks a lot Darren, you can see the end result here Very happy

Just one more question, what are the specific functions of 'vect_sub_vect' and 'vect_magnitude'?
I'm not sure I understand them fully but they seem to carry a lot of potential!
_________________

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

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 575
Location: London, England
8240 Bank Notes
Items

PostPosted: Mon Sep 23, 2013 8:53 pm    Post subject: Script problem - "compareactors" Reply with quote

Wow, it'll take me a while to get my head around all that!
_________________

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.014 | Queries: 22