Home   Help Search Login Register  

Author Topic: Too many troops on the ground causing lag??  (Read 3087 times)

0 Members and 1 Guest are viewing this topic.

Offline Mostly

  • Members
  • *
Too many troops on the ground causing lag??
« on: 31 Jan 2008, 12:11:46 »
Hello,
I've recently rediscovered OPF after being away for a couple of years and have started to make a mission which is loosely based on Bravo Two Zero. My scripting ability is limited but I'm quite good at taking other people's scripts and modifying them to suit my mission.
The mission is coming along nicely and I'm very pleased with it so far. The only problem I've got is the amount of Iraqi forces on the ground. I've put loads of regular Iraqi troops on the map and have a massive Republican Guard presence. The idea is that when your team are compromised a massive amount of troops flood into the area and head for your last known position. Due to the amount of troops the mission doesn't run as smoothly as I want it to.
I'm looking for a script or ideas on how to get round this. An ememy Spawn script that introduces enemy in staggered phases or something like that?
 :scratch:
They mostly come out at night. Mostly!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Too many troops on the ground causing lag??
« Reply #1 on: 31 Jan 2008, 13:07:14 »
Sure, enemy staggered spawn script would do the trick, you might also tune down the skill level of enemy soldiers. Spawn them in AWARE mode, never in COMBAT or STEALTH. If you need to create the "false" impression of fighting many enemy troops, having, in fact, only few of them, play with fog level to decrease the practical view range.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Too many troops on the ground causing lag??
« Reply #2 on: 31 Jan 2008, 13:38:16 »
in addition, if you don't mind using a 'gamey' element, you could run a body-removing script after units have been dead for a couple of minutes. that will certainly reduce lag. if you tie the total number of enemy units on the map to the number still alive - in other words don't spawn any more units until one of them dies - you can keep the enemies coming indefinitely but have a relatively low number of them on the map at any one time.

Offline Mostly

  • Members
  • *
Re: Too many troops on the ground causing lag??
« Reply #3 on: 31 Jan 2008, 14:21:01 »
Cheers. :good:
I've added a Spawn script to the mission which creates the Republican Guard troops but in a staggered way.
This might just be me being a bit thick, but I can't work out how to give each group a seperate name, so that I can make them do other things like getting into vehicles etc.
What line should I add to the script to do this?
They mostly come out at night. Mostly!

Offline Mostly

  • Members
  • *
Re: Too many troops on the ground causing lag??
« Reply #4 on: 31 Jan 2008, 14:46:22 »
Just one more thing. You mentioned a remove dead body script, where would I be able to find one?

HAVE FOUND ONE NOW.
« Last Edit: 01 Feb 2008, 17:37:06 by Mostly »
They mostly come out at night. Mostly!

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Too many troops on the ground causing lag??
« Reply #5 on: 31 Jan 2008, 14:54:11 »
modify your previous post if it's been there for less than 3 days without a reply.

to give a group a name, in the init field of the leader put

Code: [Select]
whatever_name = group this
i've had a look in the ed depot for a body removal script but there are non ready-made. it's actually quite simple:

  • you add a killed event handler to each unit which runs a script when they die
  • the script slowly loops for a couple of minutes
  • once a couple of minutes have elapsed, you deletevehicle the body

all the information you need to perform these simple steps are in the ed depot and comref ;)

EDIT - where are my manners?! welcome back to the community!
« Last Edit: 31 Jan 2008, 14:55:43 by bedges »

Offline Mostly

  • Members
  • *
Re: Too many troops on the ground causing lag??
« Reply #6 on: 01 Feb 2008, 16:16:04 »
Thanks for the "welcome back".  :good:
I'm still having problems with naming the group. Basically, the script I'm using to spawn troops creates a group of 10 men. This is the script I'm using:

_base = _this select 0

#fillgroup

#spawnleader
"IMUC_dot_rg_officer" createUnit [getPos _base, dummygroup]
;assign to other group
_member = (units dummygroup) select 1
[_member] join grpNull
_grp = group _member

#spawnrest
"IMUC_dot_rg_soldier" createUnit [getPos (_base), _grp]

?(count units _grp == 10):goto "groupfull"
goto "spawnrest"

#groupfull
; register new group in groupsarray for later use
?(count allgroups == 0):allgroups = [_grp]
?(!(_grp in allgroups)):allgroups = allgroups + [_grp]



I want to give each of them a name, for example, the leader will be a1, then a2, a3, and so on. What should I add to the script? :confused:
They mostly come out at night. Mostly!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Too many troops on the ground causing lag??
« Reply #7 on: 01 Feb 2008, 16:23:55 »
Code: [Select]
[_member] join grpNull
_grp = group _member

_grp = grpNull always.

Offline Mostly

  • Members
  • *
