Page 1 of 1

Code console codes

Posted: Sat Jan 03, 2009 1:59 pm
by Boo
can i put in a lua code in the code console that gives al units 4000 hp
and witch code is it im not very good in modding :oops:

Re: Code console codes

Posted: Sat Jan 03, 2009 2:03 pm
by ryukaji
Code console? the only way i know of to change a units health is in their .odf file not in .lua

Re: Code console codes

Posted: Sat Jan 03, 2009 2:07 pm
by Boo
ryukaji wrote:Code console? the only way i know of to change a units health is in their .odf file not in .lua
that means i cant make that a unit has 4000 hp in game with the fakeconsole

Re: Code console codes

Posted: Sat Jan 03, 2009 2:09 pm
by ryukaji
oh you meant fake console and no i dont think it does that...

Re: Code console codes

Posted: Sat Jan 03, 2009 2:21 pm
by Boo
ryukaji wrote:oh you meant fake console and no i dont think it does that...
ok thanks ----solved----

Re: Code console codes

Posted: Sat Jan 03, 2009 2:47 pm
by Aman/Pinguin
Of course it does. I'm too busy to write that line though. xD

Re: Code console codes

Posted: Sat Jan 03, 2009 5:05 pm
by [RDH]Zerted
Yeah, you could write a line to do that. I don't know the exact line offhand, but it would be something like SetClassProperty(<unit class>, "CurHealth", 4000).

You could also create a custom user script that adds that change health command as a standard Fakeconsole command. That way you won't have to type it in every time.

Re: Code console codes

Posted: Sun Jan 04, 2009 1:57 pm
by Boo
[RDH]Zerted wrote:Yeah, you could write a line to do that. I don't know the exact line offhand, but it would be something like SetClassProperty(<unit class>, "CurHealth", 4000).

You could also create a custom user script that adds that change health command as a standard Fakeconsole command. That way you won't have to type it in every time.
thanks but can you give me a correct code please because i dont want to make a script and i cant mod (good)
just pm me

Re: Code console codes

Posted: Sun Jan 04, 2009 2:59 pm
by DarthD.U.C.K.
Boo wrote:
[RDH]Zerted wrote:Yeah, you could write a line to do that. I don't know the exact line offhand, but it would be something like SetClassProperty(<unit class>, "CurHealth", 4000).

You could also create a custom user script that adds that change health command as a standard Fakeconsole command. That way you won't have to type it in every time.
thanks but can you give me a correct code please because i dont want to make a script and i cant mod (good)
just pm me
:?

Re: Code console codes

Posted: Sun Jan 04, 2009 6:55 pm
by Maveritchell
Boo wrote:
[RDH]Zerted wrote:Yeah, you could write a line to do that. I don't know the exact line offhand, but it would be something like SetClassProperty(<unit class>, "CurHealth", 4000).

You could also create a custom user script that adds that change health command as a standard Fakeconsole command. That way you won't have to type it in every time.
thanks but can you give me a correct code please because i dont want to make a script and i cant mod (good)
just pm me
He just gave you the script - SetClassProperty("unitclass name", "MaxHealth", 4000)
SetClassProperty("unitclass name", "CurHealth", 4000)

Re: Code console codes

Posted: Mon Jan 05, 2009 6:31 am
by Boo
Maveritchell wrote:
Boo wrote:
[RDH]Zerted wrote:Yeah, you could write a line to do that. I don't know the exact line offhand, but it would be something like SetClassProperty(<unit class>, "CurHealth", 4000).

You could also create a custom user script that adds that change health command as a standard Fakeconsole command. That way you won't have to type it in every time.
thanks but can you give me a correct code please because i dont want to make a script and i cant mod (good)
just pm me
He just gave you the script - SetClassProperty("unitclass name", "MaxHealth", 4000)
SetClassProperty("unitclass name", "CurHealth", 4000)
i know but at the first time i doesnt work so i tought that there was an error in the code but it works now and please lock the topic.

Re: Code console codes

Posted: Mon Jan 05, 2009 11:57 am
by [RDH]Zerted
Boo wrote:but it works now and please lock the topic.
I'd rather not, as there is a better way to do it. But I haven't had the time to look that code up yet...