Scripts / Death match script ?

Author
Message
MooKai
GameGuru TGC Backer
14
Years of Service
User Offline
Joined: 22nd Jul 2009
Location: World
Posted: 4th Aug 2015 09:29
A death match script would be nice.
But I don't know where to start.

Single player death match.
Let's say there're 10 enemies on the map and after you've killed the last one, the game jumps to the next map.

So, something like "last enemie death jump to map x"
Old school FPS fan, DOOM!!! Why GG not working on my AMIGA 500?
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 4th Aug 2015 15:51
Quote: "But I don't know where to start."

Kill the last enemy firts and you are done faster.

Seriously version:
You need declare a globar variable (I usually use "killcount"), then iincrease that variable each time you kill an enemy.
Continue with the example you state above, when "killcount=0", jump to next level.

How increase variable?
Assume you've 10 enemiies, so in "exit function of each one" you can do it.



Who will check the global being = 0?
Since probably you'll use winzone, this is a good place to declare global variable, and to check their value, so there is not enaugh with enter in zone, also global should be = 10.



This is not the complete solution, but it is a good start point.

3com


Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Pirate Myke
Forum Support
13
Years of Service
Recently Online
Joined: 31st May 2010
Location: El Dorado, California
Posted: 4th Aug 2015 16:38
This is the script that the multiplayer marker uses. It is located in the scirptbanks folder.

I would start with it.
multiplayer_firstto10.lua
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 4th Aug 2015 18:59
You're right Mike, I had never noticed this script, because I'm not very interested in the multiplayer issue.
From what I have observed all lies in the variables (arrays)
GAME_KILLS_TO_WIN = 10 and mp_playerKills [i] = 0.
If you want to make a multiplayer game, there are other variables that you can also play.
Thanks for the info.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Pirate Myke
Forum Support
13
Years of Service
Recently Online
Joined: 31st May 2010
Location: El Dorado, California
Posted: 4th Aug 2015 19:31
Your welcome.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

MooKai
GameGuru TGC Backer
14
Years of Service
User Offline
Joined: 22nd Jul 2009
Location: World
Posted: 4th Aug 2015 22:33 Edited at: 4th Aug 2015 22:37
Ah, yes. Thank you both.
Multiplayer scripts, yes it's nearly the same, I hope.
I will check the scripts on the weekend. Maybe another idea would be, to check, if a npc is in the zone or not.
But yes, I will check the multiplayer scripts... as they are close to what I'm thinking off... a fast deathmatch singleplayer.
Same you play Quake 3 Arena with bots offline.

But tomorrow I want to finish another game for the contest, today I lost 1 day, just came back from family diner...


copy that I don't forget it:

multiplayer_firstto10.lua




edit: with a deathmatch singleplayer you could do small and fast (gameplay) maps. which would run good on most pcs.
Old school FPS fan, DOOM!!! Why GG not working on my AMIGA 500?
PM
Inertia
8
Years of Service
User Offline
Joined: 12th Jul 2015
Location: SoCal, USA
Posted: 5th Aug 2015 00:51
I tried this using 3com's original scheme and it worked fine. I created two levels in my mapbank folder then created a folder for my scripts "scriptbank\deathmatch", where I created a new Lua file called "killcount.lua". Additionally, I copied two files there: "ai_soldier.lua" and "winzone.lua".

killcount.lua (attach this script to a Trigger Zone and set the zone on top of the Player Start zone):


winzone.lua (attach this script to the Win Zone and edit properties with level2 name in "IfUsed") :


ai_soldier.lua (this snippet shows the change to the exit function only--attach script to each NPC):


I saved the standalone, played it, and sure enough the Win Zone will only take me to the next level if I've killed all the required NPCs.
Windows 10 7 x64 | i5 @3.3GHz | 4GB RAM | GTX580 1.5 GB
PM
MooKai
GameGuru TGC Backer
14
Years of Service
User Offline
Joined: 22nd Jul 2009
Location: World
Posted: 5th Aug 2015 07:42
Thank you Inertia, I will try it.
Old school FPS fan, DOOM!!! Why GG not working on my AMIGA 500?
PM

Login to post a reply

Server time is: 2024-05-07 00:03:40
Your offset time is: 2024-05-07 00:03:40