Home   Help Search Login Register  

Author Topic: Detecting dist, and some more.  (Read 5821 times)

0 Members and 1 Guest are viewing this topic.

DoDgY

  • Guest
Detecting dist, and some more.
« on: 30 Jul 2005, 19:21:29 »
 Hello, this is my first post, and I've just got back into OFP. A few years ago, I left OFP because of some other games that were in no way as good, but I found them more accessible in the multiplayer department. However, I've recently had a blast on a 'Single Mission' in OFP and now have completed the original and RedHammer campaigns, as well as being about half way through the Resistance campaign. And guess what...now I want to make missions!

I did learn a few things about scripting in OFP before I left, but now I simply cannot remember a thing :( . I've searched the FAQ, posts and some other websites but found this is definitely the place for answers to my questions. I had a few dozen queries but found most of them with the search command :).

I doubt I refined my search correctly but I couldn't find anything specific enough for a few queries. So here goes...

1) How can I make some machine gunners ready to open fire on a nearby base actually detect all of the enemy soldiers below? I have them in definite firing range, but is there a command or anything I can put in their init field to increase their detecting distance?

2) I have a soldier who's walking into a base wearing an enemy's uniform (I guess the best way is to deletevehiclethis a grouped friendly soldier?) but there are a few problems.

Firstly, I don't want him to use the weapon he has slung on his back until a certain time. Should I do this by the simple 'careless' combat mode? I know about the 'setcaptive true' part.

Secondly, I want him to walk in and in very specific places, to drop a satchel charge/mine and walk around the base doing this. Is there a simple script I could adapt, as waypoints really don't work for this. In the official missions, I see people dropping mines and satchel charges and I don't know how to make the man walk to specific positions or drop the bombs.

3) Are there any voice commands I could use for the soldier after he has completed his mission? That's too vague so I'll go into more detail: I want the man to walk around the base dropping his bombs. I then want him to get in a UAZ and drive away down the dirt track. When he's done that, I want him to report to his friendly forces something along the lines of:

"The bombs have been dropped; proceed with mission." Are there any non-specific voice things that may have been used in an official mission, that I can use for that? Where do I find them? ([Un]official command reference?)

I don't know how to execute them either, though I should be able to find that in one of the references now I come to think of it.

4) I'd like, on another mission, all the soldiers to open fire over a longer distance, instead of about 200m I'd say 600, but with less precision, and for machine gunners about 900m. If possible, I'd like to have an option that doesn't involve installing an AI upgrade, I only want the increased firing range.

5) How can I make a machine gunner actually use 'support fire' My WIP improvisation for this is to use the JAM2 machine gunner with HD, so that he'll rarely hit what he is firing at and keep firing.
Is there a better way so that I can get the gunner to fire in long bursts of say 20 to 30 rounds then stop for a few seconds, then fire another burst. Even if he's not firing at a soldier, could he still just lay down a hail of rounds anywhere below, where the enemies are located?

6)I didn't search for this, but as I'm asking a load of questions here anyway, maybe I could get a specific answer to this :)

I would like to know how to "stack boxes" e.g. get the position of "box1" and tell "box2" to go to the position of "box1" but 0.5m higher. Also can I place a box or anything where I put it in the editor but, say,5m higher? So I don't have to setpos (as this takes ages).

Thanks very much for reading this and thanks a lot in advance.

DoDgY.

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #1 on: 30 Jul 2005, 19:35:03 »
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=24824 I found this link that answered part of my second question, as to how to drop the satchel charges and mines, thoguh the specific movement is still a mystery for me.

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #2 on: 30 Jul 2005, 19:57:34 »
Well, off the top of my head i can answer the last question :P

box2 setPos [getPos box1 select 0, getPos box1 select 1, 0.5]

Edit.

5. I don't think that's possible without a fast loop script.
« Last Edit: 30 Jul 2005, 20:07:49 by Dane »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Detecting dist, and some more.
« Reply #3 on: 30 Jul 2005, 20:01:33 »
Or maybe even:

box2 setPos [getPos box1 select 0, getPos box1 select 1, (getPos box1 select 2)+0.5]

 ;D ;D

Planck
I know a little about a lot, and a lot about a little.

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #4 on: 30 Jul 2005, 20:07:05 »
Nop. box2 setPos [getPos box1 select 0, getPos box1 select 1, 0.5] will do ;)

Offline Pilot

  • Contributing Member
  • **
