Spawn timer?
Moderator: Moderators
-
nobody3
- Rebel Sergeant

- Posts: 188
- Joined: Wed Jun 15, 2011 8:30 am
Spawn timer?
Hi, first of all, I know that you do not support online cheating but let me explain. I'd like to decrease re-spawn timer for multiplayer (15 second one). I know this is possible because there is a server already that has it(its called cemetry or something like that).
This wouldn't be cheating because you can obviously only use this in your own dedicated server and it gives no advantage. It's more like re-balancing the gameplay a bit.
I'm not sure if anyone ever stumbled on this yet so I'm just asking for suggestions in which .lvl file would this information be stored(I'm thinking ingame.lvl but not too sure)?Thanks as always
This wouldn't be cheating because you can obviously only use this in your own dedicated server and it gives no advantage. It's more like re-balancing the gameplay a bit.
I'm not sure if anyone ever stumbled on this yet so I'm just asking for suggestions in which .lvl file would this information be stored(I'm thinking ingame.lvl but not too sure)?Thanks as always
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
-
Marth8880
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Spawn timer?
It's stored in BattlefrontII.exe, so no, it is not legally possible. It has been done before, though, by I believe the guys over at SWGO.
- Nedarb7
- Lieutenant General

- Posts: 676
- Joined: Sat Sep 22, 2012 3:41 pm
Re: Spawn timer?
I know this is off-topic but does this line in the LUA set the spawn delay for offline:
SetSpawnDelay(10.0, 0.25)
SetSpawnDelay(10.0, 0.25)
-
nobody3
- Rebel Sergeant

- Posts: 188
- Joined: Wed Jun 15, 2011 8:30 am
Re: Spawn timer?
No prob. You actually helped me indirectly didnt you xD
topic may be closed
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Spawn timer?
You can setup a repeating timer to respawn all dead units every ## seconds. Another way would be to add an death event listener and respawn a unit as soon as it dies. The problems for human players is that they might not have enough time to switch units and they won't be able to control where they respawn. I always called this "force spawn". I'm sure the code is hiding somewhere in these forums.
If you want this on a server, you'll need to create a custom user script so that your code gets loaded on the maps you want. If you run the code when not the host, your game will respawn you but the server won't respawn you. Your unit gets 'disconnected' and can't do anything because it doesn't actually exist.
If you want this on a server, you'll need to create a custom user script so that your code gets loaded on the maps you want. If you run the code when not the host, your game will respawn you but the server won't respawn you. Your unit gets 'disconnected' and can't do anything because it doesn't actually exist.
-
nobody3
- Rebel Sergeant

- Posts: 188
- Joined: Wed Jun 15, 2011 8:30 am
Re: Spawn timer?
that sounds good because forcing players to spawn is what i was looking for, the thing is, would the script also work on ps2 dedicated server? I think it would but not sure
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Spawn timer?
I've never tested it on a PS2, but I would expect it to work.
-
nobody3
- Rebel Sergeant

- Posts: 188
- Joined: Wed Jun 15, 2011 8:30 am
Re: Spawn timer?
im not sure how to do it though, what would I need to do? does the"force spawn" code have to be ran through fake console? because there is none on ps2, oh well there is but I dont know how to turn it on but its possible because another person has done it before
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Spawn timer?
Long way using a timer (adapted from the spawn as locals script). This is a custom user script requiring v1.3 and following v1.3's tutorials on munging custom user scripts. Untested code:
The shorter way would be to use OnCharacterDeath (or whatever it is). Inside that use SelectCharacterClass() and SpawnCharacter(). Ambushing does a similar thing so look at the ambush code for another example. You'll still need to make a custom user script to get your code injected into the server. The documentation include with v1.3 has the steps to do that. I don't rmember if it's safe to install v1.3 ontop of the PS2 dedicated server software. Run the v1.3 r129 installer normally but be sure to select the proper path for the server software instead of the actual PC game.
If you go the OnCharacterDeath route, I recommend creating a basic map and trying your code on that. Then convert your working script changes into a custom user script.
Hidden/Spoiler:
The shorter way would be to use OnCharacterDeath (or whatever it is). Inside that use SelectCharacterClass() and SpawnCharacter(). Ambushing does a similar thing so look at the ambush code for another example. You'll still need to make a custom user script to get your code injected into the server. The documentation include with v1.3 has the steps to do that. I don't rmember if it's safe to install v1.3 ontop of the PS2 dedicated server software. Run the v1.3 r129 installer normally but be sure to select the proper path for the server software instead of the actual PC game.
If you go the OnCharacterDeath route, I recommend creating a basic map and trying your code on that. Then convert your working script changes into a custom user script.
