.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   Mod Code snippet - War (http://forum.shrapnelgames.com/showthread.php?t=34960)

aegisx June 5th, 2007 09:54 AM

Mod Code snippet - War
 
Here is some code that will force an AI player to declare war on everyone they meet:

<font class="small">Code:</font><hr /><pre> set plr_count := Sys_Get_Number_Of_Players()
for plr_index := 1 to plr_count do

if (plr_index &lt;&gt; 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) &lt;&gt; 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 </pre><hr />


All times are GMT -4. The time now is 05:55 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.