Re:Detecting dist, and some more.
« Reply #5 on: 30 Jul 2005, 20:24:11 »
Wonderful!  Another prodigal son has returned! ;D

Welcome back! :wave:

1: Try using the reveal command.
MGunner reveal ManInBase

Or, you could make an array of everyone in the base, put the following line in init.sqs:
BaseArray = [BaseMan1, BaseMan2, BaseMan3...]
just replace BaseMan1, ect with the names of the men in the base.  Then write the following in all of the machine gunners' init fields:
"this reveal _x" foreach BaseArray

2: Uhh, try something like this:

_man = _this select 0
_i=0

_MarkerArray = ["marker1", "marker2", "marker3"...]

#Loop
?_i=count _Markerarray: exit
man move getmarkerpos (_markerarray select _i)
@unitready _man
if (_man hasweapon "pipebomb") then {_man action ["Put", "Pipebomb"]}
_i=_i+1
~2
goto "Loop"

call the script like this: [NameOfSpy] exec "WP.sqs"
Of course, make sure you name the script WP.sqs ::)

I am assuming you are using markers for the waypoint position.  Put the markers where you want to man to go, and then type their names in the following line:
_MarkerArray = ["marker1", "marker2", "marker3"...]
Make sure to keep the quotes!

3: I don't know of any, but then, I haven't finished any of the official campaigns either.

4: Uh, for this you may want to play around with the reveal command as well

5: I don't know with this one

6: Everyone else already answered, so I won't bother to ;D

If nothing makes sense of what I wrote, don't worry, I have a knack for making things harder than they should be ::) ;D  

Just ask me to clarify anything that doesn't make sense.

Btw, Syntax not guarenteed for anything you have just read ::)

Good luck!

-Student Pilot

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #6 on: 30 Jul 2005, 21:12:03 »
Thanks very much for all your help :) I'll try it out tomorrow when I have time, and get back to you tomorrow as well.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Detecting dist, and some more.
« Reply #7 on: 30 Jul 2005, 23:00:06 »
2. Pilot has it, but i wold use game logics - its just my preference, dunno which is better (lag causing?)
you may also want to use domove because i believe you might get a radio response from the man if he's given a move command

3. I "borrowed" this sound from another gam of mine, Ghost Recon, and changed it to ogg format. its attached below. I can also give you the description.ext that i used for it

5: you could use an invisible target addon, with a combination of setcombatmodes and dofires,dotargets etc
just an idea, and i might not work %100 (probably won't)




Offline Pilot

  • Contributing Member
  • **
Re:Detecting dist, and some more.
« Reply #8 on: 30 Jul 2005, 23:19:37 »
Quote
but i wold use game logics - its just my preference, dunno which is better (lag causing?)
Yeah, I use markers just because that's the way I've always done it.  I guess it just matters what one's personal preference is ::)  I'm not sure how lag is affected

Quote
you may also want to use domove because i believe you might get a radio response from the man if he's given a move command
Yes, Triggerhappy is right, but maybe for a wrong reason :P.  Use move for groups, domove for individual men.  I'm not sure about the radio response, though.

-Student Pilot

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Detecting dist, and some more.
« Reply #9 on: 30 Jul 2005, 23:51:32 »
lol, true, i took you for granted that it would work ;D ::)

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #10 on: 31 Jul 2005, 00:13:23 »
Quote
I'm not sure how lag is affected

I do believe a marker is less resource demanding than a gamelogic because a gl is like an invisible object, can have waypoints and such.. i think so :P ::)

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #11 on: 02 Aug 2005, 21:52:35 »
OK, I finally got to try out your advice, and I'm sure it's great...but as I said before, I have little or no idea about scripting. I've totally forgotten everything. :o I was never any good, and only made very simple scripts. I read some tutorials and now have some idea, but I've got a problem that I expect any of you can answer:

Here it is:

I have in the init field of a unit [this] exec "reveal.sqs" and the mission is called 'Attack'.

In all the subfodlers etc, in the 'Attack' mission folder I have a script named 'reveal.sqs'

Code: [Select]
;to reveal units

gunner1 = _this select 0

[gunner1] reveal [soldier1,soldier2,soldier3,soldier4,soldier5,soldier6,soldier7,soldier8,soldier9]

exit

My script. I know it must be wrong, and it's so simple :(.

On top of that, I really don't get the public and private variable mumbo jumbo. I read SnYper's intro to code snippets but I cannot understand it all, though I will, when I have the time, go through it properly.

Again, thanks in advance!

