(FAQ) More ideas for heroes spawning troops (never give up!)

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Big_rich

Post by Big_rich »

rememebr you also need memorypools set for commandwalker or nothing is gonna happen. I mean have you auctually tried setting ClassLabel ="CommandSoldier", then setting a memory pool in lua for it? You would also have to add these lines in the odf which creates an artifical spawn path:

Code: Select all

SpawnPointCount 		= "6"
SpawnPointLocation 		= "8.0 0.0 0.0 5"
SpawnPointLocation 		= "8.0 0.0 4.0 5"
SpawnPointLocation 		= "8.0 0.0 -4.0 5"
SpawnPointLocation 		= "-8.0 0.0 0.0 355"
SpawnPointLocation 		= "-8.0 0.0 4.0 355"
SpawnPointLocation 		= "-8.0 0.0 -4.0 355"
ValueBleed			= 10
Value_ATK_Alliance 		= 10
Value_ATK_CIS 			= 10
Value_ATK_Empire 		= 10
Value_ATK_Republic 		= 10
Value_ATK_Locals 		= 0
Value_DEF_Alliance 		= 0
Value_DEF_CIS 			= 0
Value_DEF_Empire 		= 0
Value_DEF_Republic 		= 0
Value_DEF_Locals 		= 0
Qdin
Old School Staff
Posts: 2059
Joined: Wed Feb 23, 2005 9:54 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Qdin »

Can you make something, so it adds to a value as long as something is created? :P
And what happens if you have more memorypools than needed?
somen00b

Post by somen00b »

In my tests with weapon ODFs anything that I created with a "dispenser" weapon (failed self piloted vehicles for instance) was on the same team as me. Can you change that in with fancy LUA scripting? I would try setting the powerup dispenser's ordinance to "rep_walk_atte" and see if the created atte works properly. Also, can you asign a unit a goal to kill people via the LUA when it spawns? (again, not my kind of modding) I would like this for my "Magic" mod so I can have a summoner weapon. I would do the test myself but I am in the middle of working on a project
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Post by [RDH]Zerted »

I assume having more memory pools means the game will be taking up more memory than needed. This could cause problems on PCs at the lower end of the required specs.

There is an old topic with a list of contact info. My XFire name is in there. If you don't want to spend time searching, its zerted.
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Post by jangoisbaddest »

An intersting idea, though - once you dispense an actual "soldier", just tell the LUA to add an AI Goal. Isn't that possible? Maybe you can only do this for a certain team, in which case you can somply create a local team, allied with the hero's team, and have the units spawned from him on the locals' team; or, since it's pretty much the same goals everyone else is using, you could spawn him on the same team and add those goals to the team again, and it wouldn't affect the other bots, right? Maybe I'm completely off lol
somen00b

Post by somen00b »

You could probably change the instance properties (see rep_bldg_forwardcenter.odf) to make a command post on a certain team. However, the AI wont spawn at the post I think that is because it hasn't been defined in the .lua.
Could you define a comand post name for a local team then spawn it with a dispenser, using ally count to pervent all the alloted AI from spawning at once. Maybe they would just sit there, maybe not.
It would be far fetched but could you use instance properties to set all the required info to make a unit act normally?
Also, how does vehicle path data work? It might be easier to exploit vehicle path data and get the desired effect. only with vehicles
-_-
Gametoast Staff
Gametoast Staff
Posts: 2678
Joined: Sat May 07, 2005 1:22 pm

Post by -_- »

somen00b wrote:You could probably change the instance properties (see rep_bldg_forwardcenter.odf) to make a command post on a certain team. However, the AI wont spawn at the post I think that is because it hasn't been defined in the .lua.
Could you define a comand post name for a local team then spawn it with a dispenser, using ally count to pervent all the alloted AI from spawning at once. Maybe they would just sit there, maybe not.
It would be far fetched but could you use instance properties to set all the required info to make a unit act normally?
Also, how does vehicle path data work? It might be easier to exploit vehicle path data and get the desired effect. only with vehicles
What you said did not make sense whatsoever.
somen00b

Post by somen00b »

The file is in the rep side ODF's
For ease of explaining I will post it
Hidden/Spoiler:
[quote]
[GameObjectClass]

ClassLabel = "commandpost"
GeometryName = "rep_bldg_forwardcenter.msh"


[Properties]

