Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Server Side Stuff
Server Side Stuff [message #255939] Thu, 26 April 2007 11:46 Go to next message
Spyder
Messages: 1070
Registered: March 2006
Karma: 0
General (1 Star)
I asked for this multiple times, but I still don't have an answer.

I want to make a powerup that can only be picked up ONCE! When a player dies or purchases a new character he can pick it up again, but I want him to be able to pick it up once per character.

I already tried this with the laser rifle, but that was in a different way. So is there any script or any way to disallow a player to pick up the powerup multiple times with the same character?
Re: Server Side Stuff [message #255949 is a reply to message #255939] Thu, 26 April 2007 12:28 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
The only way I can think about doing this is to modify your own server scripts. (Source is included in SSAOW).

The file inside the source you want is called crates.cpp (or crate.cpp).


Other than that, I haven't tried to modify my server scripts yet, so...Don't ask me how to add a crate...


-Thanks,
MathK1LL
Re: Server Side Stuff [message #255964 is a reply to message #255939] Thu, 26 April 2007 13:27 Go to previous messageGo to next message
Spyder
Messages: 1070
Registered: March 2006
Karma: 0
General (1 Star)
It's not a crate. It's a powerup that belongs to the weapon spawners...
Re: Server Side Stuff [message #255969 is a reply to message #255939] Thu, 26 April 2007 13:37 Go to previous messageGo to next message
Zion is currently offline  Zion
Messages: 2722
Registered: April 2006
Karma: 1
General (2 Stars)
Maybe you can add a script to it that when it's picked up by a player a script on the player activates and disables collisions (if pickups are collidable?) or disables pickups.
Re: Server Side Stuff [message #255992 is a reply to message #255964] Thu, 26 April 2007 14:50 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
darksnipa wrote on Thu, 26 April 2007 14:27

It's not a crate. It's a powerup that belongs to the weapon spawners...



I don't know then..I would make it a crate myself though...

-MathK1LL
Re: Server Side Stuff [message #256017 is a reply to message #255939] Thu, 26 April 2007 18:34 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
If you're making it through scripts you could have a array of boolean for the players and if the player picks up a powerup then the pickedup[playerid] = true and if he tries to pickup another powerup then it checks if pickedup[playerid] == false and if its not then it doesnt give the powerup
Re: Server Side Stuff [message #256323 is a reply to message #255939] Sun, 29 April 2007 02:35 Go to previous messageGo to next message
Spyder
Messages: 1070
Registered: March 2006
Karma: 0
General (1 Star)
What I actually mean is this:
I get the double damage powerup. I attach an infinite ammo laserrifle to it, to make sbh's unable to pick up the powerup. Then I add a sniper rifle, the bugged sniper rifle with infi ammo and a ramjet rifle. I want it this way that sbh's can't pick it up and that players that already have picked it up can't pick it up either because their laser rifle is full. What happens to me is that the powerup ignores the laser rifle and still allows players to pickup the sniper rifle and ramjet rifle. I want the powerup this way that it disallows players to pickup the powerup when they already have a laser rifle.

Is there a script or some other way with this kinda effect (I go tell you in the java way):
Powerup -> Player pickup -> if laserrifle full -> then disallow pickup -> if no laserrifle -> allow pickup -> if then laserrifle -> disallow pickup

If someone knows a way to disallowe players from picking up the powerup when they already ave a laser rifle, please tell me...(I don't want the player to be able to grant any of the other weapons included in the powerup)
Re: Server Side Stuff [message #256333 is a reply to message #255939] Sun, 29 April 2007 03:38 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
You would have to code your own custom scripts, there are no existing ones to do that.

Useful engine calls

bool Has_Weapon(GameObject *obj,const char *weapon);
int Get_Bullets(GameObject *obj,const char *weapon); //Get loaded bullets for a specific gun (if the object doesnt have the gun, return is zero)


http://steamsignature.com/card/1/76561197975867233.png
Re: Server Side Stuff [message #256345 is a reply to message #255939] Sun, 29 April 2007 05:35 Go to previous messageGo to next message
Spyder
Messages: 1070
Registered: March 2006
Karma: 0
General (1 Star)
There must be a way to make this work, because xphaze is having a similar powerup which is useing the same way of making the player unable to pick up a powerup when they already have an infinite ammo laserrifle or other weapon. Tho the xphaze modder is never online and never answers any questions about it (matty3k10 for the persons that know who i'm talking about).

There must be a way to make the player unable to pickup the powerup when they already have picked up a laserrifle. I could be that it's not a script, but a preset I have to set or remove. I already tried this by removing the marker in front of: AlwaysAllowGrant, but that doesn't seem to work either.

Re: Server Side Stuff [message #256346 is a reply to message #255939] Sun, 29 April 2007 05: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)
Yes, they probably wrote their own scripts server side using the functions I just posted for you...

What you can do is respawn the powerup immediately if they were not allowed to pick it up.


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Sun, 29 April 2007 05:50]

Report message to a moderator

Re: Server Side Stuff [message #256538 is a reply to message #255939] Mon, 30 April 2007 12:41 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
This may help
Heres what i came up with really fast, Code maybe inefficent but im in a hurry

const char *Get_Powerup_Weapon(const char *Powerup); //Get the weapon name that a powerup will grant if collected

void Remove_Weapon_Player (GameObject *obj,const char *Weapon_Name){
	int Number_Weapon = Get_Weapon_Count(obj);
	std::string Current_Weapon;
	int Location; 
	for (int i = 1; i <= Number_Weapon; i++) {
		Current_Weapon = Get_Weapon(obj,i);
		if (Current_Weapon.find(Weapon_Name)>= 0) {
			Location = Current_Weapon.find("Weapon");
			if (Location >= 0) Current_Weapon.replace(Location,6,"POW");
			Commands->Give_Powerup(obj,Current_Weapon.c_str(),true);
		}
	}
}

If you're using kak_drop_weapon
So when the player picks up the powerup then do

Remove_Weapon_Player(sender,Get_Powerup_Weapon(Get_Preset_Name(obj)));


if the preset is something you dont want.
Re: Server Side Stuff [message #256540 is a reply to message #255939] Mon, 30 April 2007 12:58 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
using namespace std;
void Remove_Weapon_Player (GameObject *obj,const char *Weapon_Name){
	int Number_Weapon = Get_Weapon_Count(obj);
	string Current_Weapon;
	int Location; 
	for (int i = 1; i <= Number_Weapon; i++) {
	   Current_Weapon = Get_Weapon(obj,i);
	   if (Current_Weapon.find(Weapon_Name)>= 0) {
	      Location = Current_Weapon.find("Weapon");
	      if (Location >= 0) Current_Weapon.replace(Location,6,"POW");
	      Commands->Give_Powerup(obj,Current_Weapon.c_str(),true);
	   }
	}
}



A little bit of a more efficient code. (Yes, I do know that you were in a rush, but heck...Just thought I'd interject this.)


-Thanks,
MathK1LL


EDIT: Btw...darksnipa, do you know ANY C++ or even know how to modify the server scripts? Just a thought that came my way...

[Updated on: Mon, 30 April 2007 12:59]

Report message to a moderator

Re: Server Side Stuff [message #256613 is a reply to message #255939] Tue, 01 May 2007 03:12 Go to previous messageGo to next message
Spyder
Messages: 1070
Registered: March 2006
Karma: 0
General (1 Star)
Uuuhm, no I don't know any C++ or how to edit the server scripts, I only know how to edit my servermod in level edit...
Re: Server Side Stuff [message #256642 is a reply to message #255939] Tue, 01 May 2007 12:18 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
Ohhh i see, umm i dont think it's possible to do what you want through level edit but idk
Re: Server Side Stuff [message #256648 is a reply to message #256642] Tue, 01 May 2007 12:30 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
1st attach a script that counts custom messages, second make the power up attach a timer script when picked up. Make the timer script send a custom to an object with "JFW_Reflect_Message" attached to it. Finally attach the script "JFW_Blow_Up_Obj_On_Custom" to the charter, make the customs match, when the count script reaches two it will send a message to the reflect message box, which will send the message back, and kill you.

I can go into more detail if you would like.


Re: Server Side Stuff [message #256767 is a reply to message #255939] Wed, 02 May 2007 07:25 Go to previous messageGo to next message
matty3k10 is currently offline  matty3k10
Messages: 96
Registered: January 2005
Location: Michigan
Karma: 0
Recruit
Send me your mod and I'll do it for you.

Email it to matty3k10@hotmail.com
Re: Server Side Stuff [message #256777 is a reply to message #255939] Wed, 02 May 2007 08:07 Go to previous message
CarrierII is currently offline  CarrierII
Messages: 3804
Registered: February 2006
Location: England
Karma: 0
General (3 Stars)

"I am pretty much done with Renegade" - MAtty3k10.

No one is ever done with Renegade... lol

Nice to see you're still about.


Renguard is a wonderful initiative
Toggle Spoiler
Previous Topic: scorpia's wwconfig2
Next Topic: Level Edit bug
Goto Forum:
  


Current Time: Sun Nov 10 04:15:55 MST 2024

Total time taken to generate the page: 0.01261 seconds