Home   Help Search Login Register  

Author Topic: Applying createunit script  (Read 1516 times)

0 Members and 3 Guests are viewing this topic.

Offline Terame

  • Members
  • *
  • Nice one OFPEC
    • http://fantasyscifi.com/main/ fantasy scifi sci-fi
Applying createunit script
« on: 07 Mar 2004, 08:05:48 »
Hi people,

just did a search on createunit and found a thread that ALMOST helped me ;) Almost...

I wanted to create a small group of enemy units (in this case members of the BIB Malitia) that would surprise the incoming friendlies.

I altered a script description from another thread here, but can't get it to work with a trigger set off by 'West'. I am assuming it needs to be in the activation field as in:
Code: [Select]
this exec "bib_malitia.sqs"But nothing happens... no error and no BIB units :(


The script I am using

Code: [Select]
_units2 = units east2
"_x setunitpos up" foreach _units2
"_x allowfleeing 0" foreach _units2

"bib_afr_militia_ldr" CreateUnit [getpos insert1, East1, "E1 = this", 1, "SERGEANT"]
"bib_afr_militia" CreateUnit [getpos insert1, East1, "E2 = this", 1, "CORPORAL"]
"bib_afr_militia4" CreateUnit [getpos insert1, East1, "E3 = this", 1, "CORPORAL"]
"bib_afr_militia3" CreateUnit [getpos insert1, East1, "E4 = this", 1, "PRIVATE"]
"bib_afr_militia4" CreateUnit [getpos insert1, East1, "E5 = this", 1, "PRIVATE"]
"bib_afr_militia2" CreateUnit [getpos insert1, East1, "E6 = this", 1, "PRIVATE"]
"bib_afr_militia" CreateUnit [getpos insert1, East1, "E7 = this", 1, "PRIVATE"]

~2
OBJ5 = True

Thanks in advance :D
You can travel to infinity though the endless passages of the cosmos. Even
better this belongs to you. This is your mind

BibiPhoque

  • Guest
Re:Applying createunit script
« Reply #1 on: 07 Mar 2004, 14:19:54 »
I think it's :

[this] exec "bib_malitia.sqs"

But I don't see any _this in your script so I might be wrong...
« Last Edit: 07 Mar 2004, 14:26:05 by BibiPhoque »

Offline Terame

  • Members
  • *
  • Nice one OFPEC
    • http://fantasyscifi.com/main/ fantasy scifi sci-fi
Re:Applying createunit script
« Reply #2 on: 08 Mar 2004, 04:35:20 »
I think it's :

[this] exec "bib_malitia.sqs"

But I don't see any _this in your script so I might be wrong...

So I have to have it in the script?
I thought only in the activation field?
Ah well I will give it a try and if it works I will solve the thread :)
You can travel to infinity though the endless passages of the cosmos. Even
better this belongs to you. This is your mind

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Applying createunit script
« Reply #3 on: 08 Mar 2004, 09:26:21 »
Why do you think it needs to be executed with 'this'.
By the looks of the script you can execute it with just:
[] exec "bib_militia.sqs"
and it whould work fine.

Note that when you're creating units, you must have already defined a group, which you use in the createunit command. You have the group as East1, where you're creating the units into.

If you don't have the groupname defined, you can do this by inserting a unit in editor and typing in his init field:
East1 = group this; deletevehicle this
Doing this will add the East1 as a name of a group in the mission, and then delete the temporary unit.
Not all is lost.

Offline Terame

  • Members
  • *
  • Nice one OFPEC
    • http://fantasyscifi.com/main/ fantasy scifi sci-fi
Re:Applying createunit script
« Reply #4 on: 08 Mar 2004, 13:07:48 »
Why do you think it needs to be executed with 'this'.
By the looks of the script you can execute it with just:
[] exec "bib_militia.sqs"
and it whould work fine.

Note that when you're creating units, you must have already defined a group, which you use in the createunit command. You have the group as East1, where you're creating the units into.

If you don't have the groupname defined, you can do this by inserting a unit in editor and typing in his init field:
East1 = group this; deletevehicle this
Doing this will add the East1 as a name of a group in the mission, and then delete the temporary unit.

OK good news and bad news.
The good news is that they appear now, the bad news only if I alter the unit classes to default types, ie not the bib_Malitia units.

the class names appear correct - unless someone knows something I am missing?

Cheers Artak! You got me a step closer with the deletevehicle tip ;)
You can travel to infinity though the endless passages of the cosmos. Even
better this belongs to you. This is your mind