WeaponSelection.Script.txt
Moderator: English Moderator
- alividerci
- Posts: 363
- Joined: 11 Feb 2012, 07:03
WeaponSelection.Script.txt
how to use WeaponSelection.Script.txt?
Re: WeaponSelection.Script.txt
just look at the script file itself, it's not that complicated
i didn't use it yet but i see these main functions here:
(you can start the selection for specific players, too)
but don't mix this script up with the weapon changing in combo, i'm pretty sure they used an CUILayer ManialinkPage to listen for KeyPressed events
the WeaponSelection script is probably used in elite with the corresponding script setting enabled
i didn't use it yet but i see these main functions here:
Code: Select all
Void Load();
Void Unload();
Code: Select all
Void StartAll();
Void StopAll();
Code: Select all
CSmMode::EWeapon GetWeapon(CSmPlayer _Player);
the WeaponSelection script is probably used in elite with the corresponding script setting enabled
- alividerci
- Posts: 363
- Joined: 11 Feb 2012, 07:03
Re: WeaponSelection.Script.txt
i dont know how it use
Re: WeaponSelection.Script.txt
Steeffeen asked the right question, what are you trying to do?
If you want to display a weapon selection screen as in Siege before the players are spawn, then this library is the right one. If you want to use weapon switching as in Combo, then you'll have to proceed differently. What's your goal?
We use a new feature based on the Action system to avoid lag caused by a netread/netwrite in UI.
If you want to display a weapon selection screen as in Siege before the players are spawn, then this library is the right one. If you want to use weapon switching as in Combo, then you'll have to proceed differently. What's your goal?
Nice try, but that's not it. ^^steeffeen wrote:but don't mix this script up with the weapon changing in combo, i'm pretty sure they used an CUILayer ManialinkPage to listen for KeyPressed events
We use a new feature based on the Action system to avoid lag caused by a netread/netwrite in UI.
Code: Select all
foreach (Event in PendingEvents) {
if (Event.Type == CSmModeEvent::EType::OnActionEvent) {
switch (Event.ActionSlot) {
case CSmModeEvent::EActionSlots::Weapon: DoSomething(); ///< Default: left mouse click
case CSmModeEvent::EActionSlots::Movement: DoSomething(); ///< Default: right mouse click
case CSmModeEvent::EActionSlots::Activable1: DoSomething(); ///< Default: 1
case CSmModeEvent::EActionSlots::Activable2: DoSomething(); ///< Default: 2
case CSmModeEvent::EActionSlots::Activable3: DoSomething(); ///< Default: 3
case CSmModeEvent::EActionSlots::Activable4: DoSomething(); ///< Default: 4
}
}
}
Re: WeaponSelection.Script.txt


is it possible to discard these events preventing that a shot is being fired or a jump is being performed? ^.^
Re: WeaponSelection.Script.txt
Once the Action system will be complete and released, yes.
Re: WeaponSelection.Script.txt
sweetEole wrote:Once the Action system will be complete and released, yes.

- alividerci
- Posts: 363
- Joined: 11 Feb 2012, 07:03
Re: WeaponSelection.Script.txt
i think my goal second!(such as in a combo mode) I want to switch weapon when i running and shooting(and why in pack server we havent royal script)besides i want to use UI in game mode.... where tutorial? thxEole wrote:Steeffeen asked the right question, what are you trying to do?
If you want to display a weapon selection screen as in Siege before the players are spawn, then this library is the right one. If you want to use weapon switching as in Combo, then you'll have to proceed differently. What's your goal?
Nice try, but that's not it. ^^steeffeen wrote:but don't mix this script up with the weapon changing in combo, i'm pretty sure they used an CUILayer ManialinkPage to listen for KeyPressed events
We use a new feature based on the Action system to avoid lag caused by a netread/netwrite in UI.
Code: Select all
foreach (Event in PendingEvents) { if (Event.Type == CSmModeEvent::EType::OnActionEvent) { switch (Event.ActionSlot) { case CSmModeEvent::EActionSlots::Weapon: DoSomething(); ///< Default: left mouse click case CSmModeEvent::EActionSlots::Movement: DoSomething(); ///< Default: right mouse click case CSmModeEvent::EActionSlots::Activable1: DoSomething(); ///< Default: 1 case CSmModeEvent::EActionSlots::Activable2: DoSomething(); ///< Default: 2 case CSmModeEvent::EActionSlots::Activable3: DoSomething(); ///< Default: 3 case CSmModeEvent::EActionSlots::Activable4: DoSomething(); ///< Default: 4 } } }
p.s tutorial by gugli i have seen
Re: WeaponSelection.Script.txt
For a combo style weapon switching your mode will have to be in a TitlePack. Once it's done it's easy to do what you want.
With this you 'll be able to switch weapons while playing. The SetPlayerWeapon uses three parameters:
- The player who want to change of weapon
- The new weapon to use
- Enable/Disable the automatic weapon switch when a player go underground or on a laser pad
Code: Select all
foreach (Event in PendingEvents) {
if (Event.Type == CSmModeEvent::EType::OnActionEvent) {
switch (Event.ActionSlot) {
case CSmModeEvent::EActionSlots::Activable1: {
SetPlayerWeapon(Player, CSmMode::EWeapon::Laser, False);
}
case CSmModeEvent::EActionSlots::Activable2: {
SetPlayerWeapon(Player, CSmMode::EWeapon::Nucleus, False);
}
case CSmModeEvent::EActionSlots::Activable3: {
SetPlayerWeapon(Player, CSmMode::EWeapon::Arrow, False);
}
case CSmModeEvent::EActionSlots::Activable4: {
SetPlayerWeapon(Player, CSmMode::EWeapon::Rocket, False);
}
}
}
}
- The player who want to change of weapon
- The new weapon to use
- Enable/Disable the automatic weapon switch when a player go underground or on a laser pad
- alividerci
- Posts: 363
- Joined: 11 Feb 2012, 07:03
Re: WeaponSelection.Script.txt
hmm, I have always plagued this questions! How for example can not change weapons underground or on the laser platform (optional)
And is it possible to change the rate of recharge for each weapon separately .... speed of regeneration health on a platforms? thx and pls give me answer for my before post question(where royal script in server pack?)
And is it possible to change the rate of recharge for each weapon separately .... speed of regeneration health on a platforms? thx and pls give me answer for my before post question(where royal script in server pack?)
Last edited by alividerci on 16 Apr 2013, 15:20, edited 2 times in total.
Who is online
Users browsing this forum: No registered users and 1 guest