Home Crush your enemies... and create an EMPIRE!!! Space Empires V -- BUY NOW!!!

User login

  • Create new account
  • Request new password

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • news aggregator

Search

Who's online

There are currently 3 users and 171 guests online.

Online users

  • Santiago
  • listerofsmeg
  • Orion Shadow

Languages

  • English English
  • French French

Browse archives

« October 2008  
Mo Tu We Th Fr Sa Su
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Home » news » forums » Support & Feedback » Scenarios & Mods » SE:V MODs

Find specific facility type on planet

Submitted by jacob4408 on Tue, 2007-05-01 15:38. SE:V MODs

I'm adding some counter-intelligence options under the Intelligence attacks and all is well except for the last one. I'm trying to, in effect, have your intel agents destroy an intelligence center of the target empire. My methodology is to
1) randomly loop through enemy empire planets
2) randomly loop through facilities on that planet
3) if facility == intel then kill it
4) exit function

Steps 1 and 2 are fine but once I have the list of facility ids on a planet, I don't know how to determine which facilities are intel centers. Is there a sys function that returns type of facility if supplied with facility_id? Is there a function to destroy a facility by id? Is there a better way to do this? So far what I have is....

function Execute_Intel_Counter_Terminate returns boolean
params
src_plr: long
trg_plr: long
vars
colony_list: longlist
fac_ids: longlist
fac_levs: longlist
cur_col: long
num_cols: long
ret_val: long
ret_bool: boolean
num_facs: long
cur_fac: long
begin

// build list of all enemy colonies
set ret_val := Sys_Get_List_Of_Players_Colonies(trg_plr,colony_list)

// loop through colonies looking for intel
set num_cols := colony_list.count()
if (num_cols > 0) then
loop
// get facility info for current colony
set cur_col := Sys_Get_Random_Long(1, num_cols)
set ret_bool := Sys_Get_Space_Object_Cargo_List_Of_Facilities(cur_col,fac_ids,fac_levs)

// loop through facilities for this colony looking for intel
for cur_fac := 1 to fac_ids.count() do
// determine type of facility
// if it's intel kill it and exit out
exitwhen (TRUE)

endfor

call colony_list.delete(cur_col)
set num_cols := colony_list.count()

exitwhen (num_cols

‹ Idea : how to make Troops useful Quick Question About targeting New UnitTypes ›
» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Mod Designer

Re: Find specific facility type on planet

Submitted by Gideon on Tue, 2007-05-01 20:31.

Here is what I have so far:

cargo_ammount: long
cargo_index: long
this_cargo_id: long
this_facility_id: long
planet_id: long
building_destroyed: boolean

set cargo_ammount := Sys_Get_Space_Object_Cargo_Item_Count(planet_id)

set cargo_index := 0

loop
set cargo_index := cargo_index + 1
set this_cargo_id := Sys_Get_Space_Object_Cargo_Item_ID(planet_id, cargo_index)
if Sys_Get_Space_Object_Cargo_Item_Type(planet_id, this_cargo_id) = CARGO_ITEM_TYPE_FACILITY then
set this_facility_id := Sys_Get_Space_Object_Cargo_Item_Facility_ID(planet_id, this_cargo_id)
if (this_facility_id = Sys_Get_Best_Facility_With_Ability(target_player, "Point Generation - Intelligence")) then
// --- Destroy the cargo object.
set building_destroyed := TRUE
endif
endif
exitwhen (cargo_index >= cargo_ammount) or (building_destroyed)
endloop

Now for the problem:

I cannot find any way to delete or damage any singular cargo item. The closest I can get is Sys_Space_Object_Scrap_Cargo, but this returns resources to the owning player. I guess the sabotuers could deliver the resources as an apology...

Other than this, we can destroy all cargo on an object at once, or inflict damage to a planet. Either of those options are not discriminating enough to let you destroy a specific object.

» login or register to post comments

Re: Find specific facility type on planet

Submitted by jacob4408 on Fri, 2007-05-04 11:29.

Hmm, well if I have to go with scrap then I can live with target player getting some resources back. I'd be surprised if intel agents could so thoroughly destroy a facility as to leave nothing useful. If nothing else, the target empire could recycle the metal from the building! I'll play around with it some more. Thanks.

» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Now on STEAM

Now on STEAM!Space Empires V via STEAMSpace Empires IV via STEAMSTEAM online by Valve Corporation

Popular content

Today's:

  • Balance Mod v1.15 Available!
  • Mod difficulties
  • I got a problem with alliances
  • Question
  • How do you make peace with people?

All time:

  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • Space Empires V
  • Gritty Galaxy Fleet Clash
  • Damn Dirty Bugs/Annoyances
  • Space Empires V: General Thoughts, Observations, and Suggestions

Last viewed:

  • Response To Message - problem
  • Help with dynamic crew requirements + Forcing AI to make use of Small Hull sizes
  • is there going to be any new versions?????????????
  • Ships fly through sphere and ring worlds
  • SE V: What is it?
(c) Strategy First, Inc. All rights reserved.