Home   Help Search Login Register  

Author Topic: In search of a script.  (Read 1506 times)

0 Members and 1 Guest are viewing this topic.

MajDraper

  • Guest
In search of a script.
« on: 26 Aug 2006, 19:31:37 »
Hey,

Im looking for a script out there. Here is the jist, I got a helo sittin in base, and to make my mission a little more dynamic and replayable, i want you to be able to select 1 of 3 LZ's perferably through an action menu, or radio.  Im pretty confident there was a script like this in the editors depot but you all know...

It would be great if any of you good give me a reference to a mission that uses it or if any of you have it lying around you harddrives that would be awsome, I would make a script myself but i decide long time ago i didnt have the patience for it.

Thx
« Last Edit: 28 Aug 2006, 16:39:51 by h- »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: In search of a script.
« Reply #1 on: 26 Aug 2006, 23:15:53 »
Quote
I would make a script myself but i decide long time ago i didnt have the patience for it...

hmmm. so you would rather climb on the shoulders of those who do have the patience for it? if you just want a quick solution made by someone else, i suggest you post a request in the recruitment depot.

if you have a bit more interest in how to make a better mission and how to become one of the many valued and dedicated contributors to this site, i suggest looking at the onmapsingleclick and setwppos commands...

MajDraper

  • Guest
Re: In search of a script.
« Reply #2 on: 27 Aug 2006, 01:41:35 »
Look im just asking if anyone has the script that was cataloged on this site before it had server issues, I figured that this could save some time, if you dont think this is the right place to be asking anyone if they have it then you can move it to where you see it apropriate.

And maybe i dont want to become a valued and dedicated contributor to this site because of an attitude like that, but the last thing i want is to be going back and foreth with an admin so im not goina say a thing about that from now on and leave it to the topic of discussion.

Thanks for the suggestions though.

Offline rhysduk

  • Former Staff
  • ****
Re: In search of a script.
« Reply #3 on: 27 Aug 2006, 03:07:59 »
Maj. Draper:

How long have you spent on your mission so far? Assuming you've spent more than a day or two on the mission, you're unwilling to learn a bit of simple scipting to accomodate a feature in your mission? Really, if you wish to create a mission that accomodates features that you do not know how to implement, surely it would be more beneficial to scrap that feature, than to lean on the community do your work for you?

Bedges is correct, if you wish to improve your mission making skills, then surely you will have to broaden your horizons at some point? One sure way of this, is to learn the not-so-difficult form of scripting.

Good luck with your mission.

Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: In search of a script.
« Reply #4 on: 27 Aug 2006, 10:37:33 »
in retrospect i may have sounded a wee bit harsh. we take a dim view of people who expect a working solution handed to them on a plate, when the vast majority of OFPEC users are here to learn how to do it themselves.

we do offer a repository of resources made by users who are keen to help the community, and who offer the fruits of their labour so that others can be saved a headache. thus looking for a ready-made script hosted by the site is perfectly fair. but to admit straight off the bat that you can't be bothered making one yourself can seem galling to those who have spent the time, who have worked through the headache, and have experienced the sense of achievement when it finally works as intended.

at the end of the day OFPEC is all about learning and sharing information. to that end i've attached a missionette featuring two working methods of getting a chopper to a chosen LZ. it took about 10 minutes, the scripts won't win any awards, but they work. hopefully you can take what you need from it.

MajDraper

  • Guest
Re: In search of a script.
« Reply #5 on: 27 Aug 2006, 20:48:24 »
Well, in response, yes if i wanted to broaden my understanding then i would have to challenge my self in learning the commands and how to use them, but at the current time I do not wish to do this, maybe in the future.

And though it may be easy scripting, I wouldn't know because I havent taken the time to apply myself to it or even try.  plus im not looking to publish it all across the web I just wanted to put it in to be played among friends so yes it was only mere hours spent on it so far.