Re: Too many troops on the ground causing lag??
« Reply #8 on: 02 Feb 2008, 11:40:31 »
I've managed to sort it now. Just in case anyone else has a similar problem in the future.
To give each spawned unit a name I added

"IMUC_dot_rg_officer" createUnit [getPos _base, dummygroup, "A1 = this"]. This has named the leader "A1"

I had to create the other members of the group individually using

"IMUC_dot_rg_soldier" createUnit [getPos (_base), _grp, "A2 = this"]

Cheers for the help lads.


They mostly come out at night. Mostly!

Offline Mostly

  • Members
  • *
Error 0 elements provided, 3 expected
« Reply #9 on: 03 Feb 2008, 19:31:50 »
Help,
I've added a spawn script to my mission which works perfectly with the republican guard units but doesn't with others?????

Code: [Select]
_rg1spawn = _this select 0

#spawnleader
"IMUC_tan_officer" createUnit [getPos _rg1spawn, dummygroup, "ia1 = this"]
;assign to other group
_member = (units dummygroup) select 1
[_member] join grpNull
_grp = group _member

#spawnrest
"IMUC_tan_soldier" createUnit [getPos (_rg1spawn), _grp, "ia2 = this"]
"IMUC_tan_soldier" createUnit [getPos (_rg1spawn), _grp, "ia3 = this"]
"IMUC_tan_soldiermg" createUnit [getPos (_rg1spawn), _grp, "ia4 = this"]
"IMUC_tan_soldier" createUnit [getPos (_rg1spawn), _grp, "ia5 = this"]
"IMUC_tan_soldier" createUnit [getPos (_rg1spawn), _grp, "ia6 = this"]
"IMUC_tan_soldier" createUnit [getPos (_rg1spawn), _grp, "ia7 = this"]
"IMUC_tan_soldier" createUnit [getPos (_rg1spawn), _grp, "ia8 = this"]
"IMUC_tan_soldier" createUnit [getPos (_rg1spawn), _grp, "ia9 = this"]

#moveinvehicle
ia1 moveindriver ia
ia2 moveincargo ia
ia3 moveincargo ia
ia4 moveincargo ia
ia5 moveincargo ia
ia6 moveincargo ia
ia7 moveincargo ia
ia8 moveincargo ia
ia9 moveincargo ia
Exit

This is the script I'm using but whenever I try to activate it in the mission I get the same message :
error 0 elements provided, 3 expected
I am new to scripting and rely heavily on playing around with other people's scripts to suit my needs but my scripting knowledge is limited. For example I don't even know what an element is!!!!!!
Can someone tell me where I'm going wrong and what line to add to sort this problem out?
Thanks.
They mostly come out at night. Mostly!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Too many troops on the ground causing lag??
« Reply #10 on: 03 Feb 2008, 19:55:25 »
Weird, the code looks good for me.

I assume dummygroup exists and you are executing the script passing an object or gamelogic as first argument.

Offline Mostly

  • Members
  • *
Re: Too many troops on the ground causing lag??
« Reply #11 on: 03 Feb 2008, 20:07:29 »
Yeah it is weird.

The script is activated with a trigger (West Present), and dummygroup does exist.

I'm using the exact same script to spawn some other troops and it works perfectly!

I've double checked the name of the unit that I'm creating and can't see any differences with this script and the one that actually works.

It's driving me mad!! Any idea why the "error 0 element provided, 3 expected" would appear?
They mostly come out at night. Mostly!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Too many troops on the ground causing lag??
« Reply #12 on: 03 Feb 2008, 20:13:22 »
Well, if it works correctly with some unit types and not for others, then the problem should be into these "others". A buggy addon may be?

Offline Mostly

  • Members
  • *
Re: Too many troops on the ground causing lag??
« Reply #13 on: 03 Feb 2008, 20:19:50 »
When I first discovered the script and was playing about with it, it did work with the addon that I'm trying to create now. So it can't be a bug in the addon.

Do you know what the error message is refering to? What does it actually mean?
I'm hoping that if I can work this out then I should be able to get around it.
Cheers.
They mostly come out at night. Mostly!

Offline Mostly

  • Members
  • *
Re: Too many troops on the ground causing lag??
« Reply #14 on: 03 Feb 2008, 20:30:35 »
Sorry about this lads.

I'm a complete TOOL.

Have just worked it out. In the trigger I had put in the activation field [rg1spwan] exec "spawn.sqs".

I had mistyped [rg1spawn] !!!!!!!!!!!

Sorry to have wasted anyones time, really do appreciate the effort. Thanks.
I've only wasted about 3 hours trying to fix this!! I need to get a life....
They mostly come out at night. Mostly!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Too many troops on the ground causing lag??
« Reply #15 on: 03 Feb 2008, 20:33:51 »
Good, and please, if you have something to add to your last post, and while your last post is the last in the thread, just modify it instead of adding a new message.