Randomizing Objective Object Locations

Ask questions, discuss ideas, get answers

Randomizing Objective Object Locations

Postby Texafornian » Thu Mar 30, 2017 9:57 pm

I'm trying to create a search-and-destroy (Objective gametype) map for Galactic Conquest based on the Insurgency mode in Project Reality. The idea is that the defenders have two or three weapons caches (one per control point) and the attackers must destroy each of the caches to win the round. I'd like to add some randomization so that each cache is in one of a number of pre-determined locations each round. For example, the cache in the "City" control point might randomly spawn in a house one round, and then the cantina the next, but there would always only be one cache in that control point per round.

My initial guess was that I could include a set of conditional statements in the Objective gametype's .con files to spawn the caches in specific locations depending on which "if" statement is randomly satisfied that round. Is it possible to accomplish this idea in BF1942?
Posts: 8
Joined: Sat Feb 04, 2017 1:55 am

Re: Randomizing Objective Object Locations

Postby Classical Modder » Fri Mar 31, 2017 12:10 am

The only thing that comes to mind would be if you spawn those objectives at each map start via an in-game admin command such as !spawn objective (or something of the sort, depending on how you bind your admin command to the object to be spawned). The objectives would have different coordinates that have been set and determined before hand and depending on where you want the objective to spawn, you run the appropriate command for it (for example, !kitchen would spawn the kitchen objective).

As you may have guessed the downfall with that would be that you would have to type the command every time the map starts, i.e. its not automatic. To make this automatic then I guess you can just make a new CON file somewhere in your Settings folder and type in the appropriate code, however I have no idea how the game would know how to spawn a different objective each round.

Maybe you can make a conditional statement that runs objective A when the map round number is odd and objective B when it is even? Just a bunch of ideas lol sorry for the novel here.
{SoH} Clan Leader // http://sohclan.forumotion.com/
See my Strasbourg map project here.
GSC: diamondback67
Steam: diamondback67
Classical Modder
Posts: 347
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada

Re: Randomizing Objective Object Locations

Postby Swaffy » Fri Mar 31, 2017 3:03 am

I got some results while searching "random weapons".



It may be sequential though. Worth a try. I think effects use a randomizer of some sort but I don't know how to use that.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Posts: 1651
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Randomizing Objective Object Locations

Postby Texafornian » Fri Mar 31, 2017 5:03 am

Thanks for the input. I'll keep the admin command method in mind; it'll be a good last ditch solution. Unfortunately the sequential counters would be problematic as the locations of the caches in the first few rounds could be memorized.

Edit: fo0k's post (viewtopic.php?f=6&t=1151&p=7963) suggests that the sequential behavior stops and becomes random after the order is completed once. Can anyone confirm this? If so, maybe it'd be possible to quickly run through the order on map load (spawning and destroying the caches) and then let it go random.

Here are some assorted thoughts/approaches as I'm not really sure of what's possible or not in BF1942 modding:

1) Use SetRandomGeometries on some player on map load. Is there a way to "check" which geometry has been chosen? If so, the script could set a variable and/or fulfill a conditional statement corresponding with that geometry (1 = Kitchen, 2 = Cantina, 3 = House, etc.).

2) Spawn a weapon cache with one random player at each control point the first time the map loads.

3) Use a randomized vehicle spawner to spawn a jeep below the map/beyond the boundaries on map load and check its location. There could be four or five different possible locations for the vehicle, with each location corresponding to an objective placement.

4) Would it be possible for players to put the cache down themselves? It'd have to be limited to just 2 or 3 placements somehow. Could it be done via limited kits that would have to be picked up?
Posts: 8
Joined: Sat Feb 04, 2017 1:55 am

Return to 1942 Modding Discussion

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 4 guests