Points to unlock (FAQ)

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
woner11
Sith
Sith
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The lost world of pickels
Contact:

Points to unlock (FAQ)

Post by woner11 »

Is there some way through scripting to determine how many points it takes to unlock a unit instead of the odf function "PointstoUnlock= X"?
Master Fionwë
Rebel Colonel
Rebel Colonel
Posts: 598
Joined: Wed May 30, 2007 3:33 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: At RCTC
Contact:

Re: Points to unlock

Post by Master Fionwë »

Yes, there is a map out there that was done in a more mission style, where if you have a certain number of cps captured the Jedi became available to use. If you lacked the necessary number of cps then the Jedi were 500 points each. I can't remember the name of it though, maybe someone else knows?
MasterSaitek009
Black Sun Slicer
Posts: 619
Joined: Wed Aug 23, 2006 4:10 pm

Re: Points to unlock

Post by MasterSaitek009 »

Example with the Acklay:

Code: Select all

SetClassProperty("geo_inf_acklay", "PointsToUnlock", 12)
Just put it in command post setup section(can't remember the name. ScriptPostLoad? :? ).
woner11
Sith
Sith
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The lost world of pickels
Contact:

Re: Points to unlock

Post by woner11 »

Thanks a bunch!!! Can you modify health and damage the unit can do as well?
MasterSaitek009
Black Sun Slicer
Posts: 619
Joined: Wed Aug 23, 2006 4:10 pm

Re: Points to unlock

Post by MasterSaitek009 »

Yep:

Code: Select all

SetClassProperty("geo_inf_acklay", "MaxHealth", 1000)
Note:
That method is for the class as a whole. If you just want to change the current health of a unit, here's what you should use:

Code: Select all

SetProperty(UNIT_VARIABLE, "MaxHealth", 1000)
That will change the MaxHealth of the unit in the variable to 1000.
User avatar
elfie
Field Commander
Field Commander
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Games I'm Playing :: no games
xbox live or psn: no live
Location: Coruscant, Jedi Temple
Contact:

Re: Points to unlock

Post by elfie »

Yes, there is a map out there that was done in a more mission style, where if you have a certain number of cps captured the Jedi became available to use. If you lacked the necessary number of cps then the Jedi were 500 points each. I can't remember the name of it though, maybe someone else knows?
Oh yeah I know that map!! I think it was that campaign map on http://www.starwarsbattlefront.filefront.com
woner11
Sith
Sith
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The lost world of pickels
Contact:

Re: Points to unlock

Post by woner11 »

Would I also then change

Code: Select all

SetClassProperty("geo_inf_acklay", "PointsToUnlock", 12)
to this:

Code: Select all

SetProperty("geo_inf_acklay", "PointsToUnlock", 12)
MasterSaitek009
Black Sun Slicer
Posts: 619
Joined: Wed Aug 23, 2006 4:10 pm

Re: Points to unlock

Post by MasterSaitek009 »

No, PointToUnlock is a class property. Health and MaxHealth are instance properties.
Each unit has there own instance property. The class properties are shared across the whole... well, class. :wink:
If you look in the scripting guide it has a list of all the instance and class properties.
woner11
Sith
Sith
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The lost world of pickels
Contact:

Re: Points to unlock

Post by woner11 »

Okay, I'll give it a try and thank you very much! :wink:
Omega_007
Private
Posts: 32
Joined: Tue Dec 04, 2007 6:55 am

Re: Points to unlock

Post by Omega_007 »

Apologies for bumping this thread, but I have a query about the "SetProperty" line; can it be used with weapons, as well as units?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Points to unlock

Post by Maveritchell »

Yes, but it's still SetClassProperty and not SetProperty. There aren't instances of weapons, just weapon classes.
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: Points to unlock

Post by [RDH]Zerted »

I have never tired changing the properties of weapons (rate of fire, recharge time, etc...), but I do know that changing which weapons a unit hold will cause crashes for other players in MP. Also, changing units' ammo counts causes the crashes too.
Omega_007
Private
Posts: 32
Joined: Tue Dec 04, 2007 6:55 am

Re: Points to unlock

Post by Omega_007 »

By weapon classes we'd be talking, say, like the rifles of all 4 main sides being of the same wepon class, right?

Also, can you change a vehicle's health(or that of a vehicle class) using these two code lines?
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: Points to unlock

Post by [RDH]Zerted »

Omega_007 wrote:By weapon classes we'd be talking, say, like the rifles of all 4 main sides being of the same wepon class, right?

Also, can you change a vehicle's health(or that of a vehicle class) using these two code lines?
Yes, and about the vehicle's health, I think so. Ingame its an object and SetProperty works on objects... I've never tried it though. You would need to know the vehicle's spawned name, or get a reference to it somehow (like through OnExitVehicle or whatever)
User avatar
Tourny
Command Sergeant Major
Command Sergeant Major
Posts: 289
Joined: Sat Sep 27, 2008 5:58 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Crifton
Contact:

Re: Points to unlock

Post by Tourny »

Sorry for bumping this topic, but I'm confused about this:
MasterSaitek009 wrote:SetProperty(UNIT_VARIABLE, "MaxHealth", 1000)

That will change the MaxHealth of the unit in the variable to 1000.
Can somebody explain in further detail how to get it to recognize a unit currently referenced in a function? For example:

Code: Select all

OnCharacterSpawn(
    function(player)
        if GetEntityClass(player) == "cis_inf_rifleman" then
            SetProperty(whatdoIputhere?, Team, 3)
        end
    end
    )
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Points to unlock (FAQ)

Post by Maveritchell »

whatdoIputhere? = GetCharacterUnit(player)
Post Reply