*

Account

Welcome, Guest. Please login or register.
Did you miss your activation email?
September 29, 2024, 11:37:00 am

Login with username, password and session length

Resources

Recent posts

[September 26, 2024, 09:37:35 am]

[September 06, 2024, 11:58:09 am]

[September 05, 2024, 01:54:13 pm]

[July 16, 2024, 11:30:34 pm]

[June 22, 2024, 06:49:40 am]

[March 08, 2024, 12:13:38 am]

[March 08, 2024, 12:12:54 am]

[March 08, 2024, 12:09:37 am]

[December 30, 2023, 08:00:58 pm]

[February 04, 2023, 11:46:41 am]
Pages: [1]   Go Down
  Print  
Author Topic: Adding event artillery to maps  (Read 6706 times)
0 Members and 1 Guest are viewing this topic.
salan Offline
Synergies TL2 mod!
*
Posts: 6290


« on: February 21, 2009, 06:58:04 pm »

trying to find that post where it shows the scar for adding all that artillery to maps at the start.. anyone know where it is?
Logged

Khorney Offline
EIR Veteran
Posts: 221



« Reply #1 on: February 21, 2009, 07:12:04 pm »

tbh, i dunno if i like the script, i'm not entirely sure what it is supposed to add, apart from a harder time for the defenders 9unless that is the point =P)
Logged
Tymathee Offline
Donator
*
Posts: 9741



« Reply #2 on: February 21, 2009, 07:38:11 pm »

just look at St Come Du Mont and see if you can find it there i guess

found this in st come du mont in the .scar file.

« Last Edit: February 21, 2009, 08:25:01 pm by Tymathee » Logged

"I want proof!"
"I have proof!"
"Whatever, I'm still right"

Dafuq man, don't ask for proof if you'll refuse it if it's not in your favor, logic fallacy for the bloody win.
salan Offline
Synergies TL2 mod!
*
Posts: 6290


« Reply #3 on: February 21, 2009, 07:44:21 pm »

I was looking through there, trying to piece it together without the music .. getting there.

gotta blow up some of arnhem.
Logged
EscforrealityTLS Offline
EIR Veteran
Posts: 593



« Reply #4 on: February 21, 2009, 08:05:59 pm »

Nice one with Arhem by the way Salan, might I make a suggestion though. Delete some of the crap in it that is not needed, it tends to lag my lame ass computer.

Oh and the pink is so you!
Logged

Pwanawan baby!
Tymathee Offline
Donator
*
Posts: 9741



« Reply #5 on: February 21, 2009, 08:22:42 pm »

well...
Logged
Tymathee Offline
Donator
*
Posts: 9741



« Reply #6 on: February 21, 2009, 08:25:06 pm »

import("ScarUtil.scar")
import("printonscreen.scar")

-------------------------------------------------

function OnGameSetup()

  player1 = World_GetPlayerAt(1)
  player2 = World_GetPlayerAt(2)
  player3 = World_GetPlayerAt(3)
  player4 = World_GetPlayerAt(4)
  player5 = World_GetPlayerAt(5)
  player6 = World_GetPlayerAt(6)

--A_WARNING = "Artillery barrage incomming!!!"



end


  Rule_AddOneShot(green_arty1, 2)
  Rule_AddOneShot(green_arty2, Cool
  Rule_AddOneShot(green_arty3, 14)
  Rule_AddOneShot(green_arty4, 20)

  Rule_AddOneShot(blue_arty1, 4)
  Rule_AddOneShot(blue_arty2, 10)
  Rule_AddOneShot(blue_arty3, 16)
  Rule_AddOneShot(blue_arty4, 22)

  Rule_AddOneShot(red_arty1, 6)
  Rule_AddOneShot(red_arty2, 12)
  Rule_AddOneShot(red_arty3, 18)
  Rule_AddOneShot(red_arty4, 24)



-- Artillary warning

--  Rule_AddOneShot(arty_warning, 6)

end

Scar_AddInit(OnInit)


--[[ function arty_warning()

  PrintOnScreen (A_WARNING)
--  Sound_PlayStreamed(SOUNDS.RADIOMSG1)

end
]]
-- randomabweichung

function Util_GetRandomOffset(posi, mindista, maxdista)
local newposi = posi
newposi.x = newposi.x + World_GetRand(mindista, maxdista)
newposi.z = newposi.z + World_GetRand(mindista, maxdista)
return newposi
end

function green_arty1()
 local green_target1 = Util_GetPosition(Marker_FromName("green"..World_GetRand(1, 2), "green_marker"))
 local arty_bling = green_target1

 UI_CreateMinimapBlip(arty_bling, 4, BT_AttackHerePing)
 Cmd_Ability(player1, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(green_target1), -1, 1), nil, true)
