Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripts.dll Documentation
Scripts.dll Documentation [message #62752] Tue, 20 January 2004 08:23 Go to next message
gibberish
Messages: 366
Registered: May 2003
Karma: 0
Commander
Just wondering if anyone has had the time to write any documentation or even better a tutorial about scripts.dll

I.e. What the standard functions are and how to do basic things.

For example I figured out how to write my own code to heal all buildings (I know it wasn't that difficult) however I couldn't figure out how to reset the "undamaged" skin/mesh.

Another example would be if it is possible to re-enable a building after its been destroyed.

Thanks,
Gib
Scripts.dll Documentation [message #62769] Tue, 20 January 2004 11:30 Go to previous messageGo to next message
Dante
Messages: 1039
Registered: February 2003
Karma: 0
General (1 Star)
heal it, don't set_health

Scripts.dll Documentation [message #63233] Thu, 22 January 2004 19:16 Go to previous messageGo to next message
gibberish
Messages: 366
Registered: May 2003
Karma: 0
Commander
Ok how would one go about healing it,

I currently have:

float amount = Commands->Get_Health(obj);

if (amount>0)
Commands->Set_Health(obj,(amount + ((amount + 100)/50)));

I couldn't find any calls like "Heal......" so what should I do ?

Thanks,
Gib
Scripts.dll Documentation [message #63331] Fri, 23 January 2004 12:14 Go to previous messageGo to next message
General Havoc is currently offline  General Havoc
Messages: 1564
Registered: February 2003
Location: Birmingham, England, Unit...
Karma: 0
General (1 Star)
I don't know exactly how that script works, but a guess from looking at the file would be that it increments the health of the building over time rather than setting it to it's maximum.

If you think about it, you have a nearly dead building then you suddenly give it full health, the game doesn't know that it's been healed, as you have sort of skipped the process. By setting the buildings health to equal it's current health plus a value, you are effectivly healing it by setting it health at a higher level each time until it's healed.

I am guessing the game doesn't know to play the agregates, as the agregates work by health level, if you have skipped the health level it normally plays on then you have effectivly jumped over the animation. Healing it will cycle backwards through the repair animations.

The same goes for killing building, if you set it's health to zero then you have skipped the destroying process of the game.


Visit my website at http://renhelp.laeubi-soft.de powered by laeubi.de
"SHUT UP AND MOD" - Dante
"ACK is the Simon Cowell of modding" - Ultron10
Scripts.dll Debugger, Map Scripter and Tutorial writer

Computer Science Bsc
Aston University in Birmingham, UK
Scripts.dll Documentation [message #63332] Fri, 23 January 2004 12:31 Go to previous messageGo to next message
Dante
Messages: 1039
Registered: February 2003
Karma: 0
General (1 Star)
Apply_Damage (HGAMEOBJ obj,float damage,char *warhead,bool unk)


do this:
float amount = Commands->Get_Health(obj);
float repair_rate = 10
if (amount > 0) {
     Commands->Apply_Damage (object, repair_rate,"Repair",false);
}


that should fix all issues with that


Scripts.dll Documentation [message #63375] Fri, 23 January 2004 21:19 Go to previous message
gibberish
Messages: 366
Registered: May 2003
Karma: 0
Commander
ROFL, You forgot the minus sign.


Anyway the code works if building repair is on, but what I was trying to achieve was having buildings auto repair, so I could turn off manual building repair.

Anyway the following code worked:

Commands->Set_Health(obj,(amount + ((amount + 100.0) / 50.0)));
Commands->Apply_Damage (obj, 0.0,"Repair",false); 


Thanks,
Gib

PS I am still looking for documentation if anyone has some.
Previous Topic: scripts.dll 1.4...
Next Topic: presets on .mix
Goto Forum:
  


Current Time: Sat Dec 14 22:50:45 MST 2024

Total time taken to generate the page: 0.00790 seconds