Teraz jest Cz 07 sie, 2025 19:51


Civil war linebattle script error

Archiwum działów sekcji Operation Flashpoint
  • Autor
  • Wiadomość
Offline
Avatar użytkownika

Ragnos

Szeregowy

Szeregowy

  • Posty: 10
  • Dołączył(a): Wt 06 lut, 2007 22:27
  • Lokalizacja: Planeta Ziemia

Civil war linebattle script error

PostCz 15 lut, 2007 00:45

witam, ostatnio próbuję swoich sił w robieniu misji(jak narazie dośc nieudolnie :D) do cw moda,
no i mam problem w tym, ażeby grupy oddziałów stosowały sie do tzw. linebattle script
to jest ten skrypt (po otwarciu w notatniku):

Kod: Zaznacz cały
; Line Battle Combat Script
; ==========
; Created by Majoris23 and ProfT
;
; This script creates the most realistic linear combat
; simulation currently available for Operation Flashpoint.
; This script was designed for the Civil War Mod
; (http://www.petrov-petrov.si/~triglav/CW/)
;
; How to Use
; ==========
; Put the following in the squad leader's init line
; [nameofgroup] exec "linebattle.sqs"
;
; By default, the squad's combat mode is set to BLUE
; (hold fire). When you want an AI squad to open fire,
; change it to RED... [groupname] setcombatmode "RED"
; This can be done at waypoints, for example.
;
; ==========


_group = _this select 0
_location = _this select 1
_leader = leader _group
_direction = (getdir _leader)

_officer = (units _group) select 0
_unit1 = (units _group) select 1
_unit2 = (units _group) select 2
_unit3 = (units _group) select 3
_unit4 = (units _group) select 4
_unit5 = (units _group) select 5
_unit6 = (units _group) select 6
_unit7 = (units _group) select 7
_unit8 = (units _group) select 8
_unit9 = (units _group) select 9

_leader AddAction ["Order: Crouch","lb_scripts\crouch.sqs"]
_leader AddAction ["Order: Stand","lb_scripts\stand.sqs"]
_leader AddAction ["Order: Fire Volley","lb_scripts\volley.sqs"]
_leader AddAction ["Order: Fire at will","lb_scripts\fireatwill.sqs"]
_leader AddAction ["Order: Cease fire","lb_scripts\hold.sqs"]

{_x allowfleeing 0} foreach units _group
_group setcombatmode "BLUE"

_angleU = 0
_x = 1
_y = 2
_z = 0

angle = getdir _officer

_xT = (getPos _officer) select 0
_yT = (getPos _officer) select 1
_zT = (getPos _officer) select 2
_x_original = _x
_y_original = _y
_zU = _zT + _z
_m_TO_SQUARE = (_x_original ^2) + (_y_original ^2)
_m = sqrt _m_TO_SQUARE
_x_with_diarrhea = _x_original * cos angle + _y_original * sin angle
_y_with_diarrhea = _y_original * cos angle - _x_original * sin angle
_x_rotated = _x_with_diarrhea + _xT
_y_rotated = _y_with_diarrhea + _yT
_x_position = ((_x_rotated - ((sin angle) * _m)))
_y_position = ((_y_rotated - ((cos angle) * _m)))

_unit1 setpos [_x_position, _y_position, _zU]
_unit1 setDir (_direction)
_unit2 setpos [(_xT + 2 *(_x_with_diarrhea - (sin angle * _m))), (_yT + 2 *(_y_with_diarrhea - (cos angle * _m))), _zU]
_unit2 setDir (_direction)
_unit3 setpos [(_xT + 4 *(_x_with_diarrhea - (sin angle * _m))), (_yT + 3 *(_y_with_diarrhea - (cos angle * _m))), _zU]
_unit3 setDir (_direction)
_unit4 setpos [(_xT + 6 *(_x_with_diarrhea - (sin angle * _m))), (_yT + 4 *(_y_with_diarrhea - (cos angle * _m))), _zU]
_unit4 setDir (_direction)
_unit5 setpos [(_xT + 8 *(_x_with_diarrhea - (sin angle * _m))), (_yT + 5 *(_y_with_diarrhea - (cos angle * _m))), _zU]
_unit5 setDir (_direction)
_unit6 setpos [(_xT + 10 *(_x_with_diarrhea - (sin angle * _m))), (_yT + 6 *(_y_with_diarrhea - (cos angle * _m))), _zU]
_unit6 setDir (_direction)
_unit7 setpos [(_xT + 12 *(_x_with_diarrhea - (sin angle * _m))), (_yT + 7 *(_y_with_diarrhea - (cos angle * _m))), _zU]
_unit7 setDir (_direction)
_unit8 setpos [(_xT + 14 *(_x_with_diarrhea - (sin angle * _m))), (_yT + 8 *(_y_with_diarrhea - (cos angle * _m))), _zU]
_unit8 setDir (_direction)
_unit9 setpos [(_xT + 16 *(_x_with_diarrhea - (sin angle * _m))), (_yT + 9 *(_y_with_diarrhea - (cos angle * _m))), _zU]
_unit9 setDir (_direction)
dostop [_unit1,_unit2,_unit3,_unit4,_unit5,_unit6,_unit7,_unit8,_unit9]
~.5

#loop
_officer = (leader _group)
? !(alive _officer): exit
? (_unit1 != player) and (alive _unit1) and (speed _officer > 0): _unit1 switchmove "standWalkF";_unit1 setdir (getdir _officer)
? (_unit2 != player) and (alive _unit2) and (speed _officer > 0): _unit2 switchmove "standWalkF";_unit2 setdir (getdir _officer)
? (_unit3 != player) and (alive _unit3) and (speed _officer > 0): _unit3 switchmove "standWalkF";_unit3 setdir (getdir _officer)
? (_unit4 != player) and (alive _unit4) and (speed _officer > 0): _unit4 switchmove "standWalkF";_unit4 setdir (getdir _officer)
? (_unit5 != player) and (alive _unit5) and (speed _officer > 0): _unit5 switchmove "standWalkF";_unit5 setdir (getdir _officer)
? (_unit6 != player) and (alive _unit6) and (speed _officer > 0): _unit6 switchmove "standWalkF";_unit6 setdir (getdir _officer)
? (_unit7 != player) and (alive _unit7) and (speed _officer > 0): _unit7 switchmove "standWalkF";_unit7 setdir (getdir _officer)
? (_unit8 != player) and (alive _unit8) and (speed _officer > 0): _unit8 switchmove "standWalkF";_unit8 setdir (getdir _officer)
? (_unit9 != player) and (alive _unit9) and (speed _officer > 0): _unit9 switchmove "standWalkF";_unit9 setdir (getdir _officer)
~.8
goto "loop"

Wstawiłem sobie oddział na mapę, dałem mu niedaleko punkt trasy, i w polu inicjacji dowódcy wpisałem to, co było podane (jako totalny żółtodziób w majstrowaniu przy opfie nie miałem pojęcia skąd dowiedziec wartości w polu [nameofgroup], więc próbowałem kolejno wpisywac "this", "1", "alphablack1") :roll:

za każdym razem jak robiłem podgląd jednostka biegła do punktu tak jak zawsze(normalnie), a u góry ekranu wyskakiwał taki bląd

Kod: Zaznacz cały
'_location=_this select 1|#|': Error select: typ liczba, powinien byc macierz

Tak to szło. :? Dla mnie to czarna magia (ale założę sie, że przyczyną tego całego błędu jest moja głupota :D )
Może ktoś pomóc? Jeśli tak to z góry dziękuję za pomoc

dodałem rodzaj tematu - Sej
Offline
Avatar użytkownika

gremdek

Porucznik

Porucznik

  • Posty: 428
  • Dołączył(a): Pn 27 lut, 2006 15:02

PostCz 15 lut, 2007 15:41

wpisz takie coś w inicjacji lidera.
Kod: Zaznacz cały
grupagrupa = group this; [grupagrupa] exec "linebattle.sqs"


lub

Kod: Zaznacz cały
[group this] exec "linebattle.sqs"





a to
_location = _this select 1 ze skryptu możesz wywalić bo nie jest nigdzie używane.
:(
Offline
Avatar użytkownika

Ragnos

Szeregowy

Szeregowy

  • Posty: 10
  • Dołączył(a): Wt 06 lut, 2007 22:27
  • Lokalizacja: Planeta Ziemia

PostCz 15 lut, 2007 23:47

Dobra, zastosowałem się do Twoich porad, i jednostka trzyma ładnie szyk, jednak pojawiły się nowe problemy :D

-Choc oddział porusza się tak, jak powinien, to dowódca oddziału leci sprintem do waypointa nie patrząc na resztę soldatów :? próbowałem ograniczyc jego prędkośc zachowaniem beztroskim oraz przez "prędkośc ograniczona" w waypointcie, ale dowódca dalej minimalnie wyprzeda oddział (o ile na początku to nie przeszkadza, to przy dłuższej trasie reszta grupy zostaje daleeeko w tyle) Można jakoś dostosowac prędkośc dowódcy do prędkości podwładnych? albo chociaż trochę przyhamowac leadera?

-Drugi problem pojawia się, gdy w polu "przy aktywacji" w punkcie trasy wpisuję
Kod: Zaznacz cały
[grupagrupa] setcombatmode "RED"
żeby po osiągnięciu waypointa jednosta zaczęła walczyc, ale wtedy pojawia się błąd:
Kod: Zaznacz cały
setcombatmode: typ macierz, powinien byc obiekt, grupa
ten sam błąd gdy wpisywałem to w polu inicjacji dowódcy
Próbowałem to rozwiązac zmieniając wartośc skryptu
Kod: Zaznacz cały
_group setcombatmode "BLUE"
na "RED" ale wtedy jednostki otwierały ogień odrazu po zobaczeniu wroga, a mi zależy na tym, żeby wojacy zaczynali strzelac dopiero po osiągnięciu waypointa.. Da się to rozwiazac?
Offline

xersius

Pułkownik

Pułkownik

  • Posty: 134037
  • Dołączył(a): Pn 29 lip, 2024 15:01

Re: Civil war linebattle script error

PostPt 13 gru, 2024 16:11

http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruhttp://magnetotelluricfield.ruhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruhttp://semiasphalticflux.ruhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.ruhttp://taskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruhttp://temperateclimate.ruhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru
Offline

xersius

Pułkownik

Pułkownik

  • Posty: 134037
  • Dołączył(a): Pn 29 lip, 2024 15:01

Re: Civil war linebattle script error


Powrót do Operation Flashpoint

Kto przegląda forum

Użytkownicy przeglądający ten dział: Brak zidentyfikowanych użytkowników i 18 gości