Home » Renegade Discussions » Mod Forum » Infinite Ammo Mod
Infinite Ammo Mod [message #330572] |
Wed, 14 May 2008 17:55 |
GohanX
Messages: 3 Registered: May 2008 Location: CA
Karma: 0
|
Recruit |
|
|
I just downloaded leveledit and the necessary tools to make the mod. Thing is, this is my first time doing this. I know this mod is downloadable, but I just want to try and make it on my own. Any help would be nice.
|
|
|
|
|
|
|
|
|
Re: Infinite Ammo Mod [message #330607 is a reply to message #330572] |
Thu, 15 May 2008 02:56 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
I'm not entirely sure, but I think it's impossible to do what you want in level edit. Someone will most likely prove me wrong now, but I'm pretty sure to do what you want to do you will have to make a new server scripts.dll file.
The infinite ammo is possible in level edit, but it would be just as easy to do that via the API aswell, using this "Enable_Infinite_Ammo();".
To make the no-reload part of the mod I would look at the following functions:
int Get_Current_Bullets(GameObject *obj); //Get loaded bullets for an objects current gun
void Set_Current_Bullets(GameObject *obj,int bullets); //Set current loaded bullets for an object
You could attach a script to a player that has a timer, on the ::Created event it does something like this:
void reb_no_reload::Created(GameObject *obj) {
Max = Get_Current_Clip_Max_Bullets(obj);
Commands->Start_Timer(obj,this,1.0f,1);
}
Then on the timer expired event check what the current bullets are for that weapon, and if they are less then then Max value, set them to Max. Something like this:
void reb_no_reload::Timer_Expired(GameObject *obj, int number) {
if(number == 1){
if(Max > Get_Current_Bullets(obj)){
Set_Current_Bullets(obj, Max);
}
}
}
Obviously Max would have to be defined in the header file, like this:
class reb_no_reload : public ScriptImpClass {
public:
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
int Max
};
This would only work if the player had one weapon only though, if he switched weapons it would mess up. To make it work with all weapons would take a little more effort... You would have to use "Get_Max_Total_Bullets(GameObject *obj,const char *weapon);" of "int Get_Position_Bullets(GameObject *obj,int position);" and the other Bullet functions that require you to tell it what gun you're talking about.
That's the way I would first look at making a no-reload mod, there is probably a better way, but i've just woken up
|
|
|
|
Re: Infinite Ammo Mod [message #330676 is a reply to message #330607] |
Thu, 15 May 2008 13:59 |
|
BlueThen
Messages: 2402 Registered: February 2006
Karma: 0
|
General (2 Stars) |
|
|
reborn wrote on Thu, 15 May 2008 04:56 | I'm not entirely sure, but I think it's impossible to do what you want in level edit. Someone will most likely prove me wrong now, but I'm pretty sure to do what you want to do you will have to make a new server scripts.dll file.
The infinite ammo is possible in level edit, but it would be just as easy to do that via the API aswell, using this "Enable_Infinite_Ammo();".
To make the no-reload part of the mod I would look at the following functions:
int Get_Current_Bullets(GameObject *obj); //Get loaded bullets for an objects current gun
void Set_Current_Bullets(GameObject *obj,int bullets); //Set current loaded bullets for an object
You could attach a script to a player that has a timer, on the ::Created event it does something like this:
void reb_no_reload::Created(GameObject *obj) {
Max = Get_Current_Clip_Max_Bullets(obj);
Commands->Start_Timer(obj,this,1.0f,1);
}
Then on the timer expired event check what the current bullets are for that weapon, and if they are less then then Max value, set them to Max. Something like this:
void reb_no_reload::Timer_Expired(GameObject *obj, int number) {
if(number == 1){
if(Max > Get_Current_Bullets(obj)){
Set_Current_Bullets(obj, Max);
}
}
}
Obviously Max would have to be defined in the header file, like this:
class reb_no_reload : public ScriptImpClass {
public:
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
int Max
};
This would only work if the player had one weapon only though, if he switched weapons it would mess up. To make it work with all weapons would take a little more effort... You would have to use "Get_Max_Total_Bullets(GameObject *obj,const char *weapon);" of "int Get_Position_Bullets(GameObject *obj,int position);" and the other Bullet functions that require you to tell it what gun you're talking about.
That's the way I would first look at making a no-reload mod, there is probably a better way, but i've just woken up
| What? It's easily done in level edit. I think if you set the ammo clip to -1 (or was it 0?) it'd just be infinite.
|
|
|
Re: Infinite Ammo Mod [message #330681 is a reply to message #330676] |
Thu, 15 May 2008 14:02 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
Originally Blue wrote on Thu, 15 May 2008 13:59 |
reborn wrote on Thu, 15 May 2008 04:56 | I'm not entirely sure, but I think it's impossible to do what you want in level edit. Someone will most likely prove me wrong now, but I'm pretty sure to do what you want to do you will have to make a new server scripts.dll file.
The infinite ammo is possible in level edit, but it would be just as easy to do that via the API aswell, using this "Enable_Infinite_Ammo();".
To make the no-reload part of the mod I would look at the following functions:
int Get_Current_Bullets(GameObject *obj); //Get loaded bullets for an objects current gun
void Set_Current_Bullets(GameObject *obj,int bullets); //Set current loaded bullets for an object
You could attach a script to a player that has a timer, on the ::Created event it does something like this:
void reb_no_reload::Created(GameObject *obj) {
Max = Get_Current_Clip_Max_Bullets(obj);
Commands->Start_Timer(obj,this,1.0f,1);
}
Then on the timer expired event check what the current bullets are for that weapon, and if they are less then then Max value, set them to Max. Something like this:
void reb_no_reload::Timer_Expired(GameObject *obj, int number) {
if(number == 1){
if(Max > Get_Current_Bullets(obj)){
Set_Current_Bullets(obj, Max);
}
}
}
Obviously Max would have to be defined in the header file, like this:
class reb_no_reload : public ScriptImpClass {
public:
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
int Max
};
This would only work if the player had one weapon only though, if he switched weapons it would mess up. To make it work with all weapons would take a little more effort... You would have to use "Get_Max_Total_Bullets(GameObject *obj,const char *weapon);" of "int Get_Position_Bullets(GameObject *obj,int position);" and the other Bullet functions that require you to tell it what gun you're talking about.
That's the way I would first look at making a no-reload mod, there is probably a better way, but i've just woken up
| What? It's easily done in level edit. I think if you set the ammo clip to -1 (or was it 0?) it'd just be infinite.
|
i was bored and tryed that,,,,i set -1 on clip and ammo and put 0 on the otehr sniper rifle but yet nothing chnaged
|
|
|
Re: Infinite Ammo Mod [message #330685 is a reply to message #330681] |
Thu, 15 May 2008 14:39 |
|
BlueThen
Messages: 2402 Registered: February 2006
Karma: 0
|
General (2 Stars) |
|
|
SSnipe wrote on Thu, 15 May 2008 16:02 |
Originally Blue wrote on Thu, 15 May 2008 13:59 |
reborn wrote on Thu, 15 May 2008 04:56 | I'm not entirely sure, but I think it's impossible to do what you want in level edit. Someone will most likely prove me wrong now, but I'm pretty sure to do what you want to do you will have to make a new server scripts.dll file.
The infinite ammo is possible in level edit, but it would be just as easy to do that via the API aswell, using this "Enable_Infinite_Ammo();".
To make the no-reload part of the mod I would look at the following functions:
int Get_Current_Bullets(GameObject *obj); //Get loaded bullets for an objects current gun
void Set_Current_Bullets(GameObject *obj,int bullets); //Set current loaded bullets for an object
You could attach a script to a player that has a timer, on the ::Created event it does something like this:
void reb_no_reload::Created(GameObject *obj) {
Max = Get_Current_Clip_Max_Bullets(obj);
Commands->Start_Timer(obj,this,1.0f,1);
}
Then on the timer expired event check what the current bullets are for that weapon, and if they are less then then Max value, set them to Max. Something like this:
void reb_no_reload::Timer_Expired(GameObject *obj, int number) {
if(number == 1){
if(Max > Get_Current_Bullets(obj)){
Set_Current_Bullets(obj, Max);
}
}
}
Obviously Max would have to be defined in the header file, like this:
class reb_no_reload : public ScriptImpClass {
public:
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
int Max
};
This would only work if the player had one weapon only though, if he switched weapons it would mess up. To make it work with all weapons would take a little more effort... You would have to use "Get_Max_Total_Bullets(GameObject *obj,const char *weapon);" of "int Get_Position_Bullets(GameObject *obj,int position);" and the other Bullet functions that require you to tell it what gun you're talking about.
That's the way I would first look at making a no-reload mod, there is probably a better way, but i've just woken up
| What? It's easily done in level edit. I think if you set the ammo clip to -1 (or was it 0?) it'd just be infinite.
|
i was bored and tryed that,,,,i set -1 on clip and ammo and put 0 on the otehr sniper rifle but yet nothing chnaged
|
...way to fail at typing...
also, it works for me...
|
|
|
|
|
Re: Infinite Ammo Mod [message #330746 is a reply to message #330676] |
Fri, 16 May 2008 09:00 |
|
ErroR
Messages: 2984 Registered: March 2008 Location: Moldova
Karma: 0
|
General (2 Stars) |
|
|
Originally Blue wrote on Thu, 15 May 2008 23:59 |
reborn wrote on Thu, 15 May 2008 04:56 | I'm not entirely sure, but I think it's impossible to do what you want in level edit. Someone will most likely prove me wrong now, but I'm pretty sure to do what you want to do you will have to make a new server scripts.dll file.
The infinite ammo is possible in level edit, but it would be just as easy to do that via the API aswell, using this "Enable_Infinite_Ammo();".
To make the no-reload part of the mod I would look at the following functions:
int Get_Current_Bullets(GameObject *obj); //Get loaded bullets for an objects current gun
void Set_Current_Bullets(GameObject *obj,int bullets); //Set current loaded bullets for an object
You could attach a script to a player that has a timer, on the ::Created event it does something like this:
void reb_no_reload::Created(GameObject *obj) {
Max = Get_Current_Clip_Max_Bullets(obj);
Commands->Start_Timer(obj,this,1.0f,1);
}
Then on the timer expired event check what the current bullets are for that weapon, and if they are less then then Max value, set them to Max. Something like this:
void reb_no_reload::Timer_Expired(GameObject *obj, int number) {
if(number == 1){
if(Max > Get_Current_Bullets(obj)){
Set_Current_Bullets(obj, Max);
}
}
}
Obviously Max would have to be defined in the header file, like this:
class reb_no_reload : public ScriptImpClass {
public:
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
int Max
};
This would only work if the player had one weapon only though, if he switched weapons it would mess up. To make it work with all weapons would take a little more effort... You would have to use "Get_Max_Total_Bullets(GameObject *obj,const char *weapon);" of "int Get_Position_Bullets(GameObject *obj,int position);" and the other Bullet functions that require you to tell it what gun you're talking about.
That's the way I would first look at making a no-reload mod, there is probably a better way, but i've just woken up
| What? It's easily done in level edit. I think if you set the ammo clip to -1 (or was it 0?) it'd just be infinite.
|
ya you set it to -1
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Jan 10 22:03:03 MST 2025
Total time taken to generate the page: 0.01186 seconds
|