Home   Help Search Login Register  

Author Topic: Scripted actions....  (Read 6294 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:addaction and parameters
« Reply #45 on: 06 Oct 2003, 00:43:17 »
Ah - in that case you would do it like:

{If (vehicle _plane) == _x select 0) Then {_array = _x}} ForEach my_array

_array exec "ejection.sqs"


:note - in my last reply i forgot to use _x select 0, what i did
in this reply.

OK, what does this if statement?:

It assigns the sub-array, where the vehicle where the action
has been called from, to _array.

You could pre-define a lot of obj-seatt-canopyt combinations,
and also defining one default combination (just in case there's
a plane, which doesn't exist in your pre-definition).

That's the point, which i still couldn't figure out from you:

How do you want to get your different seatt's and canopyt's,
other than pre-defining them somewhere.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:addaction and parameters
« Reply #46 on: 06 Oct 2003, 01:05:36 »
dbl-post  :-[

weird - first i cannot post anything (ya know - all those :my-sql
messages), and then i find two posts of the same :o

~S~ CD
« Last Edit: 06 Oct 2003, 12:50:19 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

KyleSarnik

  • Guest
Re:addaction and parameters
« Reply #47 on: 06 Oct 2003, 03:51:35 »
I want to get the seatt's and canopyt's from the parameters, [this,"KS_A10seat","KS_A10canopy"] exec "ejectactive.sqs"

All this is so fustrating, I really had my hopes up when KTottE said there is an eject eventhandler  :(.... Guess I gotta use arrays

Im going to ask you again, will this work for muiltiple planes and different seatt's and canopyt's among them? Please give me a yes or no answer... Because if I can figure this out it might work...

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:addaction and parameters
« Reply #48 on: 06 Oct 2003, 12:47:48 »
Y E S
[/b]

 :'(

Could you plz do me a favour now?

Could you try not to change what you want from post to post?

I mean the answer to your last question now, i have
already given you two posts above - there where i explained
you the array/sub-array stuff.

btw - i can't and i don't want to learn you the whole scripting
now.

:edit

All answers to your question are now posted in that thread
at least twice - now it's up to you to build your script.
I've updated it aswell, so that it should work for your wishes
now.

~S~ CD
« Last Edit: 06 Oct 2003, 12:56:36 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Unnamed

  • Guest
Re:addaction and parameters
« Reply #49 on: 06 Oct 2003, 15:55:22 »
Hmm....Here are two missions demonstrating how to use global arrays or the TypeOf command, for anyone who is interested.

The TypeOf command requires V1.91 the other does not.

You can see from both examples that you only need one script (MyEject.sqs) to be able to handle mulitiple aircraft.

P.S If this is still no help, perhaps you should ask for the thread to be moved to Scripting : Ideas ;)

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:addaction and parameters
« Reply #50 on: 06 Oct 2003, 16:04:53 »
Yeah Unnamed, i've had already a whole reply based
on the typeOf command in my reportoir, but then
i thought about: typeOf returns stuff like: plane - chopper
bmp, etc., what brought me to the conclusion: this might
not be useful here. Therefore i've posted a solution with
using the vehicle command.

Off course, if the typeOf command returns what you need
here, you could use this one aswell instead of vehicle _plane.
(haven't tested properly, what typeOf really returns now).

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Unnamed

  • Guest
Re:addaction and parameters
« Reply #51 on: 06 Oct 2003, 17:22:28 »
Sorry, I did not read all the posts in there entirety. But as typeof is restricted to version 1.91, it's probably wiser to avoid using it if you can.

I saw a something, somewhere, saying that TypeOf would return the parent class. But for an A10 it will return "A10".

Hopefully when the 1.92 comes out, we wont have so many different versions kicking about. Now that you wont be able to join a server with a lesser version.


KyleSarnik

  • Guest
Re:addaction and parameters
« Reply #52 on: 06 Oct 2003, 20:31:41 »
What??? What are you talking about?? Anyways I cant get the arrays to work, when I eject all the other planes using the script eject. Is it because its a global array? Plz help...

Unnamed

  • Guest
Re:addaction and parameters
« Reply #53 on: 06 Oct 2003, 22:30:36 »
Hehe..I was talking to Chris.

I attached an a couple of example mission for you using arrays, a couple of posts up. But here it is again, just in case.

KyleSarnik

  • Guest
Re:addaction and parameters
« Reply #54 on: 06 Oct 2003, 23:03:48 »
But that only allows the script to use predefined seat classnames, in my script it has to work with any seat classname, because then it will become useless and defeat the whole purpose of making this script. How hard is it to understand??? All I need is a way to get 3 simple parameters from one script to the next! I might have an idea, is there any way to assign an identification to a global variable?? What I mean is:

addaction script:

array = param2,param3

action script:

_obj = _this select 0

[_obj,array] exec "ejection.sqs"

But if I did it like that it wouldnt work with muiltiple arrays... So can I assign that array to that plane and use _obj to call the correct array for that plane??? This is really anoying!!! There MUST be a way to do this...!!

KyleSarnik

  • Guest
Re:addaction and parameters
« Reply #55 on: 09 Oct 2003, 01:11:33 »
I just can't figure this out!... Plz help me...

KyleSarnik

  • Guest
Re:addaction and parameters
« Reply #56 on: 09 Oct 2003, 22:44:28 »
I know its alot but please listen to what I have to say...


Ok, I have come up with some ideas but still don't know how to do them:

1. Have the addaction somehow activate a part of the same script. Is there a command I can use to detect if the action was used?

2. Do something to the plane and detect it in the same script with the addaction. What cammods can be used on the plane, have no appearent effect, can't be activated by units in game, and can be detected in a script, like a "set" and "get" type command.

3. Use the original "Eject" action, and use something to detect if its been activated, kind of like the eventhandler idea, if there is a way to do this...

4. Use local or specialy named arrays for each plane, or a way to type something (anything!) in the init to define a custom array. Ex: myarray1 = [this,"whateverIwanttoputhere","whateverIwanttoputhere"] or: plane1array = [plane1,"whateverIwant","whateverIwant"]; [plane1array] exec "ejectactive.sqs". This should work right? But how would I go about calling things from this array? Or could I "attach" the array to the plane so that in the script called by the addaction can use _this select 0 to get the array?

Ok now just to get this straight, Its not that I'm not listening to your answers, I just can't get it to work right, your still not telling me HOW I can call the array in the action called script. All that I am asking is to please explain HOW. I'm sorry if you allready did try to tell me, but I just didn't understand it, but please just explain it some more and eventually I will figure it out. And most of all please just don't give up and stop answering me. And if all else fails, perhaps I can get someone else to finnish the script for me, but I don't feel I've gotten there yet, so don't think I'm asking you to, because I'm not. Once again, thanks for the help so far, thanks in advance, and sorry for wasting some of your time, and last of all thank you for reading this long and boring post, but just remember it's for a good cause.

KyleSarnik

  • Guest
Re:Scripted actions....
« Reply #57 on: 10 Oct 2003, 23:01:29 »
I hope your not just ignoring me....
« Last Edit: 10 Oct 2003, 23:03:14 by KyleSarnik »

Harkonin

  • Guest
Re:Scripted actions....
« Reply #58 on: 10 Oct 2003, 23:23:35 »

KyleSarnik

  • Guest
Re:Scripted actions....
« Reply #59 on: 11 Oct 2003, 03:09:52 »
Well I could,'t find what I was looking for in there but thanks anyways... Ok, so I can define arrays, but can't call them, and I can't figure out to get it to call the right ones... Plz help...