*

Account

Welcome, Guest. Please login or register.
Did you miss your activation email?
November 16, 2024, 03:07:00 pm

Login with username, password and session length

Resources

Recent posts

[November 01, 2024, 12:46:37 pm]

[October 05, 2024, 07:29:20 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 2 [3]   Go Down
  Print  
Author Topic: SCAR Controlled Map Events  (Read 13933 times)
0 Members and 1 Guest are viewing this topic.
Steinmarder Offline
EIR Veteran
Posts: 404


« Reply #40 on: May 02, 2008, 12:43:20 pm »

it seems all that code you had published cozmo has been changed since than.

anyways i dug out the stuff i needed from the lua files and i got artillery showers put together from single shots working now in a fine random area around the markers. Pitty that they need to be player controlled so the allies may get some strange kill values without fighting the units, or experience when the artillery gives the killshot  Undecided

I hope it works to display the messages with the rule_addoneshot command. That could do the trick but i still have to find the command for displaying any warning messages in vCoH.

As soon as im finished with this and have it working ill publish the code here, maybe someone could allready clean up the thread a bit so it stays/becomes a helpfull encyclopedia for SCAR commands.
Logged

Klagt nicht, kämpft!
Steinmarder Offline
EIR Veteran
Posts: 404


« Reply #41 on: May 02, 2008, 04:04:31 pm »

Working fine!

And here it is, if someones interested in checking it out:

 - Random artillery around 4 scar markers in a set intervall (firing 5 single howitzer shells on each)

 - Warning message displayed before the fire comes in.

 - MiniMap combat ping along with the warning on the scar marker positions (-> center of the barraged area)

[warning text is still a workaround though, as i didnt implement the actual EiR warnings, but it works the same way just another command]


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
Pages: 1 2 [3]   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.068 seconds with 35 queries.