Linking "ambush" function to weapons

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

Post Reply
somen00b

Linking "ambush" function to weapons

Post by somen00b »

Can it be done? I would like it for my 2nd map
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:

RE: Linking "ambush" function to weapons

Post by [RDH]Zerted »

What do you mean? Every time a weapon is fired, an ambush occurs? Something like a detpack, but instead of exploding it releases units?

Keep in mind we only know how to spawn units on paths. We don't know how to create paths ingame (may be possible, but not yet attempted), so the location of any units spawning has to be defined in ZeroEdit (or by editing the world text files before munging).
somen00b

Post by somen00b »

What I idealy want is every time you fire a certain weapon it triggers preset ambushes, I am following the heros spawning troops thread. I want something like

onweaponfire (all_inf_ghost_caller)
ambush (ambush function stuff here)

if you can manage it, a team filter so an ambush only occurs if the empire owns a certain cp
something like

onweaponfire (all_inf_ghost_caller)
if cp10team=IMP then
ambush (ambush function stuff here)

though it's icing on the cake and I might not include it
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 »

Yes thats possible. There is no OnWeaponFire. Instead you can use CharacterDispenseControllable. When a player fires (drops) this weapon, you can do anything in the event response that you can normally do in the Lua.
xwingguy

Post by xwingguy »

you can also use OnCharacterDispensePowerup
somen00b

Post by somen00b »

could you write that out in copy and pasteable format? I know no lua :oops:
Post Reply