Page 1 of 1

Unit dispenser?

Posted: Fri Apr 08, 2011 10:04 pm
by Dakota
ok i have still been working on my mod and i wanted a dispenser that will dispense a unit that i made, a mini acklay (0.25 size) i already have the unit but my attempts to use an auto turret dispenser to dispense them has failed miserably (once it actually restarted my whole computer :cpu: ). i know this had been done before (in magic weapons mod) i just have no idea how to get this working. i just want to be able to let gizor delso call forth an army of baby acklays to chew apart my enemies :runaway: MHUHAHAHAH... um i mean just help please

Re: unit dispenser?

Posted: Fri Apr 08, 2011 10:15 pm
by AQT

Re: unit dispenser?

Posted: Fri Apr 08, 2011 10:22 pm
by Dakota
i knew i have seen this some where else before :D thanks for finding me the link again i'll go modify some thing and come back with resaults.

Re: unit dispenser?

Posted: Fri Apr 08, 2011 10:29 pm
by AQT
Dakota wrote:thanks for finding me the link again
No problem, but the point was you should look in the The FAQ / Everything You Need Thread A LOT more often.

Re: unit dispenser?

Posted: Fri Apr 08, 2011 10:47 pm
by Dakota
i know i have been directed there all day today. wow i have been using just the search feature, i think i'll go with the thread from now on...

EDIT: ok i have been testing and i can't seem to get it just right. i have the codes in place and the weapons and it doesn't crash but no units will spawn from my team that i made for it i will now post the luas

LUA
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

-- REP Attacking (attacker is always #1)
si1 = 1;
si2 = 2;
-- These variables do not change
ATT = si1;
DEF = si2;


function ScriptPostLoad(AddAIGoal(5, "Deathmatch", 1000)

TroopSpawnerWeapon = "cis_weap_inf_thermaldetonator_ord"

OnCharacterDispenseControllableTeam(
function(character,controlled)
if GetEntityClass(controlled) == GetEntityClassPtr(TroopSpawnerWeapon) then
local SupportTeam = 5 --Team the new spawned character is in (change this)
local teamSize = GetTeamSize(SupportTeam)
for i = 0, teamSize-1 do
local characterIndex = GetTeamMember(SupportTeam, i)
local charUnit = GetCharacterUnit(characterIndex)
if not charUnit then
local destination = GetEntityMatrix(GetCharacterUnit(character))
SpawnCharacter(characterIndex,destination)
end
end
end
end,
SI2 --User team (change this)
)
)

SetUberMode(1);


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)

conquest:Start()

EnableSPHeroRules()

end


---------------------------------------------------------------------------
-- 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 ScriptInit()

ReadDataFile("ingame.lvl")


SetMaxFlyHeight(30)
SetMaxPlayerFlyHeight (30)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc:SIDE\\si1.lvl",
--"rep_bldg_forwardcenter",
"rep_fly_assault_dome",
--"rep_fly_gunship",
"rep_fly_gunship_dome",
"rep_fly_jedifighter_dome",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_jettrooper",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_engineer",
"rep_hero_macewindu",
"rep_walk_atte")

ReadDataFile("dc:SIDE\\si2.lvl",
--"cis_fly_geofighter",
"cis_hero_countdooku",
"gen_inf_geonosian",
"geo_inf_agro_geonosian",
"geo_inf_acklay",
"gen_inf_geonosian2",
"gen_inf_geonosian3",
"gen_inf_geonosian4",
"gen_inf_geonosian5",
"cis_inf_rifleman")
ReadDataFile("SIDE\\geo.lvl",
"gen_inf_geonosian")

ReadDataFile("dc:SIDE\\ACK.lvl",
"geo_inf_acklay2")

ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_geoturret")


SetupTeams{

si1 = {
team = si1,
units = 50,
reinforcements = 500,
soldier = { "rep_inf_ep3_rifleman",100, 250},
assault = { "rep_inf_ep3_rocketeer",10, 40},
engineer = { "rep_inf_ep3_engineer",10, 40},
sniper = { "rep_inf_ep3_sniper",10, 40},
officer = {"rep_inf_ep3_officer",10, 40},
special = { "rep_inf_ep3_jettrooper",10, 40},

},
si2 = {
team = si2,
units = 50,
reinforcements = 250,
soldier = { "gen_inf_geonosian",30, 60},
assault = { "gen_inf_geonosian2",30, 60},
engineer = { "gen_inf_geonosian3",30, 60},
sniper = { "gen_inf_geonosian4",30, 60},
officer = {"gen_inf_geonosian5",30, 60},
special = { "geo_inf_agro_geonosian",20, 40},
}
}

