View Single Post
  #1  
Old June 5th, 2007, 09:54 AM

aegisx aegisx is offline
Second Lieutenant
 
Join Date: Sep 2006
Posts: 482
Thanks: 0
Thanked 0 Times in 0 Posts
aegisx is on a distinguished road
Default Mod Code snippet - War

Here is some code that will force an AI player to declare war on everyone they meet:

Code:
  set plr_count := Sys_Get_Number_Of_Players()
for plr_index := 1 to plr_count do

if (plr_index <> sys_long_Player_ID) and (Sys_Empire_Politics_Is_Player_Known(sys_long_Play er_ID, plr_index)) and (Sys_Empire_Politics_Get_Status_With_Player(sys_lo ng_Player_ID, plr_index) <> POLITICAL_STATUS_TYPE_WAR) then
set new_msg_type := 0
set new_log_id := Sys_Empire_Politics_Create_Temporary_Message(sys_l ong_Player_ID)
call Sys_Empire_Politics_Set_Message_To_Empire(new_log_ id, plr_index)
set new_msg_type := POLITICS_MSG_DECLARE_WAR
call Sys_Empire_Politics_Set_Message_Type(new_log_id, new_msg_type)
call Sys_Empire_Politics_Set_Message_Text(new_log_id, "War!")
call Sys_Empire_Politics_Send_Message(new_log_id)
endif

endfor

Reply With Quote