DenyFlyerLand = "1"
SwitchClassRadius = 15.0

BUILDINGSECTION = "BODY"
Label = "Control Zone"
MapTexture = "hud_dest_icon"
MapScale = 3.0
HealthTexture = "HUD_rep_forward_comm_icon"

GeometryName = "rep_bldg_forwardcenter"
DestroyedGeometryName = "rep_bldg_forwardcenter_dest"
MaxHealth = "30000.0"

ExplosionDestruct = "rep_bldg_forwardcenter_exp"

\\ ---------COLLISION-----------

VehicleCollision = "p_vehiclecylinder1"
VehicleCollision = "p_vehiclecylinder2"

SoldierCollision = "CollisionMesh"
OrdnanceCollision = "CollisionMesh"

CHUNKSECTION = "CHUNK1"
ChunkGeometryName = "rep_bldg_forwardcenter_chunk1"
ChunkNodeName = ""
ChunkTerrainCollisions = "0"
ChunkTerrainEffect = "com_sfx_explosion_lg"
ChunkTrailEffect = "com_sfx_chunktrail_sm"
ChunkPhysics = "FULL"
ChunkOmega = "2.0 2.0 2.0"
ChunkSpeed = "12.0"
ChunkUpFactor = "4.00"

[InstanceProperties]
CaptureRegion = ""
ControlRegion = ""
KillRegion = ""
SpawnPath = ""
AllyPath = ""
AllyCount = 65536
Radius = 0.0
ValueBleed = 10
Value_ATK_Alliance = 10
Value_ATK_CIS = 10
Value_ATK_Empire = 10
Value_ATK_Republic = 10
Value_DEF_Alliance = 10
Value_DEF_CIS = 10
Value_DEF_Empire = 10
Value_DEF_Republic = 10
Value_DEF_Locals = 10
HUDIndexDisplay = 1
VO_All_AllCapture = ""
VO_All_AllLost = ""
VO_All_AllInDispute = ""
VO_All_AllSaved = ""
VO_All_AllInfo = ""
VO_All_ImpCapture = ""
VO_All_ImpLost = ""
VO_All_ImpInDispute = ""
VO_All_ImpSaved = ""
VO_All_ImpInfo = ""
VO_Imp_AllCapture = ""
VO_Imp_AllLost = ""
VO_Imp_AllInDispute = ""
VO_Imp_AllSaved = ""
VO_Imp_AllInfo = ""
VO_Imp_ImpCapture = ""
VO_Imp_ImpLost = ""
VO_Imp_ImpInDispute = ""
VO_Imp_ImpSaved = ""
VO_Imp_ImpInfo = ""
VO_Rep_RepCapture = ""
VO_Rep_RepLost = ""
VO_Rep_RepInDispute = ""
VO_Rep_RepSaved = ""
VO_Rep_RepInfo = ""
VO_Rep_CISCapture = ""
VO_Rep_CISLost = ""
VO_Rep_CISInDispute = ""
VO_Rep_CISSaved = ""
VO_Rep_CISInfo = ""
VO_CIS_RepCapture = ""
VO_CIS_RepLost = ""
VO_CIS_RepInDispute = ""
VO_CIS_RepSaved = ""
VO_CIS_RepInfo = ""
VO_CIS_CISCapture = ""
VO_CIS_CISLost = ""
VO_CIS_CISInDispute = ""
VO_CIS_CISSaved = ""
VO_CIS_CISInfo = ""
Strategic_Filter1 = ""
Strategic_Filter2 = ""
Strategic_Filter3 = ""
Strategic_Filter4 = ""
Strategic_Filter5 = ""
Strategic_Filter6 = ""
SoldierBan = ""
HoverBan = ""
SmallBan = ""
MediumBan = ""
HugeBan = ""
FoleyFXGroup = "metal_foley"
[/quote]
Is it just me, or do the instance properties look like the stuff you set in ZE? or in the lua? That is what I am getting at. If you spawn this object with a dispenser it acts like a command post but the AI doesn't spawn at it. I thought that you might be able to use this to make a command post spawner. I think the AI attacks it? People can play around with this.