P.S. Thought it better to not make another thread.

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #12 on: 03 Aug 2005, 13:47:40 »
Oops, forgot to mention a crucial thing that when I press 'preview' the mission doesn't start and I get an error message "Script "reveal.sqs" not found." I know it's in the right folder.

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #13 on: 03 Aug 2005, 15:30:02 »
Are you sure your calling the script right, because if you are and script is in mission directory you shouldn't get that message?

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #14 on: 03 Aug 2005, 19:02:21 »
[this] exec "reveal.sqs"  ???

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #15 on: 03 Aug 2005, 19:44:40 »
Oh dear oh dear. I just realised my file is a .txt. Damn- it's been longer than I thought! Oh well...

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #16 on: 03 Aug 2005, 20:22:25 »
Hmmm like you said to, I've been playing around with the reveal command a lot but it's not working like I want it to.

I have a machine gunner called gunner1 and an enemy called eastgunner1. My script goes:

Code: [Select]
;to reveal units

gunner1 = _this select 0


[gunner1] reveal eastgunner1

exit

And this isn't working. Out of scripting and with a trigger, I treid the reveal command and it works...but I did some research and as the KnowsAbout value only rises to 1, the gunner still doesn't fire even though he is within range. BTW I am using Resistance.

So, if you can tell me what's wrong with the script that would be greatly appreciated, and also is there a way to make the reveal command create a greater KnowsAbout value than 1?

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #17 on: 03 Aug 2005, 21:00:01 »
I get error message with this:
Quote
gunner1 = _this select 0

[gunner1] reveal eastgunner1

but this works for me:
Quote
gunner1 = _this select 0

gunner1 reveal eastgunner1

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Detecting dist, and some more.
« Reply #18 on: 04 Aug 2005, 03:26:35 »
why exactly are you reassigning the name gunner1 to "_this select 0"

if you are using the global variable name of the gunner then just eliminate that completely and call the script as [] exec "reveal.sqs"

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #19 on: 04 Aug 2005, 15:30:31 »
:) Thank you guys, I'll try it out now!

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #20 on: 04 Aug 2005, 15:53:36 »
Hmm the reveal command doesn't seem to be helping, when the script is activated, the gunner1 aims in a direction different to his initial one but still does not aim at the eastgunner1. So, as above is there any way to get this to work? If not I'll find a support fire script.

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #21 on: 04 Aug 2005, 16:36:13 »
Hmm I have decided to do this a different way:

Code: [Select]
gunner1 reveal eastmarker
gunner1 doTarget eastmarker
gunner1 doFire eastmarker

eastmarker is a Game Logic and for some reason, the gunner1 will not fire on it.

I know this is the wrong way of doing it; can anyone tell me how to get this gunner1 to fire at the base below, even if it's not an actual target, just to fire at the base?

Cheers.

Offline Pilot

  • Contributing Member
  • **
Re:Detecting dist, and some more.
« Reply #22 on: 04 Aug 2005, 16:55:54 »
A game logic is friendly to everyone, which means the soldiers will not fire at them.  Use an invisible target.  You can get an invisible target addon from the addons depot.  Sorry, I don't have the link for it.

Try the following script:
_gunner1 = _this select 0

_BaseList = [soldier1,soldier2,soldier3,soldier4,soldier5,soldier6,soldier7,soldier8,soldier9]

{_gunner1 reveal  _x} foreach _BaseList
exit


call the script from the machine gunner's init field like this:
[this] exec "reveal.sqs"
Btw, if the script is in a subfolder within the Attack folder, you will have to call the script like this:
[this] exec "SubFolderName\Reveal.sqs"

-Student Pilot

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #23 on: 04 Aug 2005, 20:30:38 »
Wow! It worked, thanks a lot :) It seems that if tehre are many targets the gunners fire. I was testing with just one target! Again, thanks.

Oh dear...I keep having ideas I want to implement and they all seem to work well when I do. I can do a lot of them but this one's bothering me. How can I make it so if an officer himself detects an enemy presence (res or West) he will move to his next waypoint accordingly.
Something like:

?knowsabout enemy == >1.05 blah blah?

Thanks in advance (though I bet you're tired of reading this constantly.)

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #24 on: 05 Aug 2005, 05:50:03 »
officer knowsAbout enemydude >= 1, put that in condition of trigger that's synched with a waypoint
« Last Edit: 05 Aug 2005, 05:52:16 by DaneDK »

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #25 on: 05 Aug 2005, 14:50:02 »
Right, cheers. I didn't know the exact value because I read somewhere that in Resistance soldiers all have 1.05 or something :)

Offline Pilot

  • Contributing Member
  • **
Re:Detecting dist, and some more.
« Reply #26 on: 05 Aug 2005, 15:26:32 »
Huh, in a mission I made, I used:
ManName knowsabout player >.15
It worked fine for me.  I guess whatever works for you.

-Student Pilot

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #27 on: 05 Aug 2005, 20:09:08 »
Quote
knowsAbout enemydude >= 1

That was just an example, i don't know what the best knowsabout value for this is.

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #28 on: 05 Aug 2005, 21:40:12 »
I have a small script that I made to get different people doing the same animation but not at the same time, so it doesn't look too monotonous.

 
Code: [Select]
;to make some units talk and stop talking randomly
#loop1
steyr1 switchmove "effectstandtalk"
~random 3
officer1 switchmove "effectstandtalk"
~random 3
hunter1 switchmove "effectstandtalk"
~random 3
hunter2 switchmove "effectstandtalk"
~random 10
steyr1 switchmove "null"
~random 15
officer1 switchmove "null"
~random 3
hunter1 switchmove "null"
~random 2
hunter2 switchmove "null"
goto "loop1"

It works great for what it's meant to do, but could one of you tell me a way to get it to check after every line if East has been detected by a trigger 50x50 with "east" and "detected by resistance" and if East is detected, the script could cancel all switchmoves and leave the sodliers to fight?

Sorry I'm in a bit of a rush and will repost if necessary.

Thanks for any help.

« Last Edit: 05 Aug 2005, 21:40:34 by DoDgY »

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #29 on: 05 Aug 2005, 22:42:58 »
Code: [Select]
talkingDudes = [steyr1,officer1,hunter1,hunter2]

#loop1
steyr1 switchmove "effectstandtalk"
?(eastDetected): goto "next"
~random 3
officer1 switchmove "effectstandtalk"
?(eastDetected): goto "next"
~random 3
hunter1 switchmove "effectstandtalk"
?(eastDetected): goto "next"
~random 3
hunter2 switchmove "effectstandtalk"
?(eastDetected): goto "next"
~random 10
steyr1 switchmove "null"
?(eastDetected): goto "next"
~random 15
officer1 switchmove "null"
?(eastDetected): goto "next"
~random 3
hunter1 switchmove "null"
?(eastDetected): goto "next"
~random 2
hunter2 switchmove "null"
?(eastDetected): goto "next"
goto "loop1"

#next
{_X setCombatMode "RED"} forEach talkingDudes
exit

Write eastDetected = false in init.sqs
Write eastDetected = true in east detected by west trigger or whatever trigger your are using.

This is the simple way, i'm sure there's a much more efficient way of doing this ::)


Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #30 on: 06 Aug 2005, 00:26:42 »
Aah yes, a bit more efficient, well it look's more nice an tidy ;)

Code: [Select]
_talkingDudes = [steyr1,officer1,hunter1,hunter2]

#loop
_talkingDude = _talkingDudes select random (count _talkingDudes)
_talkingDude switchmove "effectstandtalk"
~3 + (random 3)
_talkingDude switchmove "null"
?(eastDetected): goto "next"
goto "loop"

#next
{_X setCombatMode "RED"} forEach _talkingDudes
exit
« Last Edit: 06 Aug 2005, 01:39:34 by DaneDK »

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #31 on: 06 Aug 2005, 18:14:07 »
Looks great, thanks a lot ;)

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #32 on: 07 Aug 2005, 15:20:50 »
I tried the stacking boxes thing and it made this problem:
I used this script:
Code: [Select]
box2 setPos [getPos box1 select 0, getPos box1 select 1, 0.5]For some reason the boxes don't stack vertically only. I want:

[_]
[_]

not:

[_]
-[_]

If that makes sense ;)  Thanks. Is this problem caused by the box's "pos" not actually being in the centre of where it's put?



# Picture size edited by macguba
« Last Edit: 07 Aug 2005, 15:56:11 by macguba »

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Detecting dist, and some more.
« Reply #33 on: 07 Aug 2005, 15:32:31 »
I think that is the nature of the beast of OFP.

 If ya want it exactly on top and aligned perfectly there maybe a gap inbetween bottom and top.

Edit: Just checked one of my mission that I stacked boxes and it seems that they all go off a slight bit but the boxes on top seem to stack better. Maybe put the first one under ground and the others on top and you won't see the slight off center.

