Points to unlock (FAQ)
Moderator: Moderators
-
- Sith
- Posts: 1361
- Joined: Tue Sep 18, 2007 10:17 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The lost world of pickels
- Contact:
Points to unlock (FAQ)
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
- Posts: 598
- Joined: Wed May 30, 2007 3:33 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: At RCTC
- Contact:
Re: Points to unlock
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
- Posts: 619
- Joined: Wed Aug 23, 2006 4:10 pm
Re: Points to unlock
Example with the Acklay:
Just put it in command post setup section(can't remember the name. ScriptPostLoad?
).
Code: Select all
SetClassProperty("geo_inf_acklay", "PointsToUnlock", 12)

-
- Sith
- Posts: 1361
- Joined: Tue Sep 18, 2007 10:17 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The lost world of pickels
- Contact:
Re: Points to unlock
Thanks a bunch!!! Can you modify health and damage the unit can do as well?
-
- Black Sun Slicer
- Posts: 619
- Joined: Wed Aug 23, 2006 4:10 pm
Re: Points to unlock
Yep:
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:
That will change the MaxHealth of the unit in the variable to 1000.
Code: Select all
SetClassProperty("geo_inf_acklay", "MaxHealth", 1000)
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)
- elfie
- Field Commander
- Posts: 931
- Joined: Fri Jan 25, 2008 8:26 pm
- xbox live or psn: no live
- Location: Coruscant, Jedi Temple
- Contact:
Re: Points to unlock
Oh yeah I know that map!! I think it was that campaign map on http://www.starwarsbattlefront.filefront.comYes, 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?
-
- Sith
- Posts: 1361
- Joined: Tue Sep 18, 2007 10:17 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The lost world of pickels
- Contact:
Re: Points to unlock
Would I also then change
to this:
Code: Select all
SetClassProperty("geo_inf_acklay", "PointsToUnlock", 12)
Code: Select all
SetProperty("geo_inf_acklay", "PointsToUnlock", 12)
-
- Black Sun Slicer
- Posts: 619
- Joined: Wed Aug 23, 2006 4:10 pm
Re: Points to unlock
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.
If you look in the scripting guide it has a list of all the instance and class properties.
Each unit has there own instance property. The class properties are shared across the whole... well, class.

If you look in the scripting guide it has a list of all the instance and class properties.
-
- Sith
- Posts: 1361
- Joined: Tue Sep 18, 2007 10:17 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The lost world of pickels
- Contact:
Re: Points to unlock
Okay, I'll give it a try and thank you very much! 

-
- Private
- Posts: 32
- Joined: Tue Dec 04, 2007 6:55 am
Re: Points to unlock
Apologies for bumping this thread, but I have a query about the "SetProperty" line; can it be used with weapons, as well as units?
- Maveritchell
- Jedi Admin
- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Points to unlock
Yes, but it's still SetClassProperty and not SetProperty. There aren't instances of weapons, just weapon classes.
- [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: Points to unlock
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
- Posts: 32
- Joined: Tue Dec 04, 2007 6:55 am
Re: Points to unlock
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?
Also, can you change a vehicle's health(or that of a vehicle class) using these two code lines?
- [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: Points to unlock
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)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?
- Tourny
- Command Sergeant Major
- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Points to unlock
Sorry for bumping this topic, but I'm confused about this:
Can somebody explain in further detail how to get it to recognize a unit currently referenced in a function? For example:MasterSaitek009 wrote:SetProperty(UNIT_VARIABLE, "MaxHealth", 1000)
That will change the MaxHealth of the unit in the variable to 1000.
Code: Select all
OnCharacterSpawn(
function(player)
if GetEntityClass(player) == "cis_inf_rifleman" then
SetProperty(whatdoIputhere?, Team, 3)
end
end
)
- Maveritchell
- Jedi Admin
- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Points to unlock (FAQ)
whatdoIputhere? = GetCharacterUnit(player)