Forum Jump :

Author Message


Posts: 7
Rank:


Level: Member

Country: af
Location:
Occupation:
Age: 29
In-game name:

 
#1 Posted at 2015-10-09 05:15        
     
Hello!

Basically I know the attach and detach script but I want to make it to where when I get into "turret1" attached to "truck1", "bike1" attaches to "truck1", and when I get into "turret(2)" attached to "truck1",it detaches "bike1" on the ground behind "truck1".

any help would be much appreciated! :-)

Added 54 minutes later:

I have done research and have decided to do the same thing in a different way without the static guns.I found out how to add actions but the script I'm using has a "gunIsNowAttached = true",I'm not using a gun so my question is there another substitute word for this that would refer to a vehicle?
here's the script :-)

truck1 addAction ["<t color='#ffffff' size='1'>Attach to truck</t>", [COLOR="#FF0000"]{ bike1 attachTo [truck1,[0,1,1]]; *DONT_KNOW* gunIsNowAttached :-( = true; }[/COLOR], [], 1, false, false, "", "!gunIsNowAttached"];
truck1 addAction ["<t color='#ffffff' size='1'>Detach from truck</t>", [COLOR="#FF0000"]{ detach bike1; gunIsNowAttached = false; }[/COLOR], [], 1, false, false, "", "gunIsNowAttached"];

This post was edited by PoopOnMeIDC (2015-10-09 06:30, 795 days ago)

Mods Mods And More Mods,And Here Come The Scripts....Does It Ever End?

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#2 Posted at 2015-10-09 09:14        
     
gunisNowAttached is a simple name of a variable (used as a true/false flag). You can write what you want instead. There is no effect/relatioship on the type of what you're trying to attach on your truck.

See the former post: https://forums.bistudio.com/topic/168424-attach-back-to-object-addaction/
By the way, if i remember, when you attach something, you disable the "simulation" of this object. In other word, impossible to fire with an attached gun.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Advertisement


Author Message


Posts: 7
Rank:


Level: Member

Country: af
Location:
Occupation:
Age: 29
In-game name:

 
#3 Posted at 2015-10-09 10:14        
     
No because I've already attached many guns to aircraft,cars,trucks, you name it.It doesn't disable simulation

Mods Mods And More Mods,And Here Come The Scripts....Does It Ever End?

Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#4 Posted at 2015-10-09 11:25        
     
Pierre attaching disables only the physics simulation of the attached object.

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage