Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Help with creating scripts
Help with creating scripts [message #231746] Thu, 23 November 2006 19:24 Go to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
How would I set up a script that sends a random custom.

Re: Help with creating scripts [message #231786 is a reply to message #231746] Fri, 24 November 2006 01:52 Go to previous messageGo to next message
Zion is currently offline  Zion
Messages: 2722
Registered: April 2006
Karma: 1
General (2 Stars)
Scripts.dll most likely (C++ knowledge needed)

Best asking a programmer Razz
Re: Help with creating scripts [message #231787 is a reply to message #231786] Fri, 24 November 2006 01:57 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Thats what I was asking for, I already make my own scripts, I just need to see how a script that sent random customs would look.

Re: Help with creating scripts [message #231788 is a reply to message #231746] Fri, 24 November 2006 01:59 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3555
Registered: February 2003
Karma: 0
General (3 Stars)

Random as in "any number within a certain range" or random as in "pick one of n different customs at random"?

Also, how should it trigger?


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies

[Updated on: Fri, 24 November 2006 02:00]

Report message to a moderator

Re: Help with creating scripts [message #231790 is a reply to message #231788] Fri, 24 November 2006 02:05 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Random as in pick certain customs, and I want it to trigger when sent a custom.

Re: Help with creating scripts [message #233352 is a reply to message #231790] Fri, 08 December 2006 11:47 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
I figured that last one out a week or so ago.
But I have a new question.
How would I set up a script that makes a sound when you armor gets low? I have attempted it for several hours and I have noticed that there are no scripts that do something when your armor gets so low. When I get home in two hours I'm going to try something simpler, and if that doesn't work then I have absolutely no clue as what to do.


Re: Help with creating scripts [message #233360 is a reply to message #231746] Fri, 08 December 2006 12:51 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
Use the ::Damaged event

Then use Commands->Get_Shield_Strength to find out how much armour is left ( Commands->Get_Health for health )

If it's below a certain amount send the sound.


http://steamsignature.com/card/1/76561197975867233.png
Re: Help with creating scripts [message #233369 is a reply to message #233360] Fri, 08 December 2006 14:04 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Ya, I know that, it works fine for the health but not the shield.

Re: Help with creating scripts [message #233427 is a reply to message #233369] Fri, 08 December 2006 23:19 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
It turns out that I miss named one of the float parameters.
He is a bit harder question, how would I make a script that would detect if an object has been or being repaired. I have tried before but it ended up doing nothing, and I want it to reupdate the present health the object has about every 10th of a second. Sends a custom every time it increases one health. And it should not be able to send another custom until it has dropped at least 1 health (damaged). A detailed explanation would be appreciated!


Re: Help with creating scripts [message #233531 is a reply to message #231746] Sat, 09 December 2006 17:49 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
use the ::Damaged event Wink

Check the amount of damage, if it is negative then its actually being repaired Wink


http://steamsignature.com/card/1/76561197975867233.png
Re: Help with creating scripts [message #233581 is a reply to message #233531] Sat, 09 December 2006 22:01 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
danpaul88 wrote on Sat, 09 December 2006 17:49

use the ::Damaged event Wink

Check the amount of damage, if it is negative then its actually being repaired Wink


Really, I did not know repairing is negative damage, how could I have been modding Renegade for over 2 years and have missed that (sarcasm). I'm not a noob, and you sound like a broken record. Use the ::Damaged event, Use the ::Damaged event. Did you even read the whole question? I asked how it would be set up to send a custom, and then not be able to send another custom until it was damaged. And anyone who as looked at the armor file would no the repair gun did negative damage.

I also figured out how do do it a different way!


[Updated on: Sat, 09 December 2006 22:03]

Report message to a moderator

Re: Help with creating scripts [message #233781 is a reply to message #231746] Mon, 11 December 2006 12:14 Go to previous message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
I have no idea what your background is in modding scripts.dll, so excuse me for not being psychic Sarcasm

Sending a custom only once is fairly easy, just add a bool to your scripts class, and set it to true once the custom has been sent. Then when checking if you should send the custom, check to see if the bool is true or not.

Use a timer to set the boolean back to it's off state, so the health can be sent again.


http://steamsignature.com/card/1/76561197975867233.png
Previous Topic: Funny Water
Next Topic: Lookin' for a 3D Nod logo.
Goto Forum:
  


Current Time: Mon Apr 29 10:24:08 MST 2024

Total time taken to generate the page: 0.00842 seconds