EDIT
Either My last post made no sense or noone wants to reply. A new idea is to link the AMBUSH() function to a weapon and in the same script, also teleport the spawned troops to your position. Or you could have a beacon that on it's creation the ambushers are spawned, and on it's destruction (lifetime runs out they are moved to your position Anyone think that they are up for it?


(Im going to try another method, I will edit this post if it works)
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Post by jangoisbaddest »

The only way that would work is if there is a teleport command that can be utilized in the LUA script (hopefully there is).

Also, forget about the command post buildings. They have the same properties as a regular CP platform, just with different geometry, so you still need spawn points refrenced to it the same way (boy I get tired of getting tossed back into square 1!)

Anyway, I hope it's possible to add AI goals with the LUA upon a condition, cause I think that's the only way we can go with this, really.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Post by [RDH]Zerted »

Sure, AI Goals are easy compared to force spawning units. Check the modding Wiki and lookup the AddAIGoal function.
somen00b

Post by somen00b »

If there was a way to uniquly identify units spawned with a dispenser (label?) then you could add goals as they spawn via the lua (as a test, try setting an add AI goal function on a trigger such as (on enter region) and see if it effects them. AI goals are usually added at the begining of the game, it might not work to add them in the middle. If you give me an example of a simple "on enter region" function I could do it myself, the ones in the game are too complex, I might try sticking it in a campain function but I wouldn't know if I did it right unless it was looked over by an expert. The final version would have to use an "on weapon fire" function, run constantly, or be triggered by comthing else common. if there is a simple 'run constantly" script then I would use that for a test

As for what jangoisbaddest said "position" with the set property function might work, it could be a seperate function that gets the position of an odf (beacon), and applies it to another unit's position, but set property, position might not work
Darth_Z13
Jedi High Council
Jedi High Council
Posts: 2275
Joined: Sat Jun 17, 2006 9:51 am
xbox live or psn: Xanthius Wylon
Location: Canada

Post by Darth_Z13 »

Ya somen00b I thought about that too (the dispenser idea) after you told me about the Xwing and tried it but it has to be a vehicle or else the game doesn't disply the unit with the dispenser.
somen00b

Post by somen00b »

I tried the AI goals function with a repeating timer, the timer went from one to zero and back constantly, I set it up to say "3 bookcases left" as part of the repeating function. It only did that twice when I thought it would do that over and over again, no errors of note in BFront2.txt. any advice on a reapeating function would be helpful

Incase I messed it up, here is my lua:
Hidden/Spoiler:
[quote]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

-- Empire Attacking (attacker is always #1)
ALL = 2
IMP = 1
-- These variables do not change
ATT = 1
DEF = 2


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------

function ScriptPostLoad()

AddDeathRegion("fall")
DisableBarriers("atat")
DisableBarriers("bombbar")

--CP SETUP for CONQUEST
-- SetProperty("shield", "MaxHealth", 222600.0)
-- SetProperty("shield", "CurHealth", 222600.0)
SetObjectTeam("CP3", 1)
SetObjectTeam("CP6", 1)
KillObject("CP7")

RespawnCount = CreateTimer("RespawnCount")
SetTimerValue(RespawnCount, 1.0)
StartTimer(RespawnCount)
ShowTimer(RespawnCount) --Optional, just makes sure that the timer is working
numDudesAlive = 5

OnTimerElapse(
function(timer)
if (numDudesAlive < 6) then
ClearAIGoals(ALL)
AddAIGoal( ALL, "Conquest", 100 );
ShowMessageText ("level.cor1.objectives.Campaign.bookcount.3", ATT)
--SetTimerValue(RespawnCount, 1.0)
--StartTimer(RespawnCount)
end
SetTimerValue(RespawnCount, 1.0)
StartTimer(RespawnCount)
end,
RespawnCount
)

EnableSPHeroRules()

cp1 = CommandPost:New{name = "CP3"}
cp2 = CommandPost:New{name = "CP4"}
cp3 = CommandPost:New{name = "CP5"}
cp4 = CommandPost:New{name = "CP6"}
-- cp5 = CommandPost:New{name = "CP7"}

conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, textATT = "game.modes.con", textDEF = "game.modes.con2", multiplayerRules = true}

conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
-- conquest:AddCommandPost(cp5)

conquest:Start()

-- KillObject("shield");

end

function ScriptInit()
if(ScriptCB_GetPlatform() == "PS2") then
StealArtistHeap(1024*1024) -- steal 1MB from art heap
end

-- Designers, these two lines *MUST* be first.
--SetPS2ModelMemory(4500000)
SetPS2ModelMemory(3300000)
ReadDataFile("ingame.lvl")

-- Empire Attacking (attacker is always #1)
--local ALL = 2
--local IMP = 1
-- These variables do not change
--local ATT = 1
--local DEF = 2

--SetAttackingTeam(ATT)


SetMaxFlyHeight(70)
SetMaxPlayerFlyHeight(70)
SetGroundFlyerMap(1);

ReadDataFile("sound\\hot.lvl;hot1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_fly_snowspeeder",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_engineer_snow",
"all_inf_sniper_snow",
"all_inf_officer_snow",
"all_hero_luke_pilot",
"all_inf_wookiee_snow",
"all_walk_tauntaun")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman_snow",
"imp_inf_rocketeer_snow",
"imp_inf_sniper_snow",
"imp_inf_dark_trooper",
"imp_inf_engineer_snow",
"imp_inf_officer",
"imp_hero_darthvader",
"imp_walk_atat",
"imp_walk_atst_snow")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_hoth_dishturret",
"tur_bldg_hoth_lasermortar")

SetupTeams{

all={
team = ALL,
units = 32,
reinforcements = 150,
soldier = {"all_inf_rifleman_snow",9, 25},
assault = {"all_inf_rocketeer_snow",1, 4},
engineer = {"all_inf_engineer_snow",1, 4},
sniper = {"all_inf_sniper_snow",1, 4},
officer = {"all_inf_officer_snow",1, 4},
special = {"all_inf_wookiee_snow",1, 4},

},

imp={
team = IMP,
units = 32,
reinforcements = 150,
soldier = {"imp_inf_rifleman_snow",9, 25},
assault = {"imp_inf_rocketeer_snow",1, 4},
engineer = {"imp_inf_engineer_snow",1, 4},
sniper = {"imp_inf_sniper_snow",1, 4},
officer = {"imp_inf_officer",1, 4},
special = {"imp_inf_dark_trooper",1, 4},
}
}


--Setting up Heros--

SetHeroClass(IMP, "imp_hero_darthvader")
SetHeroClass(ALL, "all_hero_luke_pilot")


-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- 0 droidekas
AddWalkerType(1, 5) -- 6 atsts with 1 leg pairs each
AddWalkerType(2, 2) -- 2 atats with 2 leg pairs each

local weaponCnt = 221
SetMemoryPoolSize("Aimer", 80)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 175)
SetMemoryPoolSize("CommandWalker", 2)
SetMemoryPoolSize("ConnectivityGraphFollower", 56)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 41)
SetMemoryPoolSize("EntityFlyer", 10)
SetMemoryPoolSize("EntityLight", 110)
SetMemoryPoolSize("EntitySoundStatic", 16)
SetMemoryPoolSize("EntitySoundStream", 5)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 54)
SetMemoryPoolSize("MountedTurret", 30)
SetMemoryPoolSize("Navigator", 63)
SetMemoryPoolSize("Obstacle", 400)
SetMemoryPoolSize("OrdnanceTowCable", 40) -- !!!! need +4 extra for wrapped/fallen cables !!!!
SetMemoryPoolSize("PathFollower", 63)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TreeGridStack", 300)
SetMemoryPoolSize("UnitController", 63)
SetMemoryPoolSize("UnitAgent", 63)
SetMemoryPoolSize("Weapon", weaponCnt)

ReadDataFile("HOT\\hot1.lvl", "hoth_conquest")
--ReadDataFile("tan\\tan1.lvl", "tan1_obj")
SetSpawnDelay(10.0, 0.25)
SetDenseEnvironment("false")
SetDefenderSnipeRange(170)
AddDeathRegion("Death")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .75, 1)
-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .5, 1)
-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .25, 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Allleaving")
SetOutOfBoundsVoiceOver(1, "Impleaving")

SetAmbientMusic(ALL, 1.0, "all_hot_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_hot_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_hot_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_hot_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_hot_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_hot_amb_end", 2,1)

SetVictoryMusic(ALL, "all_hot_amb_victory")
SetDefeatMusic (ALL, "all_hot_amb_defeat")
SetVictoryMusic(IMP, "imp_hot_amb_victory")
SetDefeatMusic (IMP, "imp_hot_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")


-- Camera Stats
--Hoth
--Hangar
AddCameraShot(0.944210, 0.065541, 0.321983, -0.022350, -500.489838, 0.797472, -68.773849)
--Shield Generator
AddCameraShot(0.371197, 0.008190, -0.928292, 0.020482, -473.384155, -17.880533, 132.126801)
--Battlefield
AddCameraShot(0.927083, 0.020456, -0.374206, 0.008257, -333.221558, 0.676043, -14.027348)


