Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripts Part 3
Scripts Part 3 [message #266592] Fri, 15 June 2007 22:57 Go to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
this is kind abig umm can someone help me make a script where u do a command and it builds or buys somthing?

like buy a weapon
tank
or agt or somthing ?
i have no clue of how to do it so maybe can someoen help and make one with me?
Re: Scripts Part 3 [message #266594 is a reply to message #266592] Sat, 16 June 2007 00:03 Go to previous messageGo to next message
Veyrdite is currently offline  Veyrdite
Messages: 1471
Registered: August 2006
Location: Australia, Sydney
Karma: 0
General (1 Star)
renhelp.net
go to the poke and buy tutorial


WOL: Veyrdite Previously: Dthdealer ( a long time ago )
Re: Scripts Part 3 [message #266619 is a reply to message #266592] Sat, 16 June 2007 05:53 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
He means something different to that.. He wants to be able to say something in-game like "!buy med" and it drops off a med tank to him, or "!gt" and it places a Mini guard tower for him.

This is possible by modifying the existing chat hook in SSAOW, to find the chat hook search for this bit:

const char *WideCharToChar(const wchar_t *wcs);
void Chat(int ID, int Type, const wchar_t *Msg) {


Then you will have to have it catch your desired chat, I would just add this to the end of the existing code, so say you want to have it catch the word "!build_turret" then it will look something like this at the end of the chat hook:


		else if ((stricmp(Msg2, "!Turret") == 0))
Pos = Commands->Get_Position(obj);
  Vector3 Pos.Z += 0;
GameObject *turret = Commands->Create_Object(team==0?"Nod_Turret_MP":"Nod_Turret_MP_Improved",Pos);
				Commands->Disable_Physical_Collisions(turret);
if (team == 1)
					Commands->Set_Player_Type(turret,1);
	}
}



but you must remember to declare the actual player as the object to get the position, so the beginning will look something like:

const char *WideCharToChar(const wchar_t *wcs);
void Chat(int ID, int Type, const wchar_t *Msg) {

GameObject *obj = Get_GameObj(ID);
	int team = Commands->Get_Player_Type(obj);

	if (Type == 2) return;


This would most likely not compile even if you added it to the right places, I don't have the time really to adapt the code to suit SSAOW 1.5, although the only problem will most likely be with the vector3 stuff, as it changed after version 1.5 in the engine.cpp file I think. But it will give you a good idea of how to go about creating your own version.
If you wanted a cost involved you would have to add that too, I would also suggest adding a limit to them too.

Hope that helps you get a good start =]



Re: Scripts Part 3 [message #266666 is a reply to message #266592] Sat, 16 June 2007 10:58 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
hmm ok ty a lot and how about price i wondering about that hahhaaha and what i image is jsut buy any vech that comes out of wf or air and buy turret and gt which u have Wink and any char u turn into on the spot srry lol im just looking at those codes trying to make heads or tails but i acutclly understand some!!!

when i get home later i will add them codes woot!

[Updated on: Sat, 16 June 2007 10:58]

Report message to a moderator

icon12.gif  Re: Scripts Part 3 [message #266668 is a reply to message #266666] Sat, 16 June 2007 11:07 Go to previous messageGo to next message
BlueThen is currently offline  BlueThen
Messages: 2402
Registered: February 2006
Karma: 0
General (2 Stars)
I suppose you got this idea from kam.


I see about 4 other servers using the same idea already. Kamuix's Server is probably the most popular.

When everyone starts doing the same thing, like this for example, it ruins the idea. Maybe you should try and do new things instead, because the idea is already widely used, and you probably wouldn't get very far with this script.
Re: Scripts Part 3 [message #266692 is a reply to message #266666] Sat, 16 June 2007 12:42 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
joe937465 wrote on Sat, 16 June 2007 13:58

hmm ok ty a lot and how about price i wondering about that hahhaaha and what i image is jsut buy any vech that comes out of wf or air and buy turret and gt which u have Wink and any char u turn into on the spot srry lol im just looking at those codes trying to make heads or tails but i acutclly understand some!!!

when i get home later i will add them codes woot!



To make it cost something then add "Commands->Give_Money(obj,2000*-1.0f,false);", i would add it just after the turret is created.

What that line basically says is:

give this amount to the player that said "!turret" (2000 times -1). So it will actually give them -2000 credits. To change the cost just change "2000".


I really don't have time right now to explain how to do the rest. But you should be able to look at the random character crate and see how that changes a player, then adapt the same method I showed you for "!turret" to suit say "!buy_mobius".



Re: Scripts Part 3 [message #266708 is a reply to message #266592] Sat, 16 June 2007 14:07 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
i know kam has this im not going to get all crazy with it jsut a few things its mostly the weapon and char changed im into


another question i looked at random char crate and cant make heads or tails but how can i make it so when u crab a POWERUP changes u into a char?

[Updated on: Sat, 16 June 2007 14:08]

Report message to a moderator

Re: Scripts Part 3 [message #266729 is a reply to message #266592] Sat, 16 June 2007 16:16 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
If it was me I would write a small scripts, something like "void joe_change_char::created(GameObject *obj)"

Which baiscally just done "Change_Character(obj,"presetnamehere");", then when the player picks up the pow just use the "Commands->Attach_Script" command to attach "joe_change_char".

Infact I think that's a pretty dam nice way of doing it.

When I said look at the random char crate I though you would pick up on the "Change_Character" command.



Re: Scripts Part 3 [message #266739 is a reply to message #266592] Sat, 16 June 2007 17:24 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
cool i got another thing i neeed to know a script or find it where if u have a wepaon of a type u cant pick up any other powerup so like if u pick up a laser rilfe in a backpac u cant pick any other pack up with that same weapon i think i said this before soemwhere else 2 hmm
Re: Scripts Part 3 [message #266741 is a reply to message #266592] Sat, 16 June 2007 17:34 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Yeah you did mention it before, I think I replied something like:

Create a script like "void joe_disable_pickup::created(GameObject *obj)" which would have to stop players from picking up new weapons, or perhaps clear there weapon when they do pick a new one up and just re grant the olb one or something. Then attach that script to the player when they pick up the first pow.



Re: Scripts Part 3 [message #266744 is a reply to message #266592] Sat, 16 June 2007 18:15 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
ok well i want the weapon to be a laser rifle so onc eu get that u cant pick up anymore powerups that have laser rifle so can u make that scirtp and how do i add it >.<
Re: Scripts Part 3 [message #266746 is a reply to message #266592] Sat, 16 June 2007 18:37 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
So when you pick up a laser rifle spawn you want them to not be able to pick up any more weapons at all?



Re: Scripts Part 3 [message #266758 is a reply to message #266592] Sat, 16 June 2007 21:25 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
no its like if u pick of a powerup thats has a laser rifle u cant pick up any other powerup that has that laser rifle if u got a laser rifle from the crate or weapon spawn u still cant pick up a powerup

its like no matter how u got that laser rifle if u got it u cant pick up a powerup


if u want lets make it more easy ok.......ummm....if u have a laser rifle u cant pick up any other powerup if it contains another laser rifle OR POW_Medal_Health

understand :S
Re: Scripts Part 3 [message #266764 is a reply to message #266592] Sat, 16 June 2007 21:59 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
also among that script were making how can i add in the random char crate in the source files to be able to pick mutants aswell i just add there names in there?
Re: Scripts Part 3 [message #266798 is a reply to message #266592] Sun, 17 June 2007 04:20 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Just so we're clear, I am not making this for you.

I am unsure if it is possible to do what you want to do with the power ups, I am unsure whether it is possible or not to just have a dude walk through it and nothing happen at all. It would be possible however to respawn it immediately if there was a boolean set or something on the plater to disallow grants after he has picked up the laser rifle. That would be the direction I took...


The mutant thing, I am surprised you haven't been able to work it out for yourself. I mean you have the code right in front of you, you really shoul of been able to figure it out.

{ "Mutant", "CnC_GDI_Mutant_0_Mutant"	}


Anyhow, I think if I keep helping you, then you will never learn anything by yourself. And to be honest you are getting more and more lazy and selfish. Asking someone to pretty much do your mod for you isn't cool man. Asking questions is fine, but just asking "what are teh codes?!?!?! and where to add?!?!?!" just isn't really what this forums is all about. You really need to be applying what you have learned from one thing to another and try yourself instead of asking all the time.



Re: Scripts Part 3 [message #266812 is a reply to message #266592] Sun, 17 June 2007 06:20 Go to previous messageGo to next message
crazfulla is currently offline  crazfulla
Messages: 667
Registered: September 2006
Location: Aotearoa
Karma: 0
Colonel
http://www.n00bless.com/imagehosting/347467534f4b71cb.png

"GEoDLeto wrote:"

so what you are saying it is gonna take even longer before this thing is finished
So the topic title should be changed to: a sucky little "teaser" from C&C Reborn has been released

"halo2pac wrote:"

Unless they are girls, I am not going to bone them.
Re: Scripts Part 3 [message #266814 is a reply to message #266812] Sun, 17 June 2007 06:29 Go to previous messageGo to next message
BlueThen is currently offline  BlueThen
Messages: 2402
Registered: February 2006
Karma: 0
General (2 Stars)
crazfulla wrote on Sun, 17 June 2007 08:20

http://www.n00bless.com/imagehosting/347467534f4b71cb.png

LOL Very Happy
Re: Scripts Part 3 [message #266816 is a reply to message #266814] Sun, 17 June 2007 06:48 Go to previous messageGo to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
Wow- thats pretty good crazfulla. 10 points. Big Grin

http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost
Re: Scripts Part 3 [message #266849 is a reply to message #266592] Sun, 17 June 2007 10:29 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
well i really dont know where to add a code once someones gives it to me,,,,,,,, also i still cant egt random char to choose other chars i added >.<'

and trust me reborn i knew how to add the mutant part i just had to make sure and dont worry i am learning Wink and the laser thing is possible iv seen it on the server i play on but idk how lol

[Updated on: Sun, 17 June 2007 10:34]

Report message to a moderator

Re: Scripts Part 3 [message #266873 is a reply to message #266592] Sun, 17 June 2007 12:16 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
EDIT: NVM

is there any tuts of how to laern c++ for ren?

[Updated on: Sun, 17 June 2007 12:27]

Report message to a moderator

Re: Scripts Part 3 [message #266887 is a reply to message #266873] Sun, 17 June 2007 14:50 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
joe937465 wrote on Sun, 17 June 2007 15:16

EDIT: NVM

is there any tuts of how to laern c++ for ren?


That I am aware of there are no coding tutorials or learning sites for c++ with renegade in mind specifically.

Your best bet is to look at the source code to the present and past SSAOW source code releases and DA releases too.



Re: Scripts Part 3 [message #266888 is a reply to message #266592] Sun, 17 June 2007 14:57 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
ok reborn i still ahve problems

i have put it chars in the random char section and does nto work i set there for hours picking up crates and nothing

char *RandomGDIChar[14][2] =
{
	{ "Officer", "CnC_GDI_MiniGunner_1Off" },
	{ "Rocket Soldier", "CnC_GDI_RocketSoldier_1Off" },
	{ "Sydney", "CnC_Sydney" },
	{ "Deadeye", "CnC_GDI_MiniGunner_2SF" },
	{ "Gunner", "CnC_GDI_RocketSoldier_2SF"	},
	{ "Patch", "CnC_GDI_Grenadier_2SF" },
	{ "Havoc", "CnC_GDI_MiniGunner_3Boss" },
	{ "Prototype Sydney", "CnC_Sydney_PowerSuit" },
	{ "Mobius", "CnC_Ignatio_Mobius" },
	{ "Hotwire", "CnC_GDI_Engineer_2SF" },
	{ "Mutant", "CnC_GDI_Mutant_0_Mutant" },
	{ "Acolyte", "CnC_GDI_Mutant_1Off_Acolyte" },  
	{ "Templar", "CnC_GDI_Mutant_2SF_Templar" },
	{ "Locke", "GDI_Brigadier_Locke" } 
};

char *RandomNodChar[14][2] =
{
	{ "Officer", "CnC_Nod_Minigunner_1Off" },
	{ "Rocket Soldier", "CnC_Nod_RocketSoldier_1Off" },
	{ "Chem	Warrior", "CnC_Nod_FlameThrower_1Off" },
	{ "Blackhand Sniper", "CnC_Nod_Minigunner_2SF" },
	{ "Laser Chaingunner", "CnC_Nod_RocketSoldier_2SF" },
	{ "Stealth Black Hand",	"CnC_Nod_FlameThrower_2SF" },
	{ "Sakura", "CnC_Nod_Minigunner_3Boss" },
	{ "Raveshaw", "CnC_Nod_RocketSoldier_3Boss" },
	{ "Mendoza", "CnC_Nod_FlameThrower_3Boss" },
	{ "Technician",	"CnC_Nod_Technician_0" },
	{ "Mutant", "CnC_Nod_Mutant_0_Mutant" },
	{ "Acolyte", "CnC_Nod_Mutant_1Off_Acolyte" },
	{ "Templar", "CnC_Nod_Mutant_2SF_Templar" },
	{ "Kane", "Nod_Kane_HologramHead_small" }
};



and then i tryd chancing the random vech crate buy choosing same type of vech to new preset like
changing CnC_Nod_Recon_Bike to Nod_Recon_Bike_Player because i had to edit something then did not work so i even chanegs the present in the file NodRVC_recon.txt and GDIRVC_recon.txt

char *RandomVehicle[12][3] =
{
	{ "GDI Humvee",	"humvee", "CnC_GDI_Humm-vee" },
	{ "Nod Buggy", "buggy", "CnC_Nod_Buggy" },
	{ "GDI APC", "gdiapc", "CnC_GDI_APC" },
	{ "Nod APC", "nodapc", "CnC_Nod_APC" },
	{ "GDI MRLS", "mrls", "CnC_GDI_MRLS" },
	{ "Nod Mobile Artillery", "arty", "CnC_Nod_Mobile_Artillery"},
	{ "GDI Medium Tank", "med", "CnC_GDI_Medium_Tank" },
	{ "Nod Light Tank", "lighttank", "CnC_Nod_Light_Tank" },
	{ "Nod Flame Tank", "flamer", "Nod_Flame_Tank_Player" },
	{ "Nod Stealth Tank", "stank", "Nod_Stealth_Tank_Player" },
	{ "GDI Mammoth Tank", "mammy", "CnC_GDI_Mammoth_Tank" },
	{ "Nod Recon Bike", "recon", "Nod_Recon_Bike_Player"}
};

im almost sure all these are right it just seems like the scripts are reading them reborn are we sure we are not missing anything and settings? do they work for you becuase they dont for me

[Updated on: Sun, 17 June 2007 14:59]

Report message to a moderator

Re: Scripts Part 3 [message #266944 is a reply to message #266592] Sun, 17 June 2007 23:27 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
im aslo having toruble making this buy char command i want to be able to do this !Buy(name) or some comamnd and be able to trun into that char right then and there but here somthign new i want it to only let me only do it ingame like only my nick can do it Wink

this is what i gto so far i doute it will wrokb ut im trying
		else if ((stricmp(Msg2, "!Dino") == 0))
Pos = Commands->Get_Position(obj);
  Vector3 Pos.Z += 0;
GameObject *Dino = Commands->Create_Object(team==0?"dino.w3d":"dino.w3d",Pos);
				Commands->JFW_Flying_Infantry(Dino);
if (team == 1)
					Commands->Set_Player_Type(dino,1);
	}
}
const char *WideCharToChar(const wchar_t *wcs);
void Chat(int ID, int Type, const wchar_t *Msg) {
GameObject *obj = Get_GameObj(ID);
	int team = Commands->Get_Player_Type(obj);

	if (Type == 2) return;

[Updated on: Sun, 17 June 2007 23:41]

Report message to a moderator

Re: Scripts Part 3 [message #266945 is a reply to message #266592] Sun, 17 June 2007 23:43 Go to previous messageGo to next message
IronWarrior is currently offline  IronWarrior
Messages: 2460
Registered: November 2004
Location: England UK
Karma: 0
General (2 Stars)
Well even though joe has been asking alot of questions, have to give him credit for trying to mod.
Re: Scripts Part 3 [message #266946 is a reply to message #266592] Sun, 17 June 2007 23:52 Go to previous messageGo to previous message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
i really am trying lot of stuff bleaive it or not hours of messing around and looking over and over but ya LOL
Previous Topic: GB
Next Topic: SSGM, previously SSAOW, Version 2.0
Goto Forum:
  


Current Time: Sat Dec 21 08:12:28 MST 2024

Total time taken to generate the page: 0.01230 seconds