SetHeroClass(si1, "rep_hero_macewindu")
SetHeroClass(si2, "")

AddUnitClass(si2, "cis_inf_rifleman",10,20)
AddUnitClass(si2, "geo_inf_acklay",10,20)
AddUnitClass(si2, "gen_inf_geonosian",30,60)
AddUnitClass(si2, "gen_inf_geonosian2",30,60)
AddUnitClass(si2, "gen_inf_geonosian3",30,60)
AddUnitClass(si2, "gen_inf_geonosian4",30,60)
AddUnitClass(si2, "gen_inf_geonosian5",30,60)

-- Attacker Stats

--teamATT = ConquestTeam:New{team = ATT}
--teamATT:AddBleedThreshold(21, 0.75)
--teamATT:AddBleedThreshold(11, 2.25)
--teamATT:AddBleedThreshold(1, 3.0)
--teamATT:Init()
SetTeamAsEnemy(ATT,5)
SetTeamAsEnemy(5,ATT)

-- Defender Stats

--teamDEF = ConquestTeam:New{team = DEF}
--teamDEF:AddBleedThreshold(21, 0.75)
--teamDEF:AddBleedThreshold(11, 2.25)
--teamDEF:AddBleedThreshold(1, 3.0)
--teamDEF:Init()
SetTeamAsFriend(DEF,5)

-- Local Stats
SetTeamName(5, "locals")
SetUnitCount(10, 10)
AddUnitClass(10, "geo_inf_acklay2", 10)
SetTeamAsFriend(5, DEF)
--SetTeamName(4, "Acklay")
--AddUnitClass(4, "rep_inf_jedimale",1)
--AddUnitClass(4, "rep_inf_jedimaleb",1)
--AddUnitClass(4, "rep_inf_jedimaley",1)
--SetUnitCount(4, 3)
--SetTeamAsFriend(4, ATT)


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:SMM\\SMM.lvl", "SMM_conquest")
ReadDataFile("dc:SMM\\SMM.lvl", "SMM_conquest")
SetDenseEnvironment("false")




-- Sound

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)

SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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")


--OpeningSateliteShot
AddCameraShot(0.908386, -0.209095, -0.352873, -0.081226, -45.922508, -19.114113, 77.022636);

AddCameraShot(-0.481173, 0.024248, -0.875181, -0.044103, 14.767292, -30.602322, -144.506851);
AddCameraShot(0.999914, -0.012495, -0.004416, -0.000055, 1.143253, -33.602314, -76.884430);
AddCameraShot(0.839161, 0.012048, -0.543698, 0.007806, 19.152437, -49.802273, 24.337317);
AddCameraShot(0.467324, 0.006709, -0.883972, 0.012691, 11.825212, -49.802273, -7.000720);
AddCameraShot(0.861797, 0.001786, -0.507253, 0.001051, -11.986043, -59.702248, 23.263165);
AddCameraShot(0.628546, -0.042609, -0.774831, -0.052525, 20.429928, -48.302277, 9.771714);
AddCameraShot(0.765213, -0.051873, 0.640215, 0.043400, 57.692474, -48.302277, 16.540724);
AddCameraShot(0.264032, -0.015285, -0.962782, -0.055734, -16.681797, -42.902290, 129.553268);
AddCameraShot(-0.382320, 0.022132, -0.922222, -0.053386, 20.670977, -42.902290, 135.513001);
end
weapon
odf
Hidden/Spoiler:
[WeaponClass]
ClassLabel = "grenade"

[Properties]
GeometryName = "com_weap_inf_grenadethermal"
HighResGeometry = "com_1st_weap_inf_grenadethermal"

OffhandWeapon = 1

//***********************************************
//************* TARGET & RANGE VALUES **********
//***********************************************

TargetEnemy = "1"
TargetNeutral = "0"
TargetFriendly = "0"

TargetPerson = "1"
TargetAnimal = "1"
TargetDroid = "1"
TargetVehicle = "0"
TargetBuilding = "0"

MinRange = "0"
OptimalRange = "0"
MaxRange = "0"

LockOnRange = "30.0"

//***********************************************
//*********** WEAPON PERFORMANCE VALUES *********
//***********************************************

RoundsPerClip = "0"
ReloadTime = "0.0"
ShotDelay = "0.1"
ShotElevate = "0.0"
MaxPressedTime = "0.0"

InitialSalvoDelay = "0.51"

//***********************************************
//*********** HUD & CONTROLLER VALUES *********
//***********************************************

