Page 5 of 5 FirstFirst 12345
Results 41 to 48 of 48

Thread: createVehicle for a plane plus waypoints

  1. #41
    Hi Avon!

    Glad to have come across this post as this is sort-of *** ***exactly what im doing.

    First of all <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">dotarget/dofire commands[/QUOTE] never work *** ***or at least not for planes as they go to quick and they usualy do what they want anyway. ***


    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    _apos = &#91;getpos soldier select 0,&#40;getpos soldier select 1&#41; - 1100,&#40;getpos soldier select 2&#41;+900&#93;; this just sets the plane to spawn behind soldier

    vpilot = &#91;&#93;
    &#34;SoldierWPilot&#34; createUnit &#91;getmarkerPos &#34;start&#34;,GROUPp51,&#34;vpilot=this&#34;,1&# 93;

    _p51 = &#34;ECA_P51Dstrike&#34; createVehicle _apos
    ;WW2EC_D3A1

    _p51 setpos &#91;getpos _p51 select 0, getpos _p51 select 1, &#40;getpos_p51 select 2&#41;+900&#93;;sets plane height to make sure its there

    &#91;_p51&#93; exec &#34;marker.sqs&#34;; this just shows the planes position on the map

    _p51 setdir &#40;getdir soldier&#41;
    _p51 engineon true


    vpilot moveInDriver _p51

    _p51 setpos _apos

    ~1

    GROUPp51 setSpeedMode &#34;Normal&#34;

    _p51 domove &#40;getpos soldier&#41;
    _p51 setBehaviour &#34;Combat&#34;
    _p51 setCombatMode &#34;RED&#34;

    _apos2 = &#91;getpos soldier select 0,&#40;getpos soldier select 1&#41; + 100,getpos soldier select 2&#93;
    ~5
    _target = &#34;LesIAETA&#34; createVehicle _apos2;see below

    _p51 dotarget _target
    _p51 dofire _target

    exit[/QUOTE]

    Being playing around with your script. And this is what i have. Its a script that i hope to use with the onmapsingleclick but i need help. For now its set up for testing

    Ok so its very much a carbon copy *** ***(i would ask for permission before releaseing ***)

    Now LesIAETA is an East Armoured target, which spaws invisable, which makes the plane appear to the player, to be attacking a defined spot. (so to indicate a targeted strike by the plane)

    Have you thought of doing something like this? where the player clicks his target on the map and the plane then attacks? instead of those waypoints.

    Does anyone know of onmapsingleclick tutorials? i need to know how to get the position of the click and create a marker/icon.

    Thanks
    TF

    edit: Forgot to say BTW this script works %110 of the time for divebombers




  2. #42
    The one and only OFP MOM
    Join Date
    Jul 4 2001
    Location
    Jerusalem, ISRAEL
    Posts
    7,641
    Author of the Thread
    Quote Originally Posted by (Trenchfeet @ Oct. 03 2004,05:00)
    Ok so its very much a carbon copy *** ***(i would ask for permission before releaseing ***)
    I simple thank you is more than enough.

    And I couldn&#39;t have put it together without everyone&#39;s help here anyway.

  3. #43
    @ Trenchfeet

    I have been looking into this exact same idea for a short while now. I stopped looking into this as I quickly realized that I would like it to spawn an enemy to whoever clicks on the map and that would take a little more than my current level of scripting ability will permit. My very first script was made to attach one of Lester&#39;s invisible targets close to a unit and when that unit is eliminated, it would then attack the next group leader. I actually wanted it to attach an invisible target that was an enemy to the clicker&#39;s (players) side to a unit in the group closest to a singlemapclick and have it randomly attack a unit in that group until the group is destroyed or the player stops the attack. As this was beyond my means, I was happy to get a scaled down version to work by pre-placing the invis targets and then initiating the script bt way of a trigger of some sort. I was looking at skumball&#39;s napalm script that LCD updated as he used a singlemapclick initiate the script but have not had the time to implement this portion into my script. As I would like to pursue this further, perhaps PM me or start a new topic so we will not continue to hijack AL&#39;s topic. ***

    Wadmann
    Check out my Camouflage collection&#33; Now with more tiger stripe&#33; Updated 31 July 2005.

  4. #44
    (check your pm Wadmann)


    hope this isn&#39;t off topic but did anyone notice that planes will always attack an AA soldier after destroying any armour target?

    are we able to make all soldiers have the AA soldiers class?

  5. #45
    Ive spent over 2 hours on a useless ADSL connection reading around this forum for help
    and in fear of "not asking for help" and avoiding the usual noob bash lmao
    im completly at a loss

    I don't know whats happend with most the topics on this site... but the information has become a Useless Jumbled up Mess ..... the first post in this thread is a nightmare to understand :'(

    For Exmple... that below is now total giberish...

    Quote Originally Posted by hardrock View Post
    hm AFAIK you can't dynamically create WPs

    but you can do it like that:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_aPos = [1,2,3]
    _aSpd = 400
    _aDir = 0

    _tPos1 = [1,2,3]
    t1destroyed = false
    _tPos2 = [1,2,3]
    t2destroyed = false

    _aVel = [sin(_aDir)*_aSpd, cos(_aDir)*_aSpd,0]

    _plane = "A10" createVehicle _aPos
    _plane engineOn true
    _plane setDir _aDir
    _plane setVelocity _aVel

    while {(speed _plane)<_aSpd} do {_aVel=velocity _plane; _plane setVelocity [1.05*_aVel select 0, 1.05*_aVel select 1, 0]}

    _plane setBehaviour "Combat"
    _plane setCombatMode "RED"

    ;; WP 1 ---------------------
    _plane doMove _tPos1

    #wait1
    ~0.5
    ?! (t1destroyed) : goto "wait1"

    ;; WP 2 ---------------------
    _plane doMove _tPos2

    #wait2
    ~0.5
    ?! (t2destroyed) : goto "wait2"
    That's just a simple example for how to do the whole thing with two waypoints. Of course you have to change the position arrays in the beginning of the script. You can also include dynamically moving of the waypoint positions, maybe also moving of a preset trigger for the conditions.

    Note that the boolean t1destroyed has to be true to let the plane move on to the next waypoint.

    Edit: changed a bit of the script[/QUOTE]

    ---------- Post added at 16:47 ---------- Previous post was at 16:46 ----------

    WTF... you have to quote reply with someones quote to be able to read it?
    ok well now thats just weird...[COLOR="Silver"]

    but me thinks the code still has issues
    i just want to spawn an enemy "unit" and enemy "vehichle" and assign them both names, locations, and optional sqs in their INT's
    this sites a nightmare :'(
    Last edited by TheWraith; Aug 24 2012 at 15:52. Reason: total utter confusion...

  6. #46
    Quote Originally Posted by TheWraith View Post
    e first post in this thread is a nightmare to understand :'(
    That's because the first post was nearly 8 years ago and uses an outdated tag. Perhaps code tags weren't in use then. The search engine can play tricks on you like that if you're not careful.
    Documentation is not a dirty word.
    : TeamSPAFF : PRACS : RKSL : Stella Artois : Creme Eggs : GITS :

  7. #47
    Exactly that. And please stop digging out 8 year old threads when you have nothing important to add to them. Instead, you could have asked one of the moderators about this.

  8. #48

Page 5 of 5 FirstFirst 12345

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •