WeaponSelection.Script.txt
Posted: 14 Apr 2013, 05:58
how to use WeaponSelection.Script.txt?
Code: Select all
Void Load();
Void Unload();
Code: Select all
Void StartAll();
Void StopAll();
Code: Select all
CSmMode::EWeapon GetWeapon(CSmPlayer _Player);
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
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
}
}
}
sweetEole wrote:Once the Action system will be complete and released, yes.
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 } } }
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);
}
}
}
}