Home   Help Search Login Register  

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

0 Members and 1 Guest are viewing this topic.

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 ::)