.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #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
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 04:36 PM.


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