OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: KyleSarnik on 20 Jun 2003, 03:27:41

Title: SetIdentity and Sunglasses
Post by: KyleSarnik on 20 Jun 2003, 03:27:41
 8) Ok I was able to make a mission where you can take your sunglasses on and off using triggers and setIdentity. You can take them off/put them on using radio. but I wanted to make them actions. So I put this in the players init box:

this addaction ["ShadesOn","shadeson.sqs"]

in shadeson.sqs I put:

player setIdentity "MyGuyShades"
player removeaction ShadesOn
player addaction ["ShadesOff","shadesoff.sqs"]


and I did the same thing for shadesoff.sqs

But in the mission when I click on the action ShadesOn the face doesn't change. Also it wont remove the ShadesOn action afterward. I don't get it. It worked with the triggers and radio. Does setIdentity command not work in scripts?? Plz help me.

:gunman:
Title: Re:SetIdentity and Sunglasses
Post by: borrowed soap on 20 Jun 2003, 04:12:02
1st setIdentity im beginning to believe can only be used (along with the other Identity commands) in the init file or the init field of objects, and not during mid game (some Identity commands are tied to the objects.save file, found in campaigns somewhere but hidden to prevent cheating) im glad to hear u managed it with triggers tho, cuz now im gonna try that for my Identity command prob
2nd if im right line should read
    player removeAction 0
where 0 is the identity of the action.  if u had added two actions, it would be eihter 0 or 1 depending on what order u added the two actions
Title: Re:SetIdentity and Sunglasses
Post by: LCD on 20 Jun 2003, 06:28:25
if it doesnt work in script but it works in trig deres simple thing u can do - make triger w/ da condition - shades nd make it repeatable - now on da on activision put playerName setIdentity "MyGuyShades" and on deactivision put player setIdentity "MyGuy"

nd da action wil b

this addaction ["ShadesOn","shadeson.sqs"]

in shadeson.sqs I put:

Code: [Select]
shades = true
(_this select 1) removeaction (_this select 2)
(_this select 1) addaction ["ShadesOff","shadesoff.sqs"]

nd

shadesoff wil b

Code: [Select]
shades = false
(_this select 1) removeaction (_this select 2)
(_this select 1) addaction ["ShadesOn","shadeson.sqs"]

didnt test but it shud work

LCD OUT
Title: Re:SetIdentity and Sunglasses
Post by: KyleSarnik on 20 Jun 2003, 18:39:44
hmm I see what you meen, I'll try it out.



Ok it works! This sort of thing could be used in any mission and add some detail. Thx everyone.
Title: Re:SetIdentity and Sunglasses
Post by: KyleSarnik on 20 Jun 2003, 21:00:39
I wonder if theres a way to play the binocular animation when you put the shades on and take em off. But you would have to use one for standing, crouch, and prone.
Title: Re:SetIdentity and Sunglasses
Post by: LCD on 20 Jun 2003, 21:57:10
i think it wil b (nd even den only lil) usefull in civic-type misions after all wen not it is not realy interestin ;) just wanna run n shot ;D  8)

Quote
I wonder if theres a way to play the binocular animation when you put the shades on and take em off. But you would have to use one for standing, crouch, and prone

nd dres no way 2 do dat  :-X

LCD OUT