Skip to content

VikingKampfsau/dynamic_mapvote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

Dynamic Mapvote

Overview

A little test if it's possible to create a dynamic mapvote.
This is a menu based mapvote that auto updates its iwd everytime the map ends.
That way the content of the mapvote is constantly changing without wasteing assets.

I never used this in any of my mods so it's not tested on a live server yet
Full source included

LINUX OS ONLY!

Preview

Video might be outdated but still shows the main content of the vote menu.

mapvote_preview.mp4

Installation

When you don't run your fastdl on the same machine as your cod4 server, then please install 'sshpass' in order to upload the iwd to your fastdl encrypted, otherwise install 'cURL'. When you run your fastdl on the same machine as your cod4 server, then a softlink created on the fastdl pointing to the mapvote.iwd is enough.

Note: For sshpass you might have to accept the host fingerprint on the very first run!

Install the example files from this repro:

Install cod4x and add the required plugins to it.
Copy the mod to your mods folder - if you already have an older version then remove it.

Add the content of the example config to your server config.

Add this repro to your mod project:

Install cod4x and add the required plugins to it.
Add the content of the example config to your server config.
Add the content of the example mod.csv to your mod.csv.
Copy the materials, material_propteries and ui_mp folders to your modtools raw folder.
Copy the mapvote folder and mapvote.iwd to the root folder of your mod. Compile your mod.

Modify the maps/mp/gametype/_globallogic.gsc or the script that handles your end of game and map rotation. Add the following at the desired position:

	level notify("start_mapvote"); //start the mapvote
	level waittill("end_mapvote"); //wait for it's end

Also do not forget to init the mapvote. Add the following line to any main function of your scripts:

	thread mapvote\script\dynamic_mapvote::init(); //init mapvote

How to add more maps

Add the map to config - dvar "sv_voteable_maps".
Add the loadscreen.iwi file to \mapvote\images folder.

FAQ

Q: I have an loadscreen image in the \mapvote\images folder but the image does not appear ingame.
A: Your loadscreen image might have a different name than the map itself
You can either rename the loadscree image in \mapvote\images to match the map name,
or add the reference to the _replacements.csv found in same folder.

Q: The mapvote.iwd is not updating
A: Check your console log and make sure you installed 'zip' on your server

Q: The mapvote.iwd is generated empty and players get kicked with "Could not find loadscreen_0.iwi"
A: Make sure you installed 'zip' on your server
Make sure the folder and file permissions are correct
Make sure you have set the fs_homepath correctly

Q: Players get a download loop when downloading the mapvote.iwd
A: The mod generates a new mapvote.iwd on every map end therefor the file continously changes.
To avoid a download loop create a softlink instead.

Q: Players download the mapvote.iwd from server instead from fastdl
A: When your fastdl runs on the same machine as your server you can create a softlink at fastdl folder to the mapvote.iwd located in your cod4 server.
Some people already reported problems with apache and the softlink - use the file upload then.
To upload the mapvote.iwd to a remote server please check your config settings and the login and file permissions on the remote server.
The console log should tell you when the upload failed

Support

For bug reports and issues, please visit the "Issues" tab at the top.

First look through the issues, maybe your problem has already been reported.

If not, feel free to open a new issue.

Keep in mind that we only support the current state of the repository - older versions are not supported anymore!

However, for any kind of question, feel free to visit our discord server at https://discord.gg/wDV8Eeu!

About

CoD4 Dynamic Mapvote Development Repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages