Home   Help Search Login Register  

Author Topic: Createunit Trouble  (Read 2260 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
Createunit Trouble
« on: 25 Mar 2003, 22:33:33 »
Hello folks  :)

I've been having this problem for a while (no it's not the fungus thing)

I'm trying to decrease lag in a huge mission by creating units as the mission goes and have made this amongst others:

Code: [Select]
"OfficerE" createunit [getpos attack1, attackgrp2, "eo800 = this", 1, "LIEUTENANT"]
   ~0.5
"SoldierEB" createunit [getpos attack1, attackgrp2, "e3600 = this"]
   ~0.5
"SoldierEB" createunit [getpos attack1, attackgrp2, "e3700 = this"]
   ~0.5
"SoldierELAW" createunit [getpos attack1, attackgrp2, "e3800 = this"]
   ~0.5
"SoldierEMG" createunit [getpos attack1, attackgrp2, "e3900 = this"]
   ~0.5
"SoldierEMedic" createunit [getpos attack1, attackgrp2, "e4000 = this"]
   ~0.5
"SoldierEG" createunit [getpos attack1, attackgrp2, "e4100 = this"]
   ~0.5
"SoldierEB" createunit [getpos attack1, attackgrp2, "e4200 = this"]
   ~0.5
"SoldierEB" createunit [getpos attack1, attackgrp2, "e4300 = this"]
   ~0.5
"SoldierELAW" createunit [getpos attack1, attackgrp2, "e4400 = this"]
   ~0.5
"SoldierELAW" createunit [getpos attack1, attackgrp2, "e4500 = this"]

      [attackofficer1] join grpnull

exit

For some reason the script only creates the 6 first units. Why?

I've got this other script that I'm using too and it works just fine with 9 units:

Code: [Select]
etank6 = "t72" createVehicle getpos attack2

   ~1

etank7 = "t80" createVehicle getpos attack2

   ~1

etank8 = "t80" createVehicle getpos attack2


"SoldierECrew" createunit [getpos attack2, attackgrp2, "et16 = this", 1,"Lieutenant"]
"SoldierECrew" createunit [getpos attack2, attackgrp2, "et17 = this"]
"SoldierECrew" createunit [getpos attack2, attackgrp2, "et18 = this"]

"SoldierECrew" createunit [getpos attack2, attackgrp2, "et19 = this", 1,"Lieutenant"]
"SoldierECrew" createunit [getpos attack2, attackgrp2, "et20 = this"]
"SoldierECrew" createunit [getpos attack2, attackgrp2, "et21 = this"]

"SoldierECrew" createunit [getpos attack2, attackgrp2, "et22 = this", 1,"Lieutenant"]
"SoldierECrew" createunit [getpos attack2, attackgrp2, "et23 = this"]
"SoldierECrew" createunit [getpos attack2, attackgrp2, "et24 = this"]

      [attackofficer2] join grpnull

   ~3

et16 moveincommander etank6
et17 moveingunner etank6
et18 moveindriver etank6

   ~1

et19 moveincommander etank7
et20 moveingunner etank7
et21 moveindriver etank7

   ~1

et22 moveincommander etank8
et23 moveingunner etank8
et24 moveindriver etank8

exit

As you can see the seconds script creates 9 units and 3 tanks and it works just fine.

Come on, give me your best shot!  :D
Not all is lost.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Createunit Trouble
« Reply #1 on: 26 Mar 2003, 14:44:31 »
Have you tried re-sorting the order of the loons, to see if it really is the first 6 or something to do with the individual units?    And I'm almost embarrassed to say this, but you're not trying to put more than 12 loons in a group are you?     I suppose it could be something to do with the exact location, maybe there isn't space for the rest, or they are being created inside a closed building or something.

Sorry, I'm just rambling ......
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Createunit Trouble
« Reply #2 on: 26 Mar 2003, 17:22:51 »
Better rambling then nothing at all, I apriciate the effort  :)

Yes it's the 6 first units on that list, no matter what units they are..

there's plenty of room in the group (only 1 loon to begin with) and yes, you should be embarrased about asking something like this  :D ;)

umm..

The location is not the problem either, because the other script up there creates 3 tanks and 9 men on a spot just like this script is trying to do with 6 men. It's a wide open space.


If I loop the script and kill a soldier from the group it creates a random (based on what part the script is running at that time) soldier to replace the killed one, but never goes above 6 units in the group.  >:(
Not all is lost.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Createunit Trouble
« Reply #3 on: 26 Mar 2003, 17:29:08 »
try changing the group name.    yes I know it shouldn't work, but whoever said OFP was logical?    it it replaces a dead unit it does sound as if the game thinks the group is full.
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Createunit Trouble
« Reply #4 on: 26 Mar 2003, 17:41:49 »
 :o OMG macguba your a genius!!!  :wow:

ok, so the changing group name didn't work obviously but because you said ofp wasn't logical ( ;D I knew that already) I started thinking what else weird things I could try to make the script work.

So first I increased the delay between each row from ~0.5 to ~2.5 and noticed that now I only had 3 units created.

 :hmm:

Slowly my brain started to show signs of some action and I removed the delays totally resulting 11 soldiers in my group  :D :thumbsup:


So, to sum it up, the 0.5 second delays were messing up the script. Don't know why, don't really care as long as it works.
The only downside in this is that I inserted the delays to decrease lag. Creating 11 sildiers at once causes the game to lag for about 0.3 seconds and even more in MP.  :P
Not all is lost.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Createunit Trouble
« Reply #5 on: 26 Mar 2003, 20:18:39 »
.. this is why I left the topic unsolved. I knew something was about to come up  ::)