end

function green_arty2()
 local green_target2 = Util_GetPosition(Marker_FromName("green"..World_GetRand(3, 4), "green_marker"))
 local arty_bling = green_target2

 UI_CreateMinimapBlip(arty_bling, 10, BT_AttackHerePing)
 Cmd_Ability(player4, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(green_target2), -1, 1), nil, true)
end

function green_arty3()
 local green_target3 = Util_GetPosition(Marker_FromName("green"..World_GetRand(5, 6), "green_marker"))
 local arty_bling = green_target3

 UI_CreateMinimapBlip(arty_bling, 16, BT_AttackHerePing)
 Cmd_Ability(player2, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(green_target3), -1, 1), nil, true)
end

function green_arty4()
 local green_target4 = Util_GetPosition(Marker_FromName("green"..World_GetRand(7, 9), "green_marker"))
 local arty_bling = green_target4

 UI_CreateMinimapBlip(arty_bling, 22, BT_AttackHerePing)
 Cmd_Ability(player5, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(green_target4), -1, 1), nil, true)
end



function blue_arty1()
 local blue_target1 = Util_GetPosition(Marker_FromName("blue"..World_GetRand(1, 2), "blue_marker"))
 local arty_bling = blue_target1

 UI_CreateMinimapBlip(arty_bling, 6, BT_AttackHerePing)

 Cmd_Ability(player3, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(blue_target1), -1, 1), nil, true)
end

function blue_arty2()
 local blue_target2 = Util_GetPosition(Marker_FromName("blue"..World_GetRand(3, 4), "blue_marker"))
 local arty_bling = blue_target2

 UI_CreateMinimapBlip(arty_bling, 10, BT_AttackHerePing)

 Cmd_Ability(player6, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(blue_target2), -1, 1), nil, true)
end

function blue_arty3()
 local blue_target3 = Util_GetPosition(Marker_FromName("blue"..World_GetRand(5, 6), "blue_marker"))
 local arty_bling = blue_target3

 UI_CreateMinimapBlip(arty_bling, 14, BT_AttackHerePing)

 Cmd_Ability(player1, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(blue_target3), -1, 1), nil, true)
end

function blue_arty4()
 local blue_target4 = Util_GetPosition(Marker_FromName("blue"..World_GetRand(7, 9), "blue_marker"))
 local arty_bling = blue_target4

 UI_CreateMinimapBlip(arty_bling, 18, BT_AttackHerePing)

 Cmd_Ability(player4, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(blue_target4), -1, 1), nil, true)
end



function red_arty1()
 local red_target1 = Util_GetPosition(Marker_FromName("red"..World_GetRand(1, 2), "red_marker"))
 local arty_bling = red_target1

 UI_CreateMinimapBlip(arty_bling, 8, BT_AttackHerePing)

 Cmd_Ability(player2, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(red_target1), -1, 1), nil, true)
end

function red_arty2()
 local red_target2 = Util_GetPosition(Marker_FromName("red"..World_GetRand(3, 4), "red_marker"))
 local arty_bling = red_target2

 UI_CreateMinimapBlip(arty_bling, 14, BT_AttackHerePing)
 Cmd_Ability(player5, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(red_target2), -1, 1), nil, true)
end

function red_arty3()
 local red_target3 = Util_GetPosition(Marker_FromName("red"..World_GetRand(5, 6), "red_marker"))
 local arty_bling = red_target3

 UI_CreateMinimapBlip(arty_bling, 18, BT_AttackHerePing)
 Cmd_Ability(player3, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(red_target3), -1, 1), nil, true)
end

function red_arty4()
 local red_target4 = Util_GetPosition(Marker_FromName("red"..World_GetRand(7, 9), "red_marker"))
 local arty_bling = red_target4

 UI_CreateMinimapBlip(arty_bling, 24, BT_AttackHerePing)
 Cmd_Ability(player6, ABILITY.COMMANDER_TREE.ALLIES.HOWITZER_ SHOOT, Util_GetRandomOffset(Util_GetPosition(red_target4), -1, 1), nil, true)
PrintOnScreen_RemoveFromScreen( )
end

^^^ I think this should be without the music in it. although i think the coordinates will prolly be off for arnham. If that's the map with the bridge...can you make it so that you can pass under the bridge?
Logged
salan Offline
Synergies TL2 mod!
*
Posts: 6290


