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

Sith
User avatar
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Location: The lost world of pickels

Points to unlock (FAQ)

Postby woner11 » Sat Apr 26, 2008 11:54 am

Is there some way through scripting to determine how many points it takes to unlock a unit instead of the odf function "PointstoUnlock= X"?

Rebel Colonel
User avatar
Posts: 598
Joined: Wed May 30, 2007 3:33 pm
Location: At RCTC

Re: Points to unlock

Postby Master Fionwë » Sat Apr 26, 2008 1:00 pm

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?

Black Sun Slicer
User avatar
Posts: 621
Joined: Wed Aug 23, 2006 4:10 pm
Location: A better place....

Re: Points to unlock

Postby MasterSaitek009 » Sat Apr 26, 2008 1:09 pm

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? :? ).

Sith
User avatar
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Location: The lost world of pickels

Re: Points to unlock

Postby woner11 » Sat Apr 26, 2008 1:13 pm

Thanks a bunch!!! Can you modify health and damage the unit can do as well?

Black Sun Slicer
User avatar
Posts: 621
Joined: Wed Aug 23, 2006 4:10 pm
Location: A better place....

Re: Points to unlock

Postby MasterSaitek009 » Sat Apr 26, 2008 1:20 pm

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.

Field Commander
User avatar
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Location: Coruscant, Jedi Temple
Games I'm Playing :: no games
xbox live or psn: no live

Re: Points to unlock

Postby elfie » Sat Apr 26, 2008 2:20 pm

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

Sith
User avatar
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Location: The lost world of pickels

Re: Points to unlock

Postby woner11 » Sat Apr 26, 2008 4:26 pm

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)

Black Sun Slicer
User avatar
Posts: 621
Joined: Wed Aug 23, 2006 4:10 pm
Location: A better place....

Re: Points to unlock

Postby MasterSaitek009 » Sat Apr 26, 2008 4:35 pm

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.

Sith
User avatar
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Location: The lost world of pickels

Re: Points to unlock

Postby woner11 » Sat Apr 26, 2008 5:10 pm

Okay, I'll give it a try and thank you very much! :wink:

Private
User avatar
Posts: 32
Joined: Tue Dec 04, 2007 6:55 am

Re: Points to unlock

Postby Omega_007 » Thu May 15, 2008 8:08 am

Apologies for bumping this thread, but I have a query about the "SetProperty" line; can it be used with weapons, as well as units?

Jedi Admin
User avatar
Posts: 7420
Joined: Mon Aug 21, 2006 11:03 pm

Re: Points to unlock

Postby Maveritchell » Thu May 15, 2008 10:45 am

Yes, but it's still SetClassProperty and not SetProperty. There aren't instances of weapons, just weapon classes.

Gametoast Staff
User avatar
Posts: 2973
Joined: Sun Feb 26, 2006 7:36 am
Location: USA
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set

Re: Points to unlock

Postby [RDH]Zerted » Thu May 15, 2008 4:24 pm

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.

Private
User avatar
Posts: 32
Joined: Tue Dec 04, 2007 6:55 am

Re: Points to unlock

Postby Omega_007 » Fri May 16, 2008 2:12 am

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?

Gametoast Staff
User avatar
Posts: 2973
Joined: Sun Feb 26, 2006 7:36 am
Location: USA
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set

Re: Points to unlock

Postby [RDH]Zerted » Tue May 20, 2008 12:42 am

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)

Command Sergeant Major
User avatar
Posts: 289
Joined: Sat Sep 27, 2008 5:58 pm
Location: Crifton

Re: Points to unlock

Postby Tourny » Sun Aug 30, 2009 2:21 pm

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
    )

Jedi Admin
User avatar
Posts: 7420
Joined: Mon Aug 21, 2006 11:03 pm

Re: Points to unlock (FAQ)

Postby Maveritchell » Sun Aug 30, 2009 2:50 pm

whatdoIputhere? = GetCharacterUnit(player)

Return to SWBF2 Modding

Who is online

Users browsing this forum: No registered users and 3 guests