- Joined
- Sep 9, 2007
- Messages
- 6,759
JASS:
//==================================================================================================
//
// Generated Map Script
//
// Name: Eine Karte f??r StarCraft II
// Author: Unbekannter Autor
//
//==================================================================================================
include "TriggerLibs/NativeLib"
//--------------------------------------------------------------------------------------------------
// Library: CustomShooter
//--------------------------------------------------------------------------------------------------
// Trigger Declarations
trigger lib1_gt_CS_Init;
trigger lib1_gt_CS_Move;
trigger lib1_gt_CS_Key_Press;
trigger lib1_gt_CS_Key_Release;
// Triggers
//--------------------------------------------------------------------------------------------------
// Trigger: CS_Init
//--------------------------------------------------------------------------------------------------
bool lib1_gt_CS_Init_Func (bool testConds, bool runActions) {
int auto629881B1_as;
int auto629881B1_ae;
int auto629881B1_ai;
// Actions
if (!runActions) {
return true;
}
auto629881B1_as = 1;
auto629881B1_ae = PlayerGroupCount(PlayerGroupAll());
auto629881B1_ai = 1;
gv_cS_I = auto629881B1_as;
if (auto629881B1_ai > 0 || (auto629881B1_ai == 0 && auto629881B1_as < auto629881B1_ae)) {
while (gv_cS_I <= auto629881B1_ae) {
if ((PlayerStatus(gv_cS_I) == c_playerStatusActive) && (PlayerType(gv_cS_I) == c_playerTypeUser)) {
libNtve_gf_CreateUnitsAtPoint2(1, "Marine", 0, gv_cS_I, PointFromId(1));
gv_cS_Units[gv_cS_I] = UnitLastCreated();
}
else {
}
gv_cS_I = gv_cS_I + auto629881B1_ai;
}
}
else if (auto629881B1_ai < 0 || (auto629881B1_ai == 0 && auto629881B1_ae < auto629881B1_as)) {
while (gv_cS_I >= auto629881B1_ae) {
if ((PlayerStatus(gv_cS_I) == c_playerStatusActive) && (PlayerType(gv_cS_I) == c_playerTypeUser)) {
libNtve_gf_CreateUnitsAtPoint2(1, "Marine", 0, gv_cS_I, PointFromId(1));
gv_cS_Units[gv_cS_I] = UnitLastCreated();
}
else {
}
gv_cS_I = gv_cS_I + auto629881B1_ai;
}
}
TimerStart(gv_cS_Timer, 5.0, false, c_timeGame);
return true;
}
//--------------------------------------------------------------------------------------------------
void lib1_gt_CS_Init_Init () {
lib1_gt_CS_Init = TriggerCreate("lib1_gt_CS_Init_Func");
TriggerAddEventMapInit(lib1_gt_CS_Init);
}
//--------------------------------------------------------------------------------------------------
// Trigger: CS_Move
//--------------------------------------------------------------------------------------------------
bool lib1_gt_CS_Move_Func (bool testConds, bool runActions) {
int auto5F6F8960_as;
int auto5F6F8960_ae;
int auto5F6F8960_ai;
// Actions
if (!runActions) {
return true;
}
auto5F6F8960_as = 1;
auto5F6F8960_ae = PlayerGroupCount(PlayerGroupAll());
auto5F6F8960_ai = 1;
gv_cS_I = auto5F6F8960_as;
if (auto5F6F8960_ai > 0 || (auto5F6F8960_ai == 0 && auto5F6F8960_as < auto5F6F8960_ae)) {
while (gv_cS_I <= auto5F6F8960_ae) {
if ((gv_cS_KeyStates[][gv_cS_KEY_UP] == 1)) {
PlayerModifyPropertyInt(gv_cS_I, c_playerPropMinerals, c_playerPropOperAdd, 1);
}
else {
}
if ((gv_cS_KeyStates[][gv_cS_KEY_DOWN] == 1)) {
PlayerModifyPropertyInt(gv_cS_I, c_playerPropMinerals, c_playerPropOperSubtract, 1);
}
else {
}
if ((gv_cS_KeyStates[][gv_cS_KEY_LEFT] == 1)) {
PlayerModifyPropertyInt(gv_cS_I, c_playerPropVespene, c_playerPropOperAdd, 1);
}
else {
}
if ((gv_cS_KeyStates[][gv_cS_KEY_RIGHT] == 1)) {
PlayerModifyPropertyInt(gv_cS_I, c_playerPropVespene, c_playerPropOperSubtract, 1);
}
else {
}
gv_cS_I = gv_cS_I + auto5F6F8960_ai;
}
}
else if (auto5F6F8960_ai < 0 || (auto5F6F8960_ai == 0 && auto5F6F8960_ae < auto5F6F8960_as)) {
while (gv_cS_I >= auto5F6F8960_ae) {
if ((gv_cS_KeyStates[][gv_cS_KEY_UP] == 1)) {
PlayerModifyPropertyInt(gv_cS_I, c_playerPropMinerals, c_playerPropOperAdd, 1);
}
else {
}
if ((gv_cS_KeyStates[][gv_cS_KEY_DOWN] == 1)) {
PlayerModifyPropertyInt(gv_cS_I, c_playerPropMinerals, c_playerPropOperSubtract, 1);
}
else {
}
if ((gv_cS_KeyStates[][gv_cS_KEY_LEFT] == 1)) {
PlayerModifyPropertyInt(gv_cS_I, c_playerPropVespene, c_playerPropOperAdd, 1);
}
else {
}
if ((gv_cS_KeyStates[][gv_cS_KEY_RIGHT] == 1)) {
PlayerModifyPropertyInt(gv_cS_I, c_playerPropVespene, c_playerPropOperSubtract, 1);
}
else {
}
gv_cS_I = gv_cS_I + auto5F6F8960_ai;
}
}
return true;
}
//--------------------------------------------------------------------------------------------------
void lib1_gt_CS_Move_Init () {
lib1_gt_CS_Move = TriggerCreate("lib1_gt_CS_Move_Func");
TriggerAddEventTimer(lib1_gt_CS_Move, gv_cS_Timer);
}
//--------------------------------------------------------------------------------------------------
// Trigger: CS_Key_Press
//--------------------------------------------------------------------------------------------------
bool lib1_gt_CS_Key_Press_Func (bool testConds, bool runActions) {
// Actions
if (!runActions) {
return true;
}
if ((EventKeyPressed() == c_keyUp)) {
gv_cS_KeyStates[EventPlayer()][gv_cS_KEY_UP] = 1;
}
else {
if ((EventKeyPressed() == c_keyDown)) {
gv_cS_KeyStates[EventPlayer()][gv_cS_KEY_DOWN] = 1;
}
else {
if ((EventKeyPressed() == c_keyRight)) {
gv_cS_KeyStates[EventPlayer()][gv_cS_KEY_RIGHT] = 1;
}
else {
if ((EventKeyPressed() == c_keyLeft)) {
gv_cS_KeyStates[EventPlayer()][gv_cS_KEY_LEFT] = 1;
}
else {
}
}
}
}
return true;
}
//--------------------------------------------------------------------------------------------------
void lib1_gt_CS_Key_Press_Init () {
lib1_gt_CS_Key_Press = TriggerCreate("lib1_gt_CS_Key_Press_Func");
TriggerAddEventKeyPressed(lib1_gt_CS_Key_Press, c_playerAny, c_keyUp, true, c_keyModifierStateIgnore, c_keyModifierStateIgnore, c_keyModifierStateIgnore);
TriggerAddEventKeyPressed(lib1_gt_CS_Key_Press, c_playerAny, c_keyRight, true, c_keyModifierStateIgnore, c_keyModifierStateIgnore, c_keyModifierStateIgnore);
TriggerAddEventKeyPressed(lib1_gt_CS_Key_Press, c_playerAny, c_keyLeft, true, c_keyModifierStateIgnore, c_keyModifierStateIgnore, c_keyModifierStateIgnore);
TriggerAddEventKeyPressed(lib1_gt_CS_Key_Press, c_playerAny, c_keyDown, true, c_keyModifierStateIgnore, c_keyModifierStateIgnore, c_keyModifierStateIgnore);
}
//--------------------------------------------------------------------------------------------------
// Trigger: CS_Key_Release
//--------------------------------------------------------------------------------------------------
bool lib1_gt_CS_Key_Release_Func (bool testConds, bool runActions) {
// Actions
if (!runActions) {
return true;
}
if ((EventKeyPressed() == c_keyUp)) {
gv_cS_KeyStates[EventPlayer()][gv_cS_KEY_UP] = 0;
}
else {
if ((EventKeyPressed() == c_keyDown)) {
gv_cS_KeyStates[EventPlayer()][gv_cS_KEY_DOWN] = 0;
}
else {
if ((EventKeyPressed() == c_keyRight)) {
gv_cS_KeyStates[EventPlayer()][gv_cS_KEY_RIGHT] = 0;
}
else {
if ((EventKeyPressed() == c_keyLeft)) {
gv_cS_KeyStates[EventPlayer()][gv_cS_KEY_LEFT] = 0;
}
else {
}
}
}
}
return true;
}
//--------------------------------------------------------------------------------------------------
void lib1_gt_CS_Key_Release_Init () {
lib1_gt_CS_Key_Release = TriggerCreate("lib1_gt_CS_Key_Release_Func");
TriggerAddEventKeyPressed(lib1_gt_CS_Key_Release, c_playerAny, c_keyUp, false, c_keyModifierStateIgnore, c_keyModifierStateIgnore, c_keyModifierStateIgnore);
TriggerAddEventKeyPressed(lib1_gt_CS_Key_Release, c_playerAny, c_keyRight, false, c_keyModifierStateIgnore, c_keyModifierStateIgnore, c_keyModifierStateIgnore);
TriggerAddEventKeyPressed(lib1_gt_CS_Key_Release, c_playerAny, c_keyLeft, false, c_keyModifierStateIgnore, c_keyModifierStateIgnore, c_keyModifierStateIgnore);
TriggerAddEventKeyPressed(lib1_gt_CS_Key_Release, c_playerAny, c_keyDown, false, c_keyModifierStateIgnore, c_keyModifierStateIgnore, c_keyModifierStateIgnore);
}
void lib1_InitTriggers () {
lib1_gt_CS_Init_Init();
lib1_gt_CS_Move_Init();
lib1_gt_CS_Key_Press_Init();
lib1_gt_CS_Key_Release_Init();
}
//--------------------------------------------------------------------------------------------------
// Library Initialization
//--------------------------------------------------------------------------------------------------
void lib1_InitLib () {
lib1_InitTriggers();
}
//--------------------------------------------------------------------------------------------------
// Library Initialization
//--------------------------------------------------------------------------------------------------
void InitLibs () {
libNtve_InitLib();
lib1_InitLib();
}
//--------------------------------------------------------------------------------------------------
// Global Variables
//--------------------------------------------------------------------------------------------------
timer gv_cS_Timer;
unit[13] gv_cS_Units;
int gv_cS_I;
int[13][5] gv_cS_KeyStates;
int gv_cS_KEY_DOWN;
int gv_cS_KEY_UP;
int gv_cS_KEY_LEFT;
int gv_cS_KEY_RIGHT;
void InitGlobals () {
int init_i;
int init_j;
gv_cS_Timer = TimerCreate();
init_i = 0;
while (init_i <= 12) {
gv_cS_Units[init_i] = null;
init_i = init_i + 1;
}
gv_cS_I = 0;
init_i = 0;
while (init_i <= 12) {
init_j = 0;
while (init_j <= 4) {
gv_cS_KeyStates[init_i][init_j] = 0;
init_j = init_j + 1;
}
init_i = init_i + 1;
}
gv_cS_KEY_DOWN = 1;
gv_cS_KEY_UP = 2;
gv_cS_KEY_LEFT = 3;
gv_cS_KEY_RIGHT = 4;
}
//--------------------------------------------------------------------------------------------------
// Map Initialization
//--------------------------------------------------------------------------------------------------
void InitMap () {
InitLibs();
InitGlobals();
}
I don't get why it doesn't compile. It says
Syntax Error:
JASS:
gv_cS_I = auto629881B1_as;
Edit:
Never mind, I fixed, I made the variables local instead of globals.