end[/quote]
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Post by [RDH]Zerted »

First, don't use 1.0, just use 1. Only integers (whole numbers: -2, -1, 0, 1, 2, 3, 4, 5, etc...) please.
Second, your timer is going too fast. A 1 second timer is really going to mess things up on a MP game.
If you are trying to determine when a team has less than 6 units alive, use OnCharacterDeath(). Count them as a unit dies, not every seond.

I don't see what this has to do with heros spawning troops.
Qdin
Old School Staff
Posts: 2059
Joined: Wed Feb 23, 2005 9:54 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Qdin »

it's not completely on-topic; I agree with you in that.. :?

But I think he's now finding a way to auto-spawn troops when the unit-count goes below a certain number..? :wink: It's an interesting branch to the topic :P
somen00b

Post by somen00b »

The idea is to constantly define the AI goals so units dispensed from a dispenser would have them too I am a n00b at lua so I copied the function at
http://www.gametoast.com/forums/viewtopic.php?t=6132
by xwingguy to try to have a reapeating or constantly active function though "on class creation" or "on (dispenser)weapon fire with delay" would work to.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Post by [RDH]Zerted »

The AI goals are not an issue. AI goals are applied per team not per unit. You can't create new units, only spawn dead ones. The AI count can be increased, but thats still not creating new units. Ever notice the AI bot scores after a match? All the bots have scores even if the AI is only set to 5 units per team. It seems the game may cycle through them as they die.

The game can only handle a max of 20 AI goals, after that you get level 3 errors in the log with the possiblility of a crash.
somen00b

Post by somen00b »

How does AI spawning at a moble command post work? (i.e. moble command posts move around and the units spawned act like any other units which is different then path nodes.) If you can't use that to make the ai "alive" somehow, maybe you could spawn a vehicle spawn point, make it's team be a local side (setteam or something in the lua on the spawn point) that would instantly spawn a command walker as the AI on that team would have nowhere else to spawn they would spawn. When a timer goes of it disapears along with it's command vehicle (kill object?) (kill odf?) use "label" as a property or better yet "name" to ID it? I don't know lua so this might not work :oops:
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Post by jangoisbaddest »

Ok, I think I might have an idea, but it'll be a week before I have any meaningful time to try it out. What about a commandflyer with a plain ol porp msh (like a mine or something). You can set the pilottype to self, so no one will be able to enter it xD, and tell it not to target any kind of entity (ex. soldiers or vehicles). So it's just a little thing that doesn't move, and that would have a lifespan of, say, 10, so that you're not constantly adding new CPs till the game crashes xD. Whadayathink? Feasable?
archer01

Post by archer01 »

I know this thread isn't on the first page anymore, but I 'might' have something worth while to add, and it's only been 11 days...

I'll phrase it in the form of a question to psych0fred in hopes that if my solution is "flawed" he can correct me:

I've been teleporting units (including my own controlled unit) around the map (even right across it) by setting their matrix to that of a path point, and it seems to work just fine. But considering the way you described the "controllable" units, I was wondering if that could be doing somthing 'undesireable' in memory that might come back to bite me later?

Assuming there is nothing wrong with setting a matrix of a unit "on-the-fly" if you will, couldn't you spawn a character beside another character with the following code?:

Code: Select all

local HeroEntity = blah
local SomeUnspawnedCharacter = blah2
local destination = GetEntityMatrix(GetCharacterUnit(HeroEntity))
SpawnCharacter(SomeUnspawnedCharacter,destination)
The "HeroEntity" and "SomeUnspawnedCharacter" would just be the entity identifiers (example: the player in instant action is always entity zero).

Now mind you, I haven't actually tried 'spawning' a character in this way, but I HAVE teleported units using SetEntityMatrix(). I'll try to setup a proper test situation and try the code above to see if it works, but it might be a while before I get a chance to actually do so.

I would also like to try to see if I can get the CreateMatrix() function working. I'm guessing that will allow you to make a path point during runtime (but again, I don't know for sure).
Post Reply