[0.12.x] PvP Scenarios

Place to share custom user maps, scenarios and campaigns.

Re: [0.12.x] PvP Scenarios

Postby waduk » Thu Apr 07, 2016 2:40 pm

Thanks Klonan, i'll try to get my head around this.
waduk
Filter Inserter
Filter Inserter
 
Posts: 353
Joined: Tue Feb 10, 2015 5:44 pm

Re: [0.12.x] PvP Scenarios

Postby waduk » Mon Apr 11, 2016 12:53 pm

Thanks Klonan, i manage to make it work (teleport) in simple test map.
But can't get it to work on real custom map, the teleport GUI prompt didn't show up.
i think it's due the method i use to make custom map.
I'm using this mod to convert map to image :
viewtopic.php?f=14&t=7243&start=0

Here how it's work :
  1. Open the game using factorio 0.11.22 (because the mod is only supported factorio 0.11.x)
  2. Generate map
  3. Enter the game to use console to export the map ; /c remote.call("MapConverter", "Export")
  4. Convert the map to readable format (png), edit as necessary in Photoshop, save it
  5. Enter the game again to import the map. /c remote.call(\"MapConverter\", \"Import\")
  6. Exit the game, then use "/bin/prod/factorio --map2scenario " command to import the save file into Map Editor
  7. Open the map using Map Editor from latest factorio version
  8. Save the map for compatibility

I think the problem is because there are already player entity in the game, so the teleport option didn't pop-up.

So, how do i remedy this ?
Also, is there a way to disable building/recipe ?
I want to force player to use certain building that i place it beforehand (rocket silo)
Also, is there a way to set victory condition ?
I want the player to eliminate all enemy in map (the map is limited to certain distance, so it's not infinite), if only after certain condition is met (launching rocket X times + eliminate enemy), then the victory screen is pop-up.

But for time being, my priority is to make the teleport working as intended.
Sorry if i'm asking too much.

I'm also planning to make tutorial after all of this were done, so others can build their own custom map.

Btw, here's the code i use, taken from one of your custom map:
Code
Code: Select all
require "defines"

function init()
   if not global.deadPlayers then
      global.deadPlayers = {}
      end
   create_forces()
end

script.on_init(init)
--script.on_load(init)


script.on_event(defines.events.on_player_created, function(event)
   local player = game.get_player(event.player_index)
   --local force = player.force

         
         
      if player.force == game.forces.player then
      player.gui.center.add{type = "button", caption = "Join Blue Team" .. " " ..global.bluemembers, name = "blue"}.style.font_color = {b = 1, r= 0.6, g = 0.6}
      player.gui.center.add{type = "button", caption = "Join Red Team" .. " " ..global.redmembers, name = "red"}.style.font_color = {b = 0.3, r= 1, g = 0.3}
         end
         end)
         
      
   
   
function create_forces()
if game.forces.blue ==nil then
   game.create_force("blue")   
   global.bluemembers = 0
   
   
   game.create_force("red")   
   global.redmembers = 0   
   
end
   end   

 script.on_event(defines.events.on_gui_click, function(event)
 
 local player = game.players[event.player_index]
    if player.gui.center.blue ~= nil then
   if (event.element.name == "blue") then
      
     player.print("You have Joined Blue Team")
    player.teleport({-90,-46})
    player.force = game.forces.blue
    player.gui.center.red.destroy()   
    player.gui.center.blue.destroy()
    player.color = {b = 1, r = 0.3, g = 0.3}
   
--    player.insert({name = "coin" , count = 10000})
    global.bluemembers = global.bluemembers + 1
             
   
   player.insert{name="iron-plate", count=50}
               
              player.insert{name="steel-axe", count=3}
              player.insert{name="repair-pack", count=50}
             

              player.insert{name="burner-inserter", count=50}
              player.insert{name="basic-inserter", count=30}
              player.insert{name="basic-transport-belt", count=200}
              player.insert{name="small-electric-pole", count=20}
             
             
              player.insert{name="submachine-gun", count=1}
              player.insert{name="piercing-bullet-magazine", count=50} 
              player.insert{name="combat-shotgun", count=1}
              player.insert{name="piercing-shotgun-shell", count=50} 
              player.insert{name="rocket-launcher", count=1} 
              player.insert{name="rocket", count=50}
             
              player.insert{name="burner-mining-drill", count = 20}
              player.insert{name="stone-furnace", count = 15} 
             
              player.insert{name="power-armor", count = 1}
              player.insert{name="fusion-reactor-equipment", count = 1}
              player.insert{name="energy-shield-mk2-equipment", count = 2}
              player.insert{name="personal-roboport-equipment", count = 1}
              player.insert{name="basic-exoskeleton-equipment", count = 1}
              player.insert{name="car", count = 1}
              player.insert{name="construction-robot", count = 10}
              player.insert{name="blueprint", count = 2}
              player.insert{name="deconstruction-planner", count = 1}
              player.insert{name="electronic-circuit", count = 20}
   
   end
   end
   
   
   if player.gui.center.red ~= nil then
   if (event.element.name == "red") then
      local player = game.players[event.player_index]
   
     player.print("You have Joined Red Team")
    player.teleport({90,46})
    player.force = game.forces.red
    player.gui.center.red.destroy()   
    player.gui.center.blue.destroy()
    player.color = {b = 0.3, r = 1, g = 0.3}
   
--    player.insert({name = "coin" , count = 10000})
    global.redmembers = global.redmembers + 1
   
      player.insert{name="iron-plate", count=50}
               
              player.insert{name="steel-axe", count=3}
              player.insert{name="repair-pack", count=50}
             

              player.insert{name="burner-inserter", count=50}
              player.insert{name="basic-inserter", count=30}
              player.insert{name="basic-transport-belt", count=200}
              player.insert{name="small-electric-pole", count=20}
             
             
              player.insert{name="submachine-gun", count=1}
              player.insert{name="piercing-bullet-magazine", count=50} 
              player.insert{name="combat-shotgun", count=1}
              player.insert{name="piercing-shotgun-shell", count=50} 
              player.insert{name="rocket-launcher", count=1} 
              player.insert{name="rocket", count=50}
             
              player.insert{name="burner-mining-drill", count = 20}
              player.insert{name="stone-furnace", count = 15} 
             
              player.insert{name="power-armor", count = 1}
              player.insert{name="fusion-reactor-equipment", count = 1}
              player.insert{name="energy-shield-mk2-equipment", count = 2}
              player.insert{name="personal-roboport-equipment", count = 1}
              player.insert{name="basic-exoskeleton-equipment", count = 1}
              player.insert{name="car", count = 1}
              player.insert{name="construction-robot", count = 10}
              player.insert{name="blueprint", count = 2}
              player.insert{name="deconstruction-planner", count = 1}
              player.insert{name="electronic-circuit", count = 20}
      
      
   end
   end
   
 end)
 
 script.on_event(defines.events.on_tick, function(event)

      for playerIndex, value in pairs(global.deadPlayers) do
   local player = game.players[playerIndex]
         if player.character then
      
      
         if player.force == game.forces.red then
               player.teleport({90,46})
               
              player.insert{name="iron-plate", count=50}
               
              player.insert{name="steel-axe", count=3}
              player.insert{name="repair-pack", count=50}
             

              player.insert{name="burner-inserter", count=50}
              player.insert{name="basic-inserter", count=30}
              player.insert{name="basic-transport-belt", count=200}
              player.insert{name="small-electric-pole", count=20}
             
             
              player.insert{name="submachine-gun", count=1}
              player.insert{name="piercing-bullet-magazine", count=50} 
              player.insert{name="combat-shotgun", count=1}
              player.insert{name="piercing-shotgun-shell", count=50} 
              player.insert{name="rocket-launcher", count=1} 
              player.insert{name="rocket", count=50}
             
              player.insert{name="burner-mining-drill", count = 20}
              player.insert{name="stone-furnace", count = 15} 
             
              player.insert{name="power-armor", count = 1}
              player.insert{name="fusion-reactor-equipment", count = 1}
              player.insert{name="energy-shield-mk2-equipment", count = 2}
              player.insert{name="personal-roboport-equipment", count = 1}
              player.insert{name="basic-exoskeleton-equipment", count = 1}
              player.insert{name="car", count = 1}
              player.insert{name="construction-robot", count = 10}
              player.insert{name="blueprint", count = 2}
              player.insert{name="deconstruction-planner", count = 1}

               
               end

         if player.force == game.forces.blue then
               player.teleport({-90,-46})
               
                  player.insert{name="iron-plate", count=50}
               
              player.insert{name="steel-axe", count=3}
              player.insert{name="repair-pack", count=50}
             

              player.insert{name="burner-inserter", count=50}
              player.insert{name="basic-inserter", count=30}
              player.insert{name="basic-transport-belt", count=200}
              player.insert{name="small-electric-pole", count=20}
             
             
              player.insert{name="submachine-gun", count=1}
              player.insert{name="piercing-bullet-magazine", count=50} 
              player.insert{name="combat-shotgun", count=1}
              player.insert{name="piercing-shotgun-shell", count=50} 
              player.insert{name="rocket-launcher", count=1} 
              player.insert{name="rocket", count=50}
             
              player.insert{name="burner-mining-drill", count = 20}
              player.insert{name="stone-furnace", count = 15} 
             
              player.insert{name="power-armor", count = 1}
              player.insert{name="fusion-reactor-equipment", count = 1}
              player.insert{name="energy-shield-mk2-equipment", count = 2}
              player.insert{name="personal-roboport-equipment", count = 1}
              player.insert{name="basic-exoskeleton-equipment", count = 1}
              player.insert{name="car", count = 1}
              player.insert{name="construction-robot", count = 10}
              player.insert{name="blueprint", count = 2}
              player.insert{name="deconstruction-planner", count = 1}
               
               end
               

         

            global.deadPlayers[playerIndex] = nil
         end
      end

      end)
waduk
Filter Inserter
Filter Inserter
 
Posts: 353
Joined: Tue Feb 10, 2015 5:44 pm

Re: [0.12.x] PvP Scenarios

Postby Maiyr » Sat Apr 16, 2016 3:03 pm

Any chances of new pvp scenarios or autonomous AI units that head in enemies direction that we can create? We don't control with unit but it heads out and seeks our enemy team. Similar to the pvp biter mod?
Maiyr
Burner Inserter
Burner Inserter
 
Posts: 7
Joined: Sat Apr 16, 2016 3:00 pm

Re: [0.12.x] PvP Scenarios

Postby EmPowereD » Mon May 02, 2016 3:12 pm

But how can I get alien artifacts on your "newlands" map??
EmPowereD
Manual Inserter
Manual Inserter
 
Posts: 4
Joined: Mon Mar 28, 2016 5:26 pm

Re: [0.12.x] PvP Scenarios

Postby Klonan » Mon May 02, 2016 3:57 pm

EmPowereD wrote:But how can I get alien artifacts on your "newlands" map??


Code: Select all
/c game.local_player.insert{name = "alien-artifact", count = 100}
User avatar
Klonan
Factorio Staff
Factorio Staff
 
Posts: 2784
Joined: Sun Jan 11, 2015 2:09 pm

Re: [0.12.x] PvP Scenarios

Postby Maiyr » Thu May 12, 2016 9:43 pm

How can we modify the red vs blue map to remove market and increase size. Also was thinking of modifying center to create on Land bridge filled with biters. Was thinking of the roboport destruction scenario.
Maiyr
Burner Inserter
Burner Inserter
 
Posts: 7
Joined: Sat Apr 16, 2016 3:00 pm

Re: [0.12.x] PvP Scenarios

Postby kurtzbot » Sat Jul 09, 2016 4:29 am

I updated the mod to work with 0.13, only a couple minor changes.

pvp.zip
Works with 0.13
(22.11 KiB) Downloaded 118 times


Changes:
* Removed `require "defines"`
* Changed an out-dated reference to `firearm-magazine`
* Daytime was changed to reference its new location inside LuaSurface
* Bad reference to game.player, changed to game.player[index]

I tested it by loading the Scenario, waiting for teams to unlock, joining Orange, and then running into a group of biters :P
kurtzbot
Manual Inserter
Manual Inserter
 
Posts: 1
Joined: Sat Jul 09, 2016 4:23 am

Re: [0.12.x] PvP Scenarios

Postby KaleR » Tue Jul 19, 2016 3:31 pm

Hello there,

I know this thread is very old, but I want to mention my new mod based on the pvp scenario made by Klonan.

https://mods.factorio.com/mods/KaleR/Teams

It is possible to create teams on startup, enemy bases will be cleared in every team.

Some other features are alliances, team messages, attack notifications and research notifications. Every feature is configurable on startup.

Regards,
KaleR
My Mods: Teams, Statistic
KaleR
Burner Inserter
Burner Inserter
 
Posts: 14
Joined: Wed May 18, 2016 7:42 am

Re: [0.12.x] PvP Scenarios

Postby Chocolatetthunder » Fri Sep 23, 2016 4:56 pm

This is my current iteration of the Roboport pvp.
on our discord I keep a change log. here is what it looks like so far. it reads newest first.
3Ra_Roboport_v0.6
change list
v0.6.3
fixed flashlight toggle

v0.6.2
added a button to toggle the flashlight if it is on.
added a team counter at the top to constatly desplay how many players of each team are online and the total joined of each.

v0.6.1
fixed roboport destruction. Explosion sequence now plays when the main roboport is destroyed
40 points is properly applied to the correct team.
Score board now shows any time a point is added.
Admin spectator mode now works more better.

v0.6
added an admin check to introduce spectator mode (for admins only)
edited spectataor so it works

v0.5
changed the basis of the game, destroying the roboport no longer wins the game
destroying the roboport will award that team with 40 points
100 points will win the game.
on player death added cursor stack to grave inventory.
added announcements
eddited welcome messages
fixed "check" to show players currently on each team.

v0.4 archived
added force spectator
added respawn inventory of 1 pistol and 10 rounds of "firearm-magazine"
changed objective(on choose team) to just a print message "Destroy the Orange Roboport"

fixed bug trying to teleport offline players to the dying roboport position.
Attachments
control.lua
(21.23 KiB) Downloaded 45 times
3Ra Gaming Owner
join us on discord @ http://www.3RaGaming.com/discord
Senarios:
3Ra Team PvP
3Ra PvP Battle Arena
3Ra CTF (Coming Soon)
Chocolatetthunder
Long Handed Inserter
Long Handed Inserter
 
Posts: 50
Joined: Sat Sep 03, 2016 12:00 am

Re: [0.12.x] PvP Scenarios

Postby studmuffin » Fri Oct 07, 2016 10:23 pm

Here is a link to our github of scenarios which includes constant updates of our version of PvP taken from this thread. This PvP has been a fun one on our servers :) We have a great working version (for 14.11+, tested up to 14.13 (current version) with some additional features implemented. One of our community coders (Articulating) is overhauling the script right now, so a new version may be posted in a few hours/days. This overhaul will make adding additional features much easier.

We're also hosting a large event tomorrow featuring this scenario. Link to reddit announcement
Last edited by studmuffin on Mon Nov 07, 2016 5:53 pm, edited 1 time in total.
studmuffin
Inserter
Inserter
 
Posts: 41
Joined: Fri Apr 01, 2016 4:41 pm

Re: [0.12.x] PvP Scenarios

Postby LJL_Houben » Sat Nov 05, 2016 11:02 pm

kurtzbot wrote:I updated the mod to work with 0.13, only a couple minor changes.

pvp.zip


Changes:
* Removed `require "defines"`
* Changed an out-dated reference to `firearm-magazine`
* Daytime was changed to reference its new location inside LuaSurface
* Bad reference to game.player, changed to game.player[index]

I tested it by loading the Scenario, waiting for teams to unlock, joining Orange, and then running into a group of biters :P


Looks like it works on 0.14.19 too (still have to test it on a LAN party dough)
Found a small typo:
Code: Select all
      p.print("Map unsutitable, please restart")


But why do we have to wait this long to be able to select the teams?
LJL_Houben
Burner Inserter
Burner Inserter
 
Posts: 19
Joined: Mon Oct 17, 2016 8:09 pm

Re: [0.12.x] PvP Scenarios

Postby studmuffin » Mon Nov 07, 2016 5:57 pm

It has to do with chunk loading. Trying to place/manipulate entities on a chunk that has not been loaded yet causes the game to crash. In a dev version of our modification to PvP, instead of time based loading team selection, we detect when all the proper chunks have been loaded, then do the script work on entities, then unlock teams.

This is also a limitation on how factorio handles chunks. We found when we increased the game.speed, the chunks would generate faster, leading us to understand chunk loading is based on ticks, not on necessarily on processor speed capabilities. To generate this pvp map takes roughly 30-50 seconds worth of ticks. Our version is set to increase the game.speed on map initialization, and drop it down to regular speed after the chunks have been generated.
studmuffin
Inserter
Inserter
 
Posts: 41
Joined: Fri Apr 01, 2016 4:41 pm

Re: [0.12.x] PvP Scenarios

Postby Klonan » Mon Nov 07, 2016 6:14 pm

studmuffin wrote:It has to do with chunk loading. Trying to place/manipulate entities on a chunk that has not been loaded yet causes the game to crash. In a dev version of our modification to PvP, instead of time based loading team selection, we detect when all the proper chunks have been loaded, then do the script work on entities, then unlock teams.

This is also a limitation on how factorio handles chunks. We found when we increased the game.speed, the chunks would generate faster, leading us to understand chunk loading is based on ticks, not on necessarily on processor speed capabilities. To generate this pvp map takes roughly 30-50 seconds worth of ticks. Our version is set to increase the game.speed on map initialization, and drop it down to regular speed after the chunks have been generated.



Exactly,

I have also solved the issue in 2 different ways for the PvP script i am working on,

One is exactly the same, increase game speed and detect when all the chunks are ready
User avatar
Klonan
Factorio Staff
Factorio Staff
 
Posts: 2784
Joined: Sun Jan 11, 2015 2:09 pm

Re: [0.12.x] PvP Scenarios

Postby Blackraz0r » Sat May 20, 2017 11:31 am

Hey, is this the standard builtin PvP Scenario?

I am currently trying to figure out how to decrease the damage of Grenades Rockets and Cannon Shells (Because they are gamender)

But i can't. I can multiply them by a given number, but it does only work with full integer. I am not able to set the Grenade damage to like 10% (0.1) Then it simply just wont change at all.

Am i doing something wrong?

Edit: Oh my, when you set Walking Speed to a negative number, you'll walk backwards. :D
Blackraz0r
Inserter
Inserter
 
Posts: 48
Joined: Sun Dec 28, 2014 1:03 pm

Re: [0.12.x] PvP Scenarios

Postby Klonan » Sat May 20, 2017 12:40 pm

Blackraz0r wrote:Hey, is this the standard builtin PvP Scenario?

I am currently trying to figure out how to decrease the damage of Grenades Rockets and Cannon Shells (Because they are gamender)

But i can't. I can multiply them by a given number, but it does only work with full integer. I am not able to set the Grenade damage to like 10% (0.1) Then it simply just wont change at all.

Am i doing something wrong?

Edit: Oh my, when you set Walking Speed to a negative number, you'll walk backwards. :D


The modifiers are a bonus, so if you want 50% damage, you will have to set it to -0.5

Such that 0 = 100%, 0.5 = 150%, 1 = 200%, -1 = 0%, -0.5 = 50%
User avatar
Klonan
Factorio Staff
Factorio Staff
 
Posts: 2784
Joined: Sun Jan 11, 2015 2:09 pm

Re: [0.12.x] PvP Scenarios

Postby Blackraz0r » Sat May 20, 2017 3:06 pm

Ah got it!

This scenario is totally crazy awesome! I'm hosting a server based on this and its amazing how much fun it is! Thank you for this!

Is there a way to buff the overall entity health? Like all player structures have 50% more HP?
Also nice would be to have a modifier for the range of weapons.
We found out that rockets, grenades and the tank cannon are kinda gameender because of the high range wich can easily outrange any turrets.

Are you planing to further improve these and other scenarios or create more? I think they are amazing <3
Blackraz0r
Inserter
Inserter
 
Posts: 48
Joined: Sun Dec 28, 2014 1:03 pm

Previous

Return to Maps and Scenarios

Who is online

Users browsing this forum: No registered users and 1 guest