Now the trouble is in the seconds script. The one which creates 1 t72 and 2 t80 tanks and the crew.

I editor everything works fine but when I test it in mp with my friends there's 3 t72 tanks and 6 t80.
I'm also using different scripts in different towns which do basicly the same thing but with different units like a bmp for example and they have the same problem.

Also it not just creates everything in 3*whatIwant but also doesn't create the crew at all.


I'm making a huge mission, so the use of createunit and createvehicle is essential.  :-[
Not all is lost.

asmodeus

  • Guest
Re:Createunit Trouble
« Reply #6 on: 26 Mar 2003, 22:28:10 »
This is some very interesting stuff!

I'm wondering..  With your MP test, did you have a total of 3 players? (seems like the script was creating the tanks for each person playing?)

About the crew, is it possible to seperate that into a different script, activated a couple seconds later?  (random ideas)

I dunno..  but I'm very interested to know!   8)

I'll think about it some more..   ;)

Asmo
« Last Edit: 26 Mar 2003, 22:29:12 by Asmodeus »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Createunit Trouble
« Reply #7 on: 27 Mar 2003, 07:24:13 »
No, the scripts create units for the enemy AI. (I had 4 players in that MP test, which I think matters not.)

Indeed it is possible to separate the script into two, and I'm going to try that and see how it acts then. Post some news about how it went later.
Not all is lost.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Createunit Trouble
« Reply #8 on: 27 Mar 2003, 18:55:25 »
Separating the creation of tanks and their crew worked not   :P

The problem seems to be somehow connected to either lag or mp playing in general because in the editor or with single player the problem does not exist.  ???
Not all is lost.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Createunit Trouble
« Reply #9 on: 02 Apr 2003, 08:07:09 »
..Still not solved..

G'daum! This is the only thing keeping me from world domination!  ;D


So I'm still having the same problem. I have separated the scripts into tiny bits and pieces with no result.
When I'm creating 1 bmp I find 4 on the battlefield or something like that.

Please help  :-[
Not all is lost.

asmodeus

  • Guest
Re:Createunit Trouble
« Reply #10 on: 02 Apr 2003, 09:12:30 »
That sucks!   :-\

*rattles his skull around.. wonders why there's no rattle..*   ::)

Uhhh....   How about we narrow it down more if we can...

Is it the same equation no matter how many players there are?  

Or have you always tested it with 4 players?

Does the same thing happen with choppers, planes?

Could you use the knowledge of the fact that it multiplies it and plan on using the extra tanks?  (if they're in the same group)

hrm..  That's all the dust that came out of my brain..   ;)

Asmo

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Createunit Trouble
« Reply #11 on: 02 Apr 2003, 15:16:34 »
hehe, thanks for the input (sawdust) *cough* Asmo.

If I play the mission alone it's fine. If I play it with a friend of mine there can be from 2-4 bmp's when there's only supposed to be 1. Because I'm creating cwer for only 1 bmp it results to 3 empty bmp's and 1 manned.

I have a buttfeeling that the problem is worse when there are more players in game. Dunno why my butt is feeling things like this..

The problem occurs with every possible unit, vehicle or man.

Maybe I should somehow localize the script to execute it only on server or something, but I know nothing of these kinds of things  :-\

[edit]

at this point a nice enough moderator might want to move this to multiplayer editing  :D

[/edit]
« Last Edit: 02 Apr 2003, 15:37:30 by Artak »
Not all is lost.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Createunit Trouble
« Reply #12 on: 05 Apr 2003, 11:07:31 »
ffs no-one knows?  :)

It's pretty clear to me now that my butt feeling was correct. I've tested the mission further and it seems that I can't localize a script no matter what I try.

The createunit and screatevehicle scripts are executed via a gamelogic [glname] exec "script.sqs" and I have in the beginning of every scrtipt ?!(local Server): exit which gives me no error but does me no good either.

Also I made a little arty script which camcreates 1 bomb in about every 7-12 seconds. So it does.. IF I play alone. Otherwise it creates as much bombs as there are players.  :P


I'm even beginning to think it's my computers fault or that I should reinstall ofp  :'(
Not all is lost.

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Createunit Trouble
« Reply #13 on: 05 Apr 2003, 16:30:13 »
I'm not much into MP editing, but shouldn't you try to create variables using the "publicvariable" command ?
Something like :
publicvariable "attackgrp2" ; that way, all computers should have the same "attackgrp2", rather than their own each.
Just a suggestion  :-\.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Createunit Trouble
« Reply #14 on: 05 Apr 2003, 18:33:45 »
hmm..   :hmm:

 :wow: Oh yeah! Maybe I was thinking it the wrong way. Gonna go try it out  :)
Not all is lost.