ChargeRateLight = "1.0"
MaxChargeStrengthLight = "1.0"
ChargeDelayLight = "0.0"
ChargeRateHeavy = "1.0"
MaxChargeStrengthHeavy = "0.25"
ChargeDelayHeavy = "1.45"

RecoilLengthLight = "0.1"
RecoilLengthHeavy = "0.1"
RecoilStrengthLight = "0"
RecoilStrengthHeavy = "0"


//************************************************
//******************* SOUND *****************
//************************************************

FireSound = "com_weap_throw"
FireEmptySound = "com_weap_inf_ammo_empty"
ORD
Hidden/Spoiler:
[OrdnanceClass]
ClassLabel = "bolt"

[Properties]
LaserTexture = "com_sfx_laser_red"
LaserGlowColor = "253 43 43 100"
LightColor = "253 43 43 150"
LightRadius = "4.0"

LaserLength = "0.0"
LaserWidth = "0.0"
GlowLength = "0"
BlurLength = "0"

LifeSpan = "0.80"
Velocity = "5.0"
Gravity = "0.0"
Rebound = "0.0"

MaxDamage = "0.0"
DamageTransitionDelay = "0.2" //How long in seconds before the damage change begins.
DamageTransitionPeriod = "0.1" //How long in seconds the damage change lasts.
DamageFinalDamage = "0.0" //What the damage would be at the end of the transition period. A negative value means that no change is applied.
FadeLightColor = "1" //Whether or not the color on the light should be faded along with the damage.
EndLaserGlowColor = "160 43 43 100" //What color the laser glow will be by the end of the transition. Varies over DamageTransitionPeriod. (only for lasers.)
EndLightColor = "160 43 43 150" //What color light will be applied by the end of the transition. Varies over DamageTransitionPeriod.

ImpactEffectWater = "com_sfx_watersplash_sm"
ImpactEffect = "com_sfx_explosion_lg"

StickPerson = 0
StickAnimal = 0
StickDroid = 0
StickVehicle = 0
StickBuilding = 0
StickBuildingDead = 0
StickBuildingUnbuilt= 0
StickTerrain = 1
EXP
Hidden/Spoiler:
[ExplosionClass]
ClassLabel = "explosion"

[Properties]
Damage = "0.0"
DamageRadiusInner = "0.0"
DamageRadiusOuter = "0.0"

Push = "0.0"
PushRadiusInner = "0.0"
PushRadiusOuter = "0.0"

Shake = "0.0"
ShakeLength = "0.0"
ShakeRadiusInner = "0.0"
ShakeRadiusOuter = "0.0"

VehicleScale = "1.0"
PersonScale = "1.0"
DroidScale = "1.0"
BuildingScale = "1.0"
AnimalScale = "1.0"

SoundProperty = ""
//WaterExplosion = "com_weap_obj_med_water_exp"

Re: Unit dispenser?

Posted: Sat Apr 09, 2011 5:44 am
by DarthD.U.C.K.
it doesnt work because you skipped the first instruction at the top of the code completely. you have to create a team of which the units are spawned.
so:
archer01 wrote: -- Setup the team that will spawn in ScriptInit(), include the SetTeamAsFriend() stuff
it should look like this, i suppose

Code: Select all

    SetupTeams{ 
        all = {
            team = SupportTeam,
            units = 8, --Teamsize
            reinforcements = -1,
            soldier  = { "gar_inf_temple_soldier",6, 8},            
        }
    }
	
	SetTeamAsEnemy(SI1, 5)
    SetTeamAsEnemy(5, SI1)
	SetTeamAsFriend(SI2, 5)
    SetTeamAsFriend(5, SI2)
additionally, the aigoal for team 5 shouldnt be in the brackets of scriptpostload, it should be below it

next time, when you have a scripting problem you should make a bfront2log and check it for errors.

Re: Unit dispenser?

