Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripts.dll help
Scripts.dll help [message #96183] Sat, 19 June 2004 12:46 Go to next message
thinlan is currently offline  thinlan
Messages: 25
Registered: July 2003
Karma: 0
Recruit
how do ya make the stealth suit work?
Scripts.dll help [message #96184] Sat, 19 June 2004 12:49 Go to previous messageGo to next message
xptek_disabled is currently offline  xptek_disabled
Messages: 1308
Registered: September 2003
Karma: 0
General (1 Star)
It doesn't work client side.

Local oper-irc.ugin.net - A Scrumfy free IRC.
Jonwil > SK
http://www.byterush.net/
Scripts.dll help [message #96186] Sat, 19 June 2004 12:51 Go to previous messageGo to next message
thinlan is currently offline  thinlan
Messages: 25
Registered: July 2003
Karma: 0
Recruit
lol i know it doesnt.. but.. i made it so if u kill a sbh it drops the stealth suit... and it dont Razz but i know it can cos i played a map once and there was a spawn stealth suit and it worked
Scripts.dll help [message #96486] Mon, 21 June 2004 17:59 Go to previous messageGo to next message
thinlan is currently offline  thinlan
Messages: 25
Registered: July 2003
Karma: 0
Recruit
ok well never mind all them.. but is it possible to detect what soemone says ingame using scripts.dll?
Scripts.dll help [message #96487] Mon, 21 June 2004 18:33 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

no its not possible.

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
Scripts.dll help [message #96490] Mon, 21 June 2004 18:44 Go to previous messageGo to next message
xptek_disabled is currently offline  xptek_disabled
Messages: 1308
Registered: September 2003
Karma: 0
General (1 Star)
A certain awesome scripts.dll mod does it by adding new commands to the FDS.

EX: Admin types !kill xptek

Bot issues renrem kill player


Local oper-irc.ugin.net - A Scrumfy free IRC.
Jonwil > SK
http://www.byterush.net/
Scripts.dll help [message #96494] Mon, 21 June 2004 19:02 Go to previous messageGo to next message
thinlan is currently offline  thinlan
Messages: 25
Registered: July 2003
Karma: 0
Recruit
yes i already knew about that, but i have not the slightest idea how to do it :S
Scripts.dll help [message #96544] Tue, 22 June 2004 02:05 Go to previous messageGo to next message
gibberish
Messages: 366
Registered: May 2003
Karma: 0
Commander
thinlan

i have not the slightest idea how to do it


- Spawn a thread inside scripts.dll
- Create a server server socket and listen for incoming connections.
- Open an outgoing socket from your regulator.
- The regulator parses the log file generated by the FDS.
- If the regulator sees a command it forwards it over the socket to the FDS
- Then the thread in scripts.dll queues the command.
- Have a timer set to read the queue from the main thread (every second) and then the main thread executes the command (Kill player, move player, give money .........).

Additionally you can feed information about kills and such back the other way so that the regulator can do stuff with it.

Alternatively just write your regulator in C and compile it into scripts.dll that way you don't have to spawn any threads or do any network programming.
But the disadvantage is that if you need to update the regulator you have to stop the FDS.
Scripts.dll help [message #96659] Tue, 22 June 2004 12:59 Go to previous messageGo to next message
thinlan is currently offline  thinlan
Messages: 25
Registered: July 2003
Karma: 0
Recruit
ok im still a bit of a newbie at scripts and C++ stuff, so whats that in english? Confused
Scripts.dll help [message #96672] Tue, 22 June 2004 14:02 Go to previous messageGo to next message
gibberish
Messages: 366
Registered: May 2003
Karma: 0
Commander
The first option requires Multi-Threaded Socket Programming this is an advanced area. Don't bother even trying to do it unless you are a experianced C++ programmer. This leaves you with the second option:

In English the second option is:

When the FDS (Free Dedicated Server) is running it writes a log file containing many things that happen in the game.

What you need to do is get the source code for scripts.dll.

Then add some new code to it to read the log file.
That way when someone chats something it will appear in the log.
Your program will read the log and hence know it must do something....
Scripts.dll help [message #96756] Tue, 22 June 2004 22:30 Go to previous messageGo to next message
thinlan is currently offline  thinlan
Messages: 25
Registered: July 2003
Karma: 0
Recruit
ok im getting no where with it.. how can u add a command to the fds so u can renrem it like xptek was saying?
Scripts.dll help [message #96757] Tue, 22 June 2004 22:32 Go to previous messageGo to next message
thinlan is currently offline  thinlan
Messages: 25
Registered: July 2003
Karma: 0
Recruit
also is it possible to increase the vehicle limit using scripts.dll cos that would be so 0wnage
Scripts.dll help [message #96778] Wed, 23 June 2004 01:38 Go to previous messageGo to next message
gibberish
Messages: 366
Registered: May 2003
Karma: 0
Commander
thinlan

ok im getting no where with it.. how can u add a command to the fds so u can renrem it like xptek was saying?


Don't, just call ConsoleCommand

void ConsoleCommand(const char *msg)
{
	typedef void (*ConsoleMsg)(const char *);
	ConsoleMsg do_consolemsg;
	do_consolemsg = (ConsoleMsg)0x00428960;
	do_consolemsg(msg);
}


Eg: ConsoleCommand("MSG Hello World")
Scripts.dll help [message #96780] Wed, 23 June 2004 02:18 Go to previous messageGo to next message
thinlan is currently offline  thinlan
Messages: 25
Registered: July 2003
Karma: 0
Recruit
well take for example that !kill command.. if i wanted to make one of those.. appart from the confusing things stated earlyer how could i make a new fds command.. like when someone type !kill thinlan, blazeregulator or what ever can renrem kill thinlan, and the issue the Apply_Damage command to kill em.. i mean i know how to do the apply damage stuff i just dont know how to make the new fds command, or can u use Consolecommand to do that?
Scripts.dll help [message #96814] Wed, 23 June 2004 08:06 Go to previous messageGo to next message
Tidu is currently offline  Tidu
Messages: 62
Registered: January 2004
Karma: 0
Recruit
thinlan

also is it possible to increase the vehicle limit using scripts.dll cos that would be so 0wnage





That would lag the game a lot;
Scripts.dll help [message #96846] Wed, 23 June 2004 11:30 Go to previous messageGo to next message
xptek_disabled is currently offline  xptek_disabled
Messages: 1308
Registered: September 2003
Karma: 0
General (1 Star)
I can make the vehicle limit unlimited, it's not done with scripts.dll though. If you have a good enough server and a good enough computer there's no lag.

Local oper-irc.ugin.net - A Scrumfy free IRC.
Jonwil > SK
http://www.byterush.net/
Scripts.dll help [message #96852] Wed, 23 June 2004 11:53 Go to previous messageGo to next message
Spice
Messages: 1448
Registered: November 2003
Location: Ohio
Karma: 0
General (1 Star)
that would be pretty sweet if the Renalert Team increased there vehicle limit to about 10. Very Happy If you can set higher standards and not just make a unlimited amount.

http://img46.imageshack.us/img46/8027/userbar358428pu3.gif
Scripts.dll help [message #96859] Wed, 23 June 2004 12:28 Go to previous messageGo to next message
gibberish
Messages: 366
Registered: May 2003
Karma: 0
Commander
thinlan

!kill thinlan


I don't know of a way to do it from the console however if you want to do it from the chat (F2) then !kill the only other code you need is the code to get a player name:

unsigned long GetPlayerData(GameObject *obj)
{
	if (!obj)
		return 0;

	__asm {
	   mov edx, obj
	   mov eax, dword ptr[edx + 960h]
	};
} 
  
LPCWSTR GetName(unsigned long ptr_)
{ 
	if (!ptr_)
		return NULL;

	__asm {
		mov edx, [ptr_]
		mov eax, dword ptr[edx + 758h]
	};
}

LPSTR GetPlayerNameA(GameObject *obj)
{
	LPCWSTR lpszSource = GetName(GetPlayerData(obj));

	return wcstombsnew(lpszSource);
}


LPCWSTR GetPlayerNameW(GameObject *obj)
{
	return (LPCWSTR) GetName(GetPlayerData(obj));
}

char *wcstombsnew(LPCWSTR lpszSource)
{
	if (!lpszSource)
		return NULL;

	// Add 1 to include null terminator
	size_t stLen = wcslen(lpszSource);
	size_t stZero = stLen + 1;

	// Calculate how much space is needed
	size_t stNew = wcstombs(NULL, lpszSource, stZero);

	if (stNew == ((size_t) -1))
		return NULL;

	char *lpszTarget = new char [stNew + 1];

	wcstombs(lpszTarget, lpszSource, stZero);

	return lpszTarget;
}

// Version of wcsdup that uses new instead of malloc
LPWSTR wcsdupnew(LPCWSTR lpszSource)
{
	if (!lpszSource)
		return NULL;

	// Copy the wide string
	size_t st_len = wcslen(lpszSource);
	LPWSTR lpszTarget = new WCHAR[st_len + 1];
	wcscpy(lpszTarget, lpszSource);

	return lpszTarget;
}



Everything you need is now in this thread.
Scripts.dll help [message #96861] Wed, 23 June 2004 12:32 Go to previous messageGo to next message
xptek_disabled is currently offline  xptek_disabled
Messages: 1308
Registered: September 2003
Karma: 0
General (1 Star)
So, using this code you can simply type !kill and it kills them? Shocked

Local oper-irc.ugin.net - A Scrumfy free IRC.
Jonwil > SK
http://www.byterush.net/
Scripts.dll help [message #96864] Wed, 23 June 2004 12:38 Go to previous messageGo to next message
gibberish
Messages: 366
Registered: May 2003
Karma: 0
Commander
xptek

So, using this code you can simply type !kill and it kills them? Shocked


No he still needs to put all the pieces together.

But all the pieces are there.

With a bit of work he should be able to:

- Read the log file
- Parse the command
- Locate the player
- Apply the damage.
- Print out a message about what happened

Its a good programming exercise Smile
Scripts.dll help [message #96865] Wed, 23 June 2004 12:38 Go to previous messageGo to next message
xptek_disabled is currently offline  xptek_disabled
Messages: 1308
Registered: September 2003
Karma: 0
General (1 Star)
Well then, that counts me out. Very Happy

Local oper-irc.ugin.net - A Scrumfy free IRC.
Jonwil > SK
http://www.byterush.net/
Scripts.dll help [message #96868] Wed, 23 June 2004 12:50 Go to previous messageGo to next message
Phoenix - Aeon is currently offline  Phoenix - Aeon
Messages: 221
Registered: April 2004
Karma: 0
Recruit
Fuck, from the looks of things it's not hard to run the kill either, it's the player locate coding that takes up lines.
Scripts.dll help [message #96873] Wed, 23 June 2004 13:07 Go to previous messageGo to next message
gibberish
Messages: 366
Registered: May 2003
Karma: 0
Commander
Phoenix - Aeon

Fuck, from the looks of things it's not hard to run the kill either, it's the player locate coding that takes up lines.


Its still a significant project it will probably take a newbie at least a couple of days of work to put it all together.

But after doing it you will have a good grasp of scripts.dll programming.
Scripts.dll help [message #96901] Wed, 23 June 2004 15:48 Go to previous messageGo to next message
thinlan is currently offline  thinlan
Messages: 25
Registered: July 2003
Karma: 0
Recruit
This is starting to get very very confusing Confused
Scripts.dll help [message #97139] Fri, 25 June 2004 07:43 Go to previous messageGo to previous message
Sir Kane
Messages: 1701
Registered: March 2003
Location: Angerville
Karma: 0
General (1 Star)
Don't post code without refering to the copyright, gibberish.

Proud N9500 and proud N6270 user. Creator of the IEE libraries (original bhs.dll) and the RB series software.
http://n00bstories.com/image.fetch.php?id=1189992501http://www.n00bstories.com/image.fetch.php?id=1257492907
Previous Topic: Scripts.dll
Next Topic: Taximes PT Icons
Goto Forum:
  


Current Time: Sat Nov 02 17:16:32 MST 2024

Total time taken to generate the page: 0.01217 seconds