« Reply #7 on: February 21, 2009, 08:49:12 pm »

I was thinking of erasing the bridge tbh, making it broken right at the base so you can get around the north end of it.

it limits the map to much being there.
Logged
Tymathee Offline
Donator
*
Posts: 9741



« Reply #8 on: February 21, 2009, 09:16:01 pm »

definiately. i just played it a while ago and i spawned on that side of the map omg it was so annoying
Logged
Kolath Offline
Commander, 2nd Infantry Division
*
Posts: 2382



« Reply #9 on: February 23, 2009, 10:04:58 am »

I got the that artillery script workin on 8p_lengfeld by copy pasting the SCAR and adding the requisite markers.  You add SCAR markers in the worldbuilder by clicking the little red flag icon.  Make sure you select the right colors and that you rename the markers to match what is in the script (or vice versa).

If anyone could explain how to add more shots of artillery to the script, I would really appreciate it.  As all the things I tried caused fatal scar errors.
Logged

Kolath's Quote Commandments:
1. Thou shalt not quote the entirety of a post 3 or less posts above you
2. Thou shalt not quote more than 2 nested levels
3. Thou shalt not quote large blocks of text when one sentence would do
4. Thou shalt not quote images!
Unkn0wn Offline
No longer retired
*
Posts: 18378


« Reply #10 on: February 23, 2009, 10:06:19 am »

I heard we have the wrong version of lengfeld in?

In addition, I'd like to use airplanes passing by on maps like Arras, if anyone has an idea on how this could be done.
Logged
LeoPhone Offline
Honoured Member
*
Posts: 0


« Reply #11 on: February 23, 2009, 10:08:00 am »

planes passing by while game is going on, GOGO WIBLE blow the plane and crash it in those emplacements  Grin

to make it working, you just need to use recon runs and luft air arty strike that dont have an enemy
« Last Edit: February 23, 2009, 10:12:08 am by LeoPhone » Logged
Steinmarder Offline
EIR Veteran
Posts: 404


« Reply #12 on: February 26, 2009, 04:51:41 pm »

This is a pretty simple script I wrote myself for artillery incoming every 240 seconds, landing around 4
different markers with a random offset to the position every shot lands.

Can be done way shorter if you take other functions and some variables, but this should be good for
you to figur out how its done.

Note that the artillery belongs to the players 1 and 2 here, so its not optimal but enough for artillery in
the beginning (replace AddInterval with AddOneShot in line 12).

If you dont know how your markers are called, you can check for that in the mapname_ID.scar file.


Quote
import("ScarUtil.scar")
import("printonscreen.scar")

function OnGameSetup()

  player1 = World_GetPlayerAt(1)
  player2 = World_GetPlayerAt(2)
  player3 = World_GetPlayerAt(3)
  player4 = World_GetPlayerAt(4)
 

 Rule_AddInterval(artyshower,240)

  SINGLE_HOWITZER = BP_GetAbilityBlueprint("abilities/sp_single_howitzer.lua")

end

function OnInit()

end


function artyfire()
 
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_1, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_2, 40))
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_3, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_4, 40))
 
end

 function artyfire2()
 
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_1, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_2, 40))
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_3, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_4, 40))
 
 end

 function artyfire3()
 
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_1, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_2, 40))
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_3, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_4, 40))
 
 end

 function artyfire4()
 
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_1, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_2, 40))
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_3, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_4, 40))
 
 end

function artyfire5()
 
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_1, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_2, 40))
   Cmd_Ability(player1, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_3, 40))
   Cmd_Ability(player2, SINGLE_HOWITZER,  Util_GetRandomPosition(mkr_4, 40))
 
end

function artyshower()

 PrintOnScreen("WARNING, ARTILLERY INCOMING!!")

 UI_CreateMinimapBlip(mkr_1, 8, BT_CombatPing)
 UI_CreateMinimapBlip(mkr_2, 8, BT_CombatPing)
 UI_CreateMinimapBlip(mkr_3, 8, BT_CombatPing)
 UI_CreateMinimapBlip(mkr_4, 8, BT_CombatPing)

 Rule_AddOneShot(artyfire,5)
 Rule_AddOneShot(artyfire2,7)
 Rule_AddOneShot(artyfire3,9)
 Rule_AddOneShot(artyfire4,11)
 Rule_AddOneShot(artyfire5,13)

 Rule_AddOneShot(PrintOnScreen_RemoveFromScreen, 15)

end
Logged

Klagt nicht, kämpft!
Pages: [1]   Go Up
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!
Page created in 0.098 seconds with 36 queries.