By the way, I have stuff stacked at a ship dock with things a skew(not perfect) and the little group that I had play the mission, didn't seem to care about perfectly aligned boxes. They just want to know where the next Loon was and if they could drive the BIG Transport Ship out to sea ::).
 
So I have Goofy Friends :D
« Last Edit: 07 Aug 2005, 15:49:38 by sharkyjoe »
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #34 on: 07 Aug 2005, 17:30:44 »
And another way:
box2 setPos [getPos box1 select 0 + 0.5, getPos box1 select 1 - 0.5, 0.5]
Try with different values untill you get it right.

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #35 on: 07 Aug 2005, 17:45:15 »
Cheers you two, I'll try both ways :)
EDIT: Sorry for the large image size. Thanks Macguba.
« Last Edit: 07 Aug 2005, 20:21:00 by DoDgY »

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #36 on: 07 Aug 2005, 21:02:31 »
Another question: I have a unit called steyr1. He has this in his init field:
steyr1 dowatch mate3
and it works fine until enemies come and he's still staring at mate3. I got a trigger ready to be used but I need something that makes him not watch mate3 anymore so he can engage the enemy.
 Is it something like:

steyr1 dowatch null
or
steyr1 dowatch objnull
?

Thanks.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Detecting dist, and some more.
« Reply #37 on: 07 Aug 2005, 21:17:42 »
perhaps dostop?
dostop steyr1
or stop:
steyr1 stop true

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #38 on: 08 Aug 2005, 03:37:22 »
steyr1 dowatch objnull is correct.

I don't think a dostop will stop him from doWatching ;D :-X

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #39 on: 08 Aug 2005, 17:00:06 »
Great, thanks again.
« Last Edit: 08 Aug 2005, 17:07:08 by DoDgY »

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #40 on: 09 Aug 2005, 19:55:25 »
A new problem has arisen (again).

This time I have a soldier who I need to cycle but in domove commands, not waypoints as they don't work the way they should in this case.

So all I want, really, is a way to check if this unit has completed his domove command before moving onto the next 1.

Code: [Select]
#one
unit domove getmarkerpos movemarker1
completed?
no goto "one"
yes goto "two"
#two
unit domove getmarkerpos movemarker2
completed?
no goto "two"
yes goto "three"
#three
...and so on...

So as you can see, I need to know how to do the completed, yes & no bits.

Thanks again.
« Last Edit: 09 Aug 2005, 19:56:30 by DoDgY »

Dane

  • Guest
Re:Detecting dist, and some more.
« Reply #41 on: 09 Aug 2005, 20:13:08 »
Code: [Select]
#one
unit domove getmarkerpos movemarker1
?! unitReady unit : goto "one"
? unitReady unit : goto "two"
#two
unit domove getmarkerpos movemarker2
?! unitReady unit : goto "two"
? unitReady unit : goto "three"
#three

Or

Code: [Select]
#one
unit domove getmarkerpos movemarker1
@? unitReady unit
#two
unit domove getmarkerpos movemarker2
@? unitReady unit
#three

« Last Edit: 09 Aug 2005, 20:14:39 by DaneDK »

Offline Pilot

  • Contributing Member
  • **
Re:Detecting dist, and some more.
« Reply #42 on: 09 Aug 2005, 20:26:05 »
Someone correct me if I am wrong, but I don't think @ and ? can be used together, try this:

unit domove getmarkerpos "movemarker1"
@unitReady unit
unit domove getmarkerpos "movemarker2"
@unitReady unit

-Student Pilot

EDIT:
And of course the labels don't need to be used if you use @
« Last Edit: 09 Aug 2005, 20:27:21 by Student Pilot »

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #43 on: 09 Aug 2005, 21:09:46 »
great! Thanks you two :D Quick reply too ;)

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #44 on: 12 Aug 2005, 21:09:53 »
I have one problem which I don't know if there's an answer to. The man I use to infiltrate the enemy base and drop his satchel charges, for some reason, keeps stopping and just looking at an enemy, then carrying on with his domoves, then stopping again.

In his init field I have:
Code: [Select]
this setcaptive true ; this  setbehaviour careless
I have tried the disableAI thing but it has no effect. If I make him a soldier friendly to who he's blowing up, he walks around fine but I need him to be an enemy to the soldiers in the base so he will be shot without having to script in everyone to shoot him at the end of his errand.

