Randomizing Objective Object Locations

Ask questions, discuss ideas, get answers

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: 412
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".

viewtopic.php?f=6&t=1812

viewtopic.php?f=43&t=1749&p=12543

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™
Image
User avatar
Swaffy
 
Posts: 1701
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Randomizing Objective Object Locations

Postby takiwa » Fri Dec 22, 2017 9:24 pm

Could you make a dummy PCO for the objective and spawn the actual objective from it to a random location by using multiple spawn locations?
Image
takiwa
 
Posts: 118
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Randomizing Objective Object Locations

Postby Classical Modder » Sun Dec 24, 2017 4:16 pm

takiwa wrote:Could you make a dummy PCO for the objective and spawn the actual objective from it to a random location by using multiple spawn locations?


The thing is, will object spawns behave like soldier spawns and spawn randomly? I think if you use that method all the objects that are tied to the dummy PCO will spawn at once at the locations that have been set on the spawner. It's worth testing though.
{SoH} Clan Leader // http://sohclan.forumotion.com/
See my Strasbourg map project here.
GSC: diamondback67
Steam: diamondback67
Classical Modder
 
Posts: 412
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada

Re: Randomizing Objective Object Locations

Postby takiwa » Thu Dec 28, 2017 2:27 am

rem ----- ObjectiveComplex -----
ObjectTemplate.create Bundle ObjectiveComplex
ObjectTemplate.setNetworkableInfo Objective_info
rem -------------------------------------
ObjectTemplate.addTemplate RandomObjectiveSpawner
ObjectTemplate.setRandomGeometries 4

rem ----- RandomObjectiveSpawner -----
ObjectTemplate.create Bundle RandomObjectiveSpawner1
ObjectTemplate.geometry bullet
rem -------------------------------------
ObjectTemplate.addTemplate ObjectiveSpawner
ObjectTemplate setPosition 0/0/10
rem -------------------------------------
ObjectTemplate.create Bundle RandomObjectiveSpawner2
ObjectTemplate.geometry bullet
rem -------------------------------------
ObjectTemplate.addTemplate ObjectiveSpawner
ObjectTemplate setPosition 0/0/-10
rem -------------------------------------
ObjectTemplate.create Bundle RandomObjectiveSpawner3
ObjectTemplate.geometry bullet
rem -------------------------------------
ObjectTemplate.addTemplate ObjectiveSpawner
ObjectTemplate setPosition 0/0/20
rem -------------------------------------
ObjectTemplate.create Bundle RandomObjectiveSpawner4
ObjectTemplate.geometry bullet
rem -------------------------------------
ObjectTemplate.addTemplate ObjectiveSpawner
ObjectTemplate setPosition 0/0/-20

then define the ObjectiveSpawner as your Objective...wouldn't this give you 4 random placements? Granted, they are still predefined, but you wouldn't know which one you would get. Increase the random geoms to add more...just a thought, haven't tested it so I don't even know if this would work.
Image
takiwa
 
Posts: 118
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Randomizing Objective Object Locations

Postby takiwa » Wed Jan 03, 2018 1:32 am

you are correct, they aren't truly random, but close...and I see no other way of getting a "random" spawn to work in this engine...
Image
takiwa
 
Posts: 118
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia


Return to 1942 Modding Discussion

Who is online

Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 18 guests