Home   Help Search Login Register  

Author Topic: My Script  (Read 5029 times)

0 Members and 1 Guest are viewing this topic.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:My Script
« Reply #30 on: 08 Jan 2004, 21:45:42 »
Nothing is too big to copy paste here.. as I'm about to prove.

Quote
group setBehaviour behaviour
Operand types:
    group: Object or Group
    behaviour: String
Type of returned value:
    Nothing
Description:
    Set group behaviour mode. Behaviour is one of: "CARELESS", "SAFE", "AWARE", "COMBAT", "STEALTH".

Example:
    groupOne setBehaviour "SAFE"

Quote
group setCombatMode mode
Operand types:
    group: Object or Group
    mode: String
Type of returned value:
    Nothing
Description:
    Set group combat mode (engagement rules). Mode may be one of: "BLUE" (Never fire), "GREEN" (Hold fire - defend only), "WHITE" (Hold fire, engage at will), "YELLOW" (Fire at will), "RED" (Fire at will, engage at will).

Example:
    groupOne setCombatMode "BLUE"

Quote
unit setUnitPos mode
Operand types:
    unit: Object
    mode: String
Type of returned value:
    Nothing
Description:
    Set unit position rules. Mode may be one of: "DOWN", "UP", "AUTO".

Example:
    soldierOne setUnitPos "Down"

And then some thoughts about your script.

Code: [Select]
_script = "script.sqs" wtf is that? why?  :D

Code: [Select]
_man SetCombatMode "Yellow"
_man SetBehaviour "Aware"
These may not work if the _man is a member in a group. The leader (if not a vegetable) will issue a new behaviour order to _man if he thinks he's out of line being 'aware' when he should be 'danger'.

Code: [Select]
~0.1 I think these small delays are useless.

Code: [Select]
_man doFire _target This might require you to first tell the _man to target the _target. Can be done with _man target _target.

Code: [Select]
_man setUnitPos Up I'd still put 'Up' in quotes no matter what your command reference says.

And as a side note, your script is kind of funny  :D  I don't mean that it sucks or anything, but I see an image in my head of a soldier running after an enemy soldier and firing at him every 4 seconds.

Cheers rhys  ;) :cheers:


[edit]

Oh, and that OFP virus you were talking about.. I'd bet my money on some farked up addon you have. Anyways, at least, there's no way copy/pasting ANY script to your mission will ever cause something like you described.
« Last Edit: 08 Jan 2004, 21:48:33 by Artak »
Not all is lost.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:My Script
« Reply #31 on: 08 Jan 2004, 21:47:49 »
I altered yourt script a little.

I moved the #Loop1 down a bit and added another line or two.

Where does the _script variable come into play?


_man = _this select 0
_target = _this select 1
_script = "script.sqs"


_man SetCombatMode "Yellow"
_man SetBehaviour "Aware"

? not alive _man : titletext [format ["%1 reports that %2 is KIA.", name player, name _target], "Plain Down"]
? not alive _man : goto "here"

#Loop1
~3
_man doMove getPos _target
~1
_man doFire _target

? alive _target : goto "Loop1"
~1

titletext [format ["%1 neutralized.", name _target], "Plain Down"]

#here
~2
_man SetCombatMode "yellow"
~0.1
_man SetBehaviour "Safe"
~0.1
_man setUnitPos "Up"
~0.1
_man doMove getPos Gamelogic1

Exit


Hope that one works.


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

Offline rhysduk

  • Former Staff
  • ****
Re:My Script
« Reply #32 on: 09 Jan 2004, 17:34:49 »
@ Planck :-

I did not change it - just copied it and pasted into CHOFPSE... :) never mind though :)

Right his script you posted here... take a look at it, i dont know if you know but _man is the hunter and _target is well.. the target  ;D

In it you have :-

Quote
Code: [Select]
? not alive _man : goto "here"

which makes the script go to here (you know this i know) :-

Quote
Code: [Select]
#here
~2
_man SetCombatMode "yellow"
~0.1
_man SetBehaviour "Safe"
~0.1
_man setUnitPos "Up"
~0.1
_man doMove getPos Gamelogic1

know as you can see here, why and how can you set the Behaviour of teh man to SAFE if he is dead ?? lol ... this part of the script is only exited if "_man" is dead ;D

