Home   Help Search Login Register  

Author Topic: no text  (Read 708 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
no text
« on: 20 Jul 2005, 18:18:43 »
Code: [Select]
#contact2

pltcontactlist = []
_Numcontacts = count list detected - 1
_i = 0
_contactknows = 0.35
_contactcalled = list detected select 0

#contact2part2

_contact = (list detected select _i)
_sqd = group player
pltcontactlist = pltcontactlist + [list detected select _i]
? (leader _sqd) knowsabout _contact > _contactknows: _contactcalled = _contact; _contactknows = ((leader _sqd) knowsabout _contactcalled)
_i = _i + 1
? _i <= _Numcontacts: goto "contact2part2"
_type = ""

? "Tank" counttype [_contactcalled] == 1: _type = "ENEMY TANK, "
? "Man" counttype [_contactcalled] == 1: _type = "ENEMY INFANTRY, "
? "APC" counttype [_contactcalled] == 1: _type = "ENEMY APC, "
? "M2StaticMGE" counttype [_contactcalled] == 1: _type = "ENEMY MACHINE GUN EMPLACEMENT, "
? "SoldierESniper" counttype [_contactcalled] == 1: _type = "ENEMY SNIPER, "
? "_x counttype [_contactcalled] == 1" count [{OfficerE},{OfficerEHG}] > 0: _type = "NEMY OFFICER, "
? "_x counttype [_contactcalled] == 1" count [{SoldierESaboteurPipeHG},{SoldierESaboteurPipe}] > 0: _type = "ENEMY SPETZ NATZ, "

_dis = ((((leader _sqd) distance _contactcalled)/10) - ((((leader _sqd) distance _contactcalled)/10) mod 1))*10
? (_dis == 0) : _dis = 5
_dir = ""

? ((getpos (leader _sqd) select 1) + (_dis/2)) <= (getpos _contactcalled select 1): _dir = "north"
? ((getpos (leader _sqd) select 1) - (_dis/2)) >= (getpos _contactcalled select 1): _dir = "south"
? ((getpos (leader _sqd) select 0) + (_dis/2)) <= (getpos _contactcalled select 0): _dir = _dir + "east"
? ((getpos (leader _sqd) select 0) - (_dis/2)) >= (getpos _contactcalled select 0): _dir = _dir + "west"

raduse = true
player sidechat format ["CONTACT! %1%2 METRES TO THE %3",_type,_dis,_dir]
reveal _contactcalled foreach units _sqd
raduse = false

exit

okay thats what ive got so far
i know its wrong cause no sidechat comes up on the screen just an error about
Code: [Select]
"_x reveal _contactcalled" foreach listwest
i got this from Sui's script and modified it hope he doesnt mind i probaly should of asked him first but i couldnt be bothered waiting for a reply so i thought i might as well

anyway the problem is no text comes up on screen

i mignt need to explain some bits and i need explaing some bits
it should (i think) get what kind of unit has been detected by a east detected by west trigger than check if its a tank, apc, infantry etc
then it gets the distance and direction

then shows a sidechat with that info in it.

i have set up a east detected by west trigger name = detected
conditon = this
onactivation = [this] exec "contact.sqs"

above is apart of contact.sqs wich is basically a different version wich works but calls out map coords instead of what this one does

EDIT - edited the script slightly got some text but not the right kind i got this
Quote
"CONTACT! Scalar bool array 0fffceff01f METRES TO THE "

something like that
its not sayng what the enemy is
how many metres
or what direction all the other text fine but whats not there is the main part of the script
« Last Edit: 20 Jul 2005, 19:14:18 by 456820 »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:no text
« Reply #1 on: 20 Jul 2005, 18:33:20 »
Code: [Select]
_contact = (list detected select _i)
that's the first line shown. is _i defined before this? there's also

Code: [Select]
_i = _i + 1
is this meant to be in a loop?

Offline 456820

  • Contributing Member
  • **
Re:no text
« Reply #2 on: 20 Jul 2005, 18:37:18 »
well _i is defined before i actually missed out that line ill edit my first post and out that in thanks for noticing though

the second bit
yes its in a loop just i got rid of the loop bit because this is only meant to be ran a few times like 3-5 so i didnt think checking how many times was needed

thanks for the quick reply aswell

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:no text
« Reply #3 on: 20 Jul 2005, 18:39:38 »
so where's the #marker and the goto "marker" commands? we can't really offer any help in finding errors in an incomplete script...  ::)

Offline 456820

  • Contributing Member
  • **
Re:no text
« Reply #4 on: 20 Jul 2005, 19:13:48 »
oh yeah sorry i had to go when i was about to post it up so i coudnt but its been edited with the complete thing
ive added a few extra lines

Offline 456820

  • Contributing Member
  • **
Re:no text
« Reply #5 on: 20 Jul 2005, 19:28:50 »
hang on after a few tries ive got it working not sure why it didnt work but its working no apart from the reveal
ive tried whats up there now and also
{_x reveal _contactspotted} foreach listwest
listwest is the name of a trigger wich is west present i want _contactspotted reveal to all west units basically

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:no text
« Reply #6 on: 20 Jul 2005, 19:37:37 »
hmmm, well the only thing i can see about this is that if the contact spotted isn't one of those listed, then _type will remain as "", which will give the error. is seems quite a complete list, unless there are resistance or west soldiers being spotted...

otherwise, as with pretty much all of Sui's stuff, it looks like it should work...

not too sure about the last line -

Code: [Select]
reveal _contactcalled foreach units _sqd
should really be

Code: [Select]
{_sqd reveal _x} foreach _contactcalled
i would think...

Offline 456820

  • Contributing Member
  • **
Re:no text
« Reply #7 on: 20 Jul 2005, 19:40:07 »
ah thanks alot ill have a go with the second one basically the oposite of what i did

Offline 456820

  • Contributing Member
  • **
Re:no text
« Reply #8 on: 20 Jul 2005, 19:43:20 »
seems to work great thanks alot
topic solved