Posted: Sat Apr 09, 2011 9:00 am
by Dakota
@DarthD.U.C.K.
thanks for the help, i had already made the team but i am an extremly bad coder, also i did check my munge log but it just said that an `)' was expected near `(' so i didn't reallt know what to do and my error log didn't say a thing about it... anyway thanks alot for the help i will go test and come back with some resaults

ok i have been doing more testing and still can't get it working i get the FATAL error saying that the game can't load the .LVL and my munger says that it has an error reading the script

LUA
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

-- REP Attacking (attacker is always #1)
si1 = 1;
si2 = 2;
-- These variables do not change
ATT = si1;
DEF = si2;


function ScriptPostLoad(TroopSpawnerWeapon = "cis_weap_inf_thermaldetonator_ord"

OnCharacterDispenseControllableTeam(function(character,controlled)
if GetEntityClass(controlled) == GetEntityClassPtr(TroopSpawnerWeapon) then
local SupportTeam = 5 --Team the new spawned character is in (change this)
local teamSize = GetTeamSize(SupportTeam)
for i = 0, teamSize-1 do
local characterIndex = GetTeamMember(SupportTeam, i)
local charUnit = GetCharacterUnit(characterIndex)
if not charUnit then
local destination = GetEntityMatrix(GetCharacterUnit(character))
SpawnCharacter(characterIndex,destination)
end
end
end
end,
SI2 --User team (change this)
)
)

AddAIGoal(5, "Deathmatch", 1000)

SetUberMode(1);


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)

conquest:Start()

EnableSPHeroRules()

end


---------------------------------------------------------------------------
-- 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 ScriptInit()

ReadDataFile("ingame.lvl")


SetMaxFlyHeight(30)
SetMaxPlayerFlyHeight (30)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc:SIDE\\si1.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_bobafett" )

ReadDataFile("dc:SIDE\\si2.lvl",
--"cis_fly_geofighter",
"cis_hero_countdooku",
"gen_inf_geonosian",
"geo_inf_agro_geonosian",
"geo_inf_acklay",
"gen_inf_geonosian2",
"gen_inf_geonosian3",
"gen_inf_geonosian4",
"gen_inf_geonosian5",
"cis_inf_rifleman")
ReadDataFile("SIDE\\geo.lvl",
"gen_inf_geonosian")

ReadDataFile("dc:SIDE\\ACK.lvl",
"geo_inf_acklay2")




ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_geoturret")


SetupTeams{

si1 = {
team = si1,
units = 50,
reinforcements = 500,
soldier = { "imp_inf_rifleman",100, 250},
assault = { "imp_inf_rocketeer",10, 40},
engineer = { "imp_inf_engineer",10, 40},
sniper = { "imp_inf_sniper",10, 40},
officer = {"imp_inf_officer",10, 40},
special = { "imp_inf_dark_trooper",10, 40},

},
si2 = {
team = si2,
units = 50,
reinforcements = 250,
soldier = { "gen_inf_geonosian",30, 60},
assault = { "gen_inf_geonosian2",30, 60},
engineer = { "gen_inf_geonosian3",30, 60},
sniper = { "gen_inf_geonosian4",30, 60},
officer = {"gen_inf_geonosian5",30, 60},
special = { "geo_inf_acklay2",20, 40},
}
}

SetHeroClass(si1, "")
SetHeroClass(si2, "geo_inf_agro_geonosian")

AddUnitClass(si2, "cis_inf_rifleman",10,20)
AddUnitClass(si2, "geo_inf_acklay",10,20)
AddUnitClass(si2, "gen_inf_geonosian",30,60)
AddUnitClass(si2, "gen_inf_geonosian2",30,60)
AddUnitClass(si2, "gen_inf_geonosian3",30,60)
AddUnitClass(si2, "gen_inf_geonosian4",30,60)
AddUnitClass(si2, "gen_inf_geonosian5",30,60)
AddUnitClass(si1, "imp_inf_dark_trooper",20,60)

SetTeamAsEnemy(SI1, 5)
SetTeamAsEnemy(5, SI1)
SetTeamAsFriend(SI2, 5)
SetTeamAsFriend(5, SI2)

-- Attacker Stats

--teamATT = ConquestTeam:New{team = ATT}
--teamATT:AddBleedThreshold(21, 0.75)
--teamATT:AddBleedThreshold(11, 2.25)
--teamATT:AddBleedThreshold(1, 3.0)
--teamATT:Init()
SetTeamAsEnemy(ATT,5)
SetTeamAsEnemy(5,ATT)

-- Defender Stats

--teamDEF = ConquestTeam:New{team = DEF}
--teamDEF:AddBleedThreshold(21, 0.75)
--teamDEF:AddBleedThreshold(11, 2.25)
--teamDEF:AddBleedThreshold(1, 3.0)
--teamDEF:Init()
SetTeamAsFriend(DEF,5)

-- Local Stats
SetTeamName(5, "locals")
SetUnitCount(10, 10)
AddUnitClass(10, "geo_inf_acklay2", 10)
SetTeamAsFriend(5, DEF)
--SetTeamName(4, "Acklay")
--AddUnitClass(4, "rep_inf_jedimale",1)
--AddUnitClass(4, "rep_inf_jedimaleb",1)
--AddUnitClass(4, "rep_inf_jedimaley",1)
--SetUnitCount(4, 3)
--SetTeamAsFriend(4, ATT)


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:SMM\\SMM.lvl", "SMM_conquest")
ReadDataFile("dc:SMM\\SMM.lvl", "SMM_conquest")
SetDenseEnvironment("false")




-- Sound

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)

SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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")


--OpeningSateliteShot
AddCameraShot(0.908386, -0.209095, -0.352873, -0.081226, -45.922508, -19.114113, 77.022636);

AddCameraShot(-0.481173, 0.024248, -0.875181, -0.044103, 14.767292, -30.602322, -144.506851);
AddCameraShot(0.999914, -0.012495, -0.004416, -0.000055, 1.143253, -33.602314, -76.884430);
AddCameraShot(0.839161, 0.012048, -0.543698, 0.007806, 19.152437, -49.802273, 24.337317);
AddCameraShot(0.467324, 0.006709, -0.883972, 0.012691, 11.825212, -49.802273, -7.000720);
AddCameraShot(0.861797, 0.001786, -0.507253, 0.001051, -11.986043, -59.702248, 23.263165);
AddCameraShot(0.628546, -0.042609, -0.774831, -0.052525, 20.429928, -48.302277, 9.771714);
AddCameraShot(0.765213, -0.051873, 0.640215, 0.043400, 57.692474, -48.302277, 16.540724);
AddCameraShot(0.264032, -0.015285, -0.962782, -0.055734, -16.681797, -42.902290, 129.553268);
AddCameraShot(-0.382320, 0.022132, -0.922222, -0.053386, 20.670977, -42.902290, 135.513001);
end

Re: Unit dispenser?

Posted: Sat Apr 09, 2011 2:06 pm
by AceMastermind
Dakota wrote:...i did check my munge log but it just said that an `)' was expected near `(' so i didn't reallt know what to do and my error log didn't say a thing about it... anyway thanks alot for the help i will go test and come back with some resaults
You have a munge error, your map is broken and therefore no need to play it, you must fix the errors first.


Without knowing exactly what the error was in your munge log since you didn't completely post it, this jumps out when viewed in Notepad++
Dakota wrote: LUA
Hidden/Spoiler:
function ScriptPostLoad(TroopSpawnerWeapon = "cis_weap_inf_thermaldetonator_ord"

OnCharacterDispenseControllableTeam(function(character,controlled)
if GetEntityClass(controlled) == GetEntityClassPtr(TroopSpawnerWeapon) then
local SupportTeam = 5 --Team the new spawned character is in (change this)
local teamSize = GetTeamSize(SupportTeam)
for i = 0, teamSize-1 do
local characterIndex = GetTeamMember(SupportTeam, i)
local charUnit = GetCharacterUnit(characterIndex)
if not charUnit then
local destination = GetEntityMatrix(GetCharacterUnit(character))
SpawnCharacter(characterIndex,destination)
end
end
end
end,
SI2 --User team (change this)
)
)
and should be:

Code: Select all

function ScriptPostLoad()

TroopSpawnerWeapon = "cis_weap_inf_thermaldetonator_ord"

OnCharacterDispenseControllableTeam(function(character,controlled)
if GetEntityClass(controlled) == GetEntityClassPtr(TroopSpawnerWeapon) then
local SupportTeam = 5 --Team the new spawned character is in (change this)
local teamSize = GetTeamSize(SupportTeam)
for i = 0, teamSize-1 do
local characterIndex = GetTeamMember(SupportTeam, i)
local charUnit = GetCharacterUnit(characterIndex)
if not charUnit then
local destination = GetEntityMatrix(GetCharacterUnit(character))
SpawnCharacter(characterIndex,destination)
end
end
end
end,
SI2 --User team (change this)
) 

Use a proper code editor if you're going to edit scripts and please read and follow tutorials carefully.

Re: Unit dispenser?

Posted: Sat Apr 09, 2011 2:58 pm
by Dakota
i don't have a tutorail and i really really need one i have just been going around the site with the all you need to know thread and the search but thanks for the help.

also i don't have a code editor, can someone please tell me where i can get one, i really need it.

Re: Unit dispenser?

Posted: Sat Apr 09, 2011 3:15 pm
by AceMastermind
You aren't paying attention to what was posted. I gave you a keyword for the code editor- Notepad++ , now run with it :google: or look in the Everything You Need Thread, there you will find links to 3 very good free code editors listed.
When I spoke of tutorials(or any instruction) I meant in general, you seem to follow only the parts you want then expect things to work, you need to follow them completely and pay attention to what you're doing, crashing maps are caused by user error.

Re: Unit dispenser?

Posted: Sat Apr 09, 2011 4:04 pm
by Dakota
i thought when you said Notepad++ i thought you were just talking about notepad :shock:

i'll go work some more and figure some things out bye for now