Code: [Select]
_script = "script.sqs"

This i was using for the tranferation of things between scipts.. remember i asked about this Artak.. ill explain when the main script is working smoothly .. :)

I took out dotarget , Artak, cant remember what for, i think someone suggested it ...

Quote
I'd still put 'Up' in quotes no matter what your command reference says.

Consider it done :toocool:

Quote
your script is kind of funny

LOL, thanks, nice to see someone likes it :) ... and the rest of whta you said by there - i know its nothing special ( I admit it :( ) ... but its my first script so its a god damn start hey  :thumbsup:

Quote
I'd bet my money on some farked up addon you have.

How much... ?? I havent installed any knew addons recently.. maybe though...

Anway,

Thanks again guys for the input and help :cheers:

Expect me back ;D

Regards Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

sabreblade

  • Guest
Re:My Script
« Reply #33 on: 09 Jan 2004, 23:12:13 »
hi, sorry this is off-topic but i was wondering... since this is your first script rhysduk, where did you get your info from...which tutorial? :-\
i'm about to make a first script but to be honest im not ready. :-\

SB

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:My Script
« Reply #34 on: 10 Jan 2004, 00:22:58 »
You are right rhys.........the #here labell was supposed to go above  Exit.

Like so......I just forgot to move it there.......sigh.

~2
_man SetCombatMode "yellow"
~0.1
_man SetBehaviour "Safe"
~0.1
_man setUnitPos "Up"
~0.1
_man doMove getPos Gamelogic1

#here
Exit

Also the #Loop1 label can go back here:

#Loop1
? not alive _man : titletext [format ["%1 reports that %2 is KIA.", name player, name _target], "Plain Down"]
? not alive _man : goto "here"

Because I just realised you may want to check _man's health more than once.

I really should try and concentrate more   ::)
I suprise myself sometimes.


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

Offline rhysduk

  • Former Staff
  • ****
Re:My Script
« Reply #35 on: 10 Jan 2004, 22:34:28 »
@ Sabreblade :-

No need to be sorry :thumbsup: What do you mean info ??

Ah, i think the best bet is too grab a FEW tuts on scripting .. then download as many example scripts and missions that use script and take them apart..... i didnt use tuts or htis method to be honest....

I'm not bragging .. honest :) but ive been around the OFP scene (here) about 3 months (probably more) and just starting helping (well trying to help)  people like me who need help ;D.. if i was wrong, i was told and corrected, so i learnt that way...

I have people like Sir Armsty, Artak ( :) ), macguba, LCD and many more to thank for this...

Hope this helps rhys...

@ Planck

;D...
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

sabreblade

  • Guest
Re:My Script
« Reply #36 on: 11 Jan 2004, 19:28:08 »
thanks rhysduk, nice 1

to be honest i've never DL a mission b4 as i have never needed to i s'pose. i really want to make complicated, fun to play missions in OFP.

is there a list on the net of the things you an use in scripting? i have the comref but is there any more commands for scripting in other lists? :-\

SB

Offline rhysduk

  • Former Staff
  • ****
Re:My Script
« Reply #37 on: 11 Jan 2004, 22:41:03 »
As long as you have the latest COMREF, then i dont hink there is anything else you need...

ARTAK, know of anything like this ?? :)

Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:My Script
« Reply #38 on: 11 Jan 2004, 23:00:53 »
There's the unoffiacial comref which also can be found at editors depot. It's pretty much outdated by now, but has some commands explained maybe better than the official BIS comref.. like in 'earthly terms'.
Only a few new commands ('typeoff' comes to mind)  have come out since the version 1.85 (the newest official comref), so you'll do fine with it.
Other than that I don't think there is any other reference you'd need.

List of animations can be found from the editors depot too and things like that.. hmm.. yea. Nothing else to add.

What you need to do sabreblade is go to the editors depot and grab yourself a handfull of tutorials. Also get the a tool to unpbo or depbo or decrypt mission pbo's. Download missions which scored high and explore them..
Either that or I could just give you MI_Fred's phone number :P
Not all is lost.

sabreblade

  • Guest
Re:My Script
« Reply #39 on: 12 Jan 2004, 20:21:22 »
woah! 8) cheers guys, helped a lot 8)

i'll be exploring missions soon enough ;)

SB