Home   Help Search Login Register  

Author Topic: Optimising Mplayer maps  (Read 1930 times)

0 Members and 2 Guests are viewing this topic.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Optimising Mplayer maps
« on: 02 Jan 2003, 21:20:36 »
I want to create a script  for CTF & C&H (Not Coops) to be run by the server

That
1) Removes dead bodies
2) Removes AI created by players leaving the server

So far I have got
------------------------------------------------------------------------------------------------------------------

Init.sqs entry
[]exec "Removecorpse.sqs"

------------------------------------------------------------------------------------------------------------------
;Removecorpse.sqs

?(!local server):exit
gamestatus = "RUNNING"
_n=-1
#loop
?(count (list EVERYUNIT) < 2):goto "loop"
_curlist = list EVERYUNIT
#loop2
_n = _n + 1
?(!alive (_curlist select _n)): [(_curlist select _n)] exec "delbody.sqs"
?(_n < (count _curlist)):goto "loop2"  
_n=0

?(gamestatus != "FINISHED"): goto "loop"
exit
-----------------------------------------------------------------------------------------------------------------
;Delbody.sqs
_u = _this select 0
~62
; I use 62 seconds because i have dead flag runners returning the flags after 60 seconds
_u setpos [0,0,99999]
deletevehicle _u
exit
--------------------------------------------------------------------------------------------------------------------

The above removes the corpses


I want to add to this, something to delete the AI created by folks disconnecting

Thanks for a previous posts answer
Quote
? (unitName != player) : deleteVehicle unitName
I have the possible answer
Another thing that has been thrown at me was that should the above quoted line be
?(unitName != local player) : deleteVehicle unitName

This has totally thrown me

Because the only way to test this is to have a dedicated server and 2 clients to test it on, i am having problems.

So if one of you greater than i scripters could sort this out, i would be eternally thankfull
« Last Edit: 02 Jan 2003, 21:21:37 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:Optimising Mplayer maps
« Reply #1 on: 02 Jan 2003, 22:01:02 »
It's good to see someone who searches and uses answers from other posts to solve his own problems. :)

I don't know if ? (unitName != local player) : deleteVehicle unitName will work.  That'll check if the player is local to the client, but your Removecorpse.sqs script runs only on the server.  Since none of the players are local to the server, except a host-client, this condition will never be true.  I think it would only work without the local check.  But, being unable to test your code for you, I have no idea if this is true.
Ranger

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Optimising Mplayer maps
« Reply #2 on: 03 Jan 2003, 03:02:31 »
From another post

In a script run locally by the server, "player" will only function if a player is hosting.  Won't do anything on a dedicated server as far as I know.  The short answer is no, you can't use "player" in a server-side script.

Now i am lost sob sob, how do i sort this out

I want any AI that is created by folks disconnecting, to be deleted
I wanted to add it into the above script but it now seems impossible, so how else can i do it
« Last Edit: 03 Jan 2003, 03:07:07 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:Optimising Mplayer maps
« Reply #3 on: 03 Jan 2003, 18:49:10 »
Did you try the code without the local command?  E.g.:

? (unitName != player) : deleteVehicle unitName

As I said, I think this should work, since this will check if the unit is *any* of the existing players, not just the server-side player.
Ranger

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Optimising Mplayer maps
« Reply #4 on: 04 Jan 2003, 12:12:41 »
No i didnt, because the Removecorpse.sqs is run on the server, and tactician stated that the dedicated server wont recognise "player"


Is this incorrect?
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Optimising Mplayer maps
« Reply #5 on: 10 Jan 2003, 03:22:40 »
Just for info;

the command: deleteVehicle works for all units, except
player units.

What i mean is: you can delete a unit anytime, and if it's
player controlled (by any client), nothing bad will happen
to the unit. If it's not player controlled, it should become
deleted.

Only problem i can see here is:

If a client leaves the server, the unit still remains with the
name of the player, but it's AI. So i'm not sure, if this is
the essential difference, that prevents the game engine
from deleting the unit, but at least it's worth a try.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Optimising Mplayer maps
« Reply #6 on: 11 Jan 2003, 16:35:55 »
Ok i will try to implement it in the next map i make and will post on the outcome, thanks for you help
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Tactician

  • Guest
Re:Optimising Mplayer maps
« Reply #7 on: 12 Jan 2003, 00:45:29 »
Wrote a tutorial on a function-based system for removing AI players in the middle of a game.

Tutorial