Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Help with SSAOW mult. weap. char.
Re: Help with SSAOW mult. weap. char. [message #298178 is a reply to message #297535] Wed, 21 November 2007 21:55 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma:
General (3 Stars)
Fleetatks wrote on Sun, 18 November 2007 21:22

Whitedragon wrote on Sun, 18 November 2007 18:59

M00_Grant_Powerup_Created should work fine. Keep in mind that it takes a powerup preset, NOT a weapon preset. You should also upgrade to SSGM 2.0.2, SSAOW 1.4.1 is very outdated.


It SHOULD work, yes, but it doesn't. I'm thinking it has something to do with what you pick as the primary and secondary weapons because a tutorial at renehelp said f you have the repair gun first, you won't get the pistol and C4. Is there another script that works like M00_Grant_Powerup_Created, but will actually work for any weapon (Yes I know I should be using the power up preset, not the weapon preset)?

I also have a couple other questions:
Can u add (not temp) presets and save it to objects.ddb (then change to .aow,) because temp files are used for making .mix files apparently, but I'm not sure what it would do to the .aow i use in SSAOW.

Will upgrading the SSAOW version actually have any changes in it that will be worth me having to start all over again? (unless I can somehow just update the file by adding to it, rather then replace it.)

And finally, I would like to learn how to get functions such as !buy <Character> to work, if someone could show me an example I could probably figure the rest out on my own..



M00_Grant_Powerup_Created does work. You simply attach it to the preset again and type the POW name in the weapondef input parameter.

I don't know of another script that grants a powerup, but here is a simple one made for solely that purpose. You would have to copy this into the ssaow source code and compile it, then attach the script to the presets in level edit defining the POW you wanted to grant in the "PowerUp" input parameter.


void fleetatks_weapon_grant::Created(GameObject *obj){
const char *weapontogrant = Get_Parameter("PowerUp");
Commands->Give_Powerup(obj,weapontogrant,false);
}


registrant
ScriptRegistrant<fleetatks_weapon_grant> fleetatks_weapon_grant_Registrant("fleetatks_weapon_grant","PowerUp:string");


definition (for the .h file)
class fleetatks_weapon_grant : public ScriptImpClass {
	void Created(GameObject *obj);
};


The buy commands are horrid in my opinion, but they are done with chat hooks. Most people use the LUA plug-in and write the code in LUA, but I have no experiance of this language so I will show you how to do it in C++, which will have more functionality then the LUA plug-in anyway, as you are woring directly with the API.

class mutantChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
Change_Character(obj,"CnC_Nod_Mutant_0_Mutant");
	}
};
ChatCommandRegistrant<mutantChatCommand> mutantChatCommandReg("!mutant",CHATTYPE_TEAM,0,GAMEMODE_ALL);


The preceeding code will be triggered when a player types "!mutant", they will be turned into a mutant character preset from level edit.
However that on its own is a bit crappy, you have no idea what team the player is so typing this may actually change there character to something that isn't supposed to be purchasable on there team.

class mutantChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
float money = Commands->Get_Money(purchaser);
int team = Commands->Get_Player_Type(obj);
Vector3 position = Commands->Get_Position(obj);
if (money >= 150 && team == 0){
Commands->Give_Money(obj,-150,false);
Change_Character(obj,"M09_Spawning_Mutant");
Commands->Set_Position(obj,position);
	}
else {
Console_Input(StrFormat("ppage %d You do not meet the requirements to buy a mutant",ID).c_str());
}
	}
};
ChatCommandRegistrant<mutantChatCommand> mutantChatCommandReg("!mutant",CHATTYPE_TEAM,0,GAMEMODE_ALL);


The preceeding code checks the players current money, and makes sure they are on team 0 (which is Nod) and allows them to buy the mutant if they have 150 credits or more. It will take 150 credits away from them if they do have the money and grant them the mutant. It will also put them back at the same position they was when they typed the command so it will look more like a change of state.

Buying vehichles is similar, only you would use:

GameObject *vehichle = Commands->Create_Object("vehichle preset name in here",position);

However position in this instance is the exact position of the player. so you would want to do something like:

position.X += 2.0f;
position.Z += 2.0f;

after declaring and defining the position. This will make the vehichle get created a little bit above you position and to the side of you. You may need to change those values as I havnt checked they are suitable enough to be far away not for you to get stuck in the vehichle.

If you want to check if the weapons factory is alive or the airstrip before allowing them to buy a vehcihle then you would use this:

"if(Find_Airstrip(0))" and "if(Find_War_Factory(1))", which will return null or 1, this will allow you to not create the object of the weapons fact/strip is dead.

I based all of this on ssgm, so there may be differences in ssaow.



 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: C&C-Renegade-Wallpaper
Next Topic: APB
Goto Forum:
  


Current Time: Thu Nov 28 03:40:40 MST 2024

Total time taken to generate the page: 0.00997 seconds