This is a concept i came up with for battlefront II based on other games and i was wondering how far can i change the gameplay in a certain map im planning.
1. In SWBFII, picking up an ammo increases all weapons ammo. My question is how to make it possible to get specific ammo. For example, one ammo pack gives grenades while the other gives rifle ammo.
2. Units gain weapons by picking new ones up. Or unit touches item (like a def boost canister) that gives him the weapon as an award (except it does not replace anything and is not award. Therefore everyone starts with one weapon, preferably a pistol, andpeople must find weapons to gain an advantage.
First of all, I would like to know if its possible or is there a differnet way to do it, and lastly how i would be able to accomplish this in a map.
How to make 'ammo classes' and 'pick-up' weapons
Moderator: Moderators
-
Dabrowski
How to make 'ammo classes' and 'pick-up' weapons
See post 4.
Last edited by Dabrowski on Sun Aug 06, 2006 11:33 am, edited 6 times in total.
-
t551
- General

- Posts: 791
- Joined: Sat Jul 16, 2005 3:23 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
RE: 2 Questions regarding changing Map Gameplay
I don't think that the weapon pickup is possible, even using awards, because I believe that a unit can only have one award specified, and I think that the award system is handled by the .exe itself. The same goes to the ammo idea. Don't take it that I want to crush your idea into little bitty pieces, I have little to no experience trying to do things like that. It's just that (from everything I've seen) SWBF is a game that can really only be played the way that the developers intended it to be played.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: 2 Questions regarding changing Map Gameplay
Both of your ideas are doable, however there is one major problem. You can pickup/add/remove weapons/health/stats/etc... of unit classes, but not the unit itself.
Example: If a sniper picked up a jet pack, all other snipers would suddenly get jet packs too. (This would be fine if the map was limited to one player per class.)
Example: If a sniper picked up a jet pack, all other snipers would suddenly get jet packs too. (This would be fine if the map was limited to one player per class.)
-
t551
- General