Bedges I want to thank you for taking your time to appease a scripting noob such as myself and im sorry if I offend any of you or came off as rash about not attempting to do it myself and trying to have you get the headache rather then me.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: In search of a script.
« Reply #6 on: 28 Aug 2006, 09:54:59 »
It all depends on what you want: quickly knocking together a mission for some friends to play, or working through the idiosyncrasies of OFP to create exactly the effect you are looking for, with a whole range of options between.  All approaches are equally valid and can be fun, so Major your apprach is just as valid as anybody elses - but talking about "no patience" is like saying "I can't be bothered - you do it for me" - not an endearing feature in anyone.  The advantage of playing around trying to do things in OFP is that you learn a lot about how it works, and so new possibilities occur to you.

Anyway guys - back on topic please.
A quick way to to what you want is as follows.

1.  Find your three LZ locations - these should be on flat ground away from any trees (or the chopper might not land there)
2.  Place an H (Invisible) object at each location (found under Empty Objects)
3.  Give each one a name LZ1  LZ2   LZ3
4.  Put the following in the init field of the player:

GoToLZ1 = this addAction ["Go to LZ1", "LZ1.sqs"];GoToLZ2 = this addAction ["Go to LZ2", "LZ2.sqs"];GoToLZ3 = this addAction ["Go to LZ3", "LZ3.sqs"]

5.  LZ1.sqs should be something like:

Code: [Select]
[group choppername, 1] setWPPos getPos LZ1

player removeAction GoToLZ1
player removeAction GoToLZ2
player removeAction GoToLZ3
exit
With obvious change for LZ2 and 3

Note that this assumes that the first waypoint for the chopper is the one at the LZ.  If not then the 1 in group choppername, 1  should be changed to whatever WP you want at the LZ - note here that you should count the waypoints in the Mission Editor, so the first is 1 (event though it is shown as the 0 Waypoint when you double click it).

Note I have not tested this so you may need to play around with it.  I suggest you read:

setWPPos: http://www.ofpec.com/COMREF/index.php?action=list&letter=s#setWPPos
addAction: http://www.ofpec.com/COMREF/index.php?action=list&letter=a#addAction
removeAction: http://www.ofpec.com/COMREF/index.php?action=list&letter=q#removeAction

Having written all that I now think it would be better if the Actions are added to the chopper not to the player.  I leave that as an exercise for you. :)



Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re: In search of a script.
« Reply #7 on: 28 Aug 2006, 11:50:00 »
Maj.Draper, i'm afraid you neet to learn some of these commands anyway to get it
to work properly in your mission.

If not you will not know what to do in case your situations differs a tiny little bit
from the situation imagined by the guys who did it for you.

Also i know well about the: huh scripting that's way too complicated for me i'll try
it the easy way - hell we all started that way - but more and more you will try to
investigate what happens why. Especially when some things in your mission don't
work and you need to find out the reason.  :yes:

~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

MajDraper

  • Guest
Re: In search of a script.
« Reply #8 on: 28 Aug 2006, 19:00:01 »
Ok I finally, really, really looked at the command refernce, and using a basic chopper taxi script modified it for 3 LZs including a waypoint, I mean an object that could the chooper flew to first then to the 2nd or 3rd lz. bedges script worked well except when i merdged it to work with my mission It would just hover, I may have deleted to much when I tried to take out the mapclick option. And I used actions selectable by the chopper as thobson explained.

But this makes it even more confusing in that you can use markers and objects to get something to move some where to have something move to it with and to have the markers make an object in bedges script or a predetermined waypoints as thobson suggested (if i understand this all correctly.)

And again I wanna say, I never intended in my first post to say that I wanted to put it on any of you, I was just wondering if any of you had scripts that you knew off that would work because making a script from scratch it not something I could really do at my level of understanding, I wasnt asking anyone to make it for me but bedges and thobson actualy took time to tell me a basic work up of how to get it done, none of you had to actualy even ansewer me but you graciously did and I thank you all for your advice.