Will I have to make him a soldier firendly to the enemies or is there another way? Maybe revealing all of the enemy so he doesn't stop to look at them?

Anyway, thanks in advance for any help or feedback. :)

P.S. I was in a rush so sorry if anything's hard to understand.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Detecting dist, and some more.
« Reply #45 on: 12 Aug 2005, 21:12:37 »
unitname disableai "autotarget"
perhaps

Offline Pilot

  • Contributing Member
  • **
Re:Detecting dist, and some more.
« Reply #46 on: 12 Aug 2005, 23:40:33 »
Is it possible to use a friendly soldier to drop the satchels, tell him to blow them up, and then after the deed is done, delete him and create/move another unfriendly soldier to his position?

Or is this another case of my solution being overly complicated? :P

-Student Pilot

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Detecting dist, and some more.
« Reply #47 on: 13 Aug 2005, 09:10:31 »
I have just noticed the stacked box problem.  The second box is being placed in relation to the first box.  Have you tried doing a:

box1 setPos getPos box1

I haven't but I bet the box moves.  If you do this with a wire object it moves nearly 1/2 its own length sideways. So I suggest you try:

_xcoord = getPos box1 select 0
_ycoord = getPos box1 select 1
box1 setPos [_xcoord,_ycoord,0]
box2 setPos [_xcoord,_ycoord,0.5]

That way you can be sure you are placing both boxes at the same x,y coordinates.

EDIT:

On your waypoint/domove problem.
1. Are you sure waypoints will not do what you want, there are lots of different types of waypoints and some can be very clever - and you can move them?
2. I find that sometime units do just stop when they are actioning a doMove instruction.  I will usually put the doMove in a loop that repeats every 30 seconds or so.

My advice - forget about trying to simulate wapoints with doMoves and use waypoints instead.

setCaptive true and setBehaviour "Careless" is usually all you will need for a unit to ignore, and not be shot at by, the enemy.  The enemy will not ignore the unit they will just not shoot at it.  Any enemy units at guard waypoint will still come looking for the unit.

EDIT2:
I believe you will get a better response to your questions if you had a new thread for each one. Someone looking at in new (like me this morning) could be really confused about what the current issue is.
« Last Edit: 13 Aug 2005, 09:31:10 by THobson »

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #48 on: 13 Aug 2005, 13:37:16 »
Thanks you lot...again.

@triggerhappy
Quote
I have tried the disableAI thing but it has no effect
@Student Pilot, yes I may have to, thanks again.

@Thobson. Thanks for the box problem help, I reckon that'll work great, thanks :).

The reason I need domoves is because my markers that he needs to walk on are so close together, with a waypoint, he'd just think he's completed the first few all at once :) Believe me, I do need domoves.

Also, the problem isn't about the enemies shooting the captive, it's him stopping and looking at them in the middle of domoves. As I said, if he's a friendly soldier he'll do the script properly, but if enemy he keeps stopping and staring at enemies then walking again. It looks stupid, really. He isn't ignoring the enemy enough ;) .

I reckon I'll use Student pilot's advice about the deletevehicle as it will probably work fine :) Especially as he gets in a UAZ so the swap will be unnoticeable :) .

And as for your advice on creating a new topic every time I'll do that, it's just, depending on the website, people don't normally want a newbie asking loads of questions on a million threads.
I thought that it would be better not cluttering the forum up with threads, but if it's ok to make a new thread every time, I'll do that :) Especially if it gives me more feedback (not that the feedback I've had isn't great ;) )Thanks very much.

This place is great :P .

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Detecting dist, and some more.
« Reply #49 on: 13 Aug 2005, 13:55:28 »
DoDgY it's fine to start a new thread when you have a new question.     However, if you have several questions to ask at once put them in one thread, or maybe two if they divide neatly into two areas.

However, the important thing is to search first.   OFPEC is a big site and for historical and practical reasons there are several areas to search:  the forum itself, the FAQ and the Editors Depot tutorials.   All have search functions so it's not too hard.   You will often find the information you need.
Plenty of reviewed ArmA missions for you to play

DoDgY

  • Guest
Re:Detecting dist, and some more.
« Reply #50 on: 13 Aug 2005, 15:56:43 »
Yeah I have used the FAQ, search adn tutorials a lot, but it's when I cannot find the answer that I post :) Sometimes what many would consider an answer isn't specific enough for me to use because I am relatively inexperienced in improvising. But yes, I do often find the information I need from searching. Thanks, and I'll be starting some new threads soon for certain ;)