- Posts: 791
- Joined: Sat Jul 16, 2005 3:23 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
RE: 2 Questions regarding changing Map Gameplay
Ah. I stand corrected.
-
Dabrowski
RE: 2 Questions regarding changing Map Gameplay
I like your method [RDH]Zerted, but how do you edit to get pickup/add/remove weapon?
But since I also want to devlop my original concept, how do i apply it?
Let's say I edit a unit's .odf and give him a pistol only, and in his other 5-7 slots I give him award weapons.
1) How can I create more item containers (ie. health, def, atk,...)
2)How can I edit what the container gives, such as an Award.
3)How can I make different kinds of ammunition (pistol, smg, standard, rocket, explosives)
4) How do i spawn items in a map?
But since I also want to devlop my original concept, how do i apply it?
Let's say I edit a unit's .odf and give him a pistol only, and in his other 5-7 slots I give him award weapons.
1) How can I create more item containers (ie. health, def, atk,...)
2)How can I edit what the container gives, such as an Award.
3)How can I make different kinds of ammunition (pistol, smg, standard, rocket, explosives)
4) How do i spawn items in a map?
-
xwingguy
Re: RE: 2 Questions regarding changing Map Gameplay
Felucia campaign made a flag out of nothing like so:Dabrowski wrote:4) How do i spawn items in a map?
Code: Select all
PowerCellSpawn = GetPathPoint("powercell_spawn", 0)
CreateEntity("fel1_flag_powercell", PowerCellSpawn, "powercell") --Spawns the Holocron.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: Re: RE: 2 Questions regarding changing Map Gameplay
1) Item containers are just objects. Take a look at com_inf_default.odf to see how to add a dropable object.
2) Look at the game's containers and see how they work.
3) There are different ways to do this. One way is to make some of the dropable containers distroyable. In the map's Lua, when the object is destroyed (use OnObjectKill() ) give the player that destroyed it the ammo or whatever the object represents.
To change the value of somthing, use SetClassProperty( "[class name]", "[variable name]", ["][new value]["] )
Ex: SetClassProperty("all_inf_sniper", "AimFactorPostureStand", "80" ) would cause the Rebel's sniper to have very bad aim when standing.
Read the scripting guide for more info on SetProperty() and SetClassProperty()
I have to force units to spawn in the Deathmatch game mode. Respawning all dead units every 10 seconds doesn't seem to bother the game. To spawn units, use SpawnCharacter( [character index], [a path point] ). To get the character index... well, go look it up yourself (remember ambush?).
2) Look at the game's containers and see how they work.
3) There are different ways to do this. One way is to make some of the dropable containers distroyable. In the map's Lua, when the object is destroyed (use OnObjectKill() ) give the player that destroyed it the ammo or whatever the object represents.
To change the value of somthing, use SetClassProperty( "[class name]", "[variable name]", ["][new value]["] )
Ex: SetClassProperty("all_inf_sniper", "AimFactorPostureStand", "80" ) would cause the Rebel's sniper to have very bad aim when standing.
Read the scripting guide for more info on SetProperty() and SetClassProperty()
I have to force units to spawn in the Deathmatch game mode. Respawning all dead units every 10 seconds doesn't seem to bother the game. To spawn units, use SpawnCharacter( [character index], [a path point] ). To get the character index... well, go look it up yourself (remember ambush?).
-
Dabrowski
RE: Re: RE: 2 Questions regarding changing Map Gameplay
What exactly im doing is this: Each unit spawns with a pistol. But I have weapons spawn at random regions. And next to them are ammo that represents that weapon. A unit picks up the weapon and the ammo as well hes now got a rifle in addition to the pistol. Also if possible, i can have the unit die and drop his weapons.
2) okay, so I need to change a line like into something that gives a weapon. Whats the code for a unit to gain a weapon? Is it just ?
3) As for ammo properties, I want the unit to pick up the item, not shoot at it. Is there a way to make items give different ammo types and is there a way to establish ammo types some way.
I appreciate the help.
2) okay, so I need to change a line like
Code: Select all
SoldierHealth = 200Code: Select all
WeaponName = "rep_weap_award_rifle"3) As for ammo properties, I want the unit to pick up the item, not shoot at it. Is there a way to make items give different ammo types and is there a way to establish ammo types some way.
I appreciate the help.
-
Qdin
- Old School Staff
- Posts: 2059
- Joined: Wed Feb 23, 2005 9:54 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
RE: Re: RE: 2 Questions regarding changing Map Gameplay
how about ReserveForPlayer = "1" in the awarded .odf?
would that work or only with the vehicles? 
*EDIT* does anyone know a list of useable codes?
would something like ReserveForReciever or ReserveForPickUp work? 
*EDIT* does anyone know a list of useable codes?
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: Re: RE: 2 Questions regarding changing Map Gameplay
Most of your work is going to be done in the Luas, not the object. The object is just for show.
You need to determine, in the Lua, when a player wants to pickup the dropped item. The only way I know how to do this is by making the player destroy the pickuped object. That would trigger an ObjectKill event in the Lua. Once you determine which object it was, you give its weapon/ammo/whatever to the player which generated the event. This is done by changing class properties.
Example:
OnObjectKill(
function( object, killer )
if GetEntityClass(flyer) == FindEntityClass("pistol_pickup") then
SetProperty( GetEntityClassName(GetCharacterUnit(killer)), "WeaponName5", "all_inf_weap_pistol" )
end
end
)
Each weapon slot has a number. There are 8 total slots (4 primary and 4 secondary). WeaponName1, WeaponName2, etc...
List of usable codes: http://swbf.tightyo.com/perspective.asp ... nFileGuide
You need to determine, in the Lua, when a player wants to pickup the dropped item. The only way I know how to do this is by making the player destroy the pickuped object. That would trigger an ObjectKill event in the Lua. Once you determine which object it was, you give its weapon/ammo/whatever to the player which generated the event. This is done by changing class properties.
Example:
OnObjectKill(
function( object, killer )
if GetEntityClass(flyer) == FindEntityClass("pistol_pickup") then
SetProperty( GetEntityClassName(GetCharacterUnit(killer)), "WeaponName5", "all_inf_weap_pistol" )
end
end
)
Each weapon slot has a number. There are 8 total slots (4 primary and 4 secondary). WeaponName1, WeaponName2, etc...
List of usable codes: http://swbf.tightyo.com/perspective.asp ... nFileGuide
-
Murdocr
RE: Re: RE: 2 Questions regarding changing Map Gameplay
off topic: if i wanted to use something in the common folder just for my map, without having to overwrite the common .lvl that shipped with the game, would that be possible? e.g what you mentioned about the pickup items, but only for my map.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: Re: RE: 2 Questions regarding changing Map Gameplay
Are you talking about the game's common or a side's common? What do you want to rewrite? I think it is possible to override any game script from a mod map, but I haven't tested it fully...
-
Murdocr
RE: Re: RE: 2 Questions regarding changing Map Gameplay
i mean the games common as in data_modid/common
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: Re: RE: 2 Questions regarding changing Map Gameplay
Yes it should be possible, but I can't think of a reason why you would want to.
-
Dabrowski
im starting to think that what I want to do is impossible or just too complicated. I guess I should do a class style game instead, that way i can have better secondary modes for all weapons. (ie- Primary has Rocket Launcher and Remote Rocket Launcher while the secondary has something else like that)
Thanks for all who helped.
If anyone does come up with a way, go right ahead and post it.
Thanks for all who helped.
If anyone does come up with a way, go right ahead and post it.
