|
|
|
|
Re: rotate map on keypress
[Re: x10d3]
#209489
06/03/08 12:37
06/03/08 12:37
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
lvl_num = 0;
function abc() { if(lvl_num == 1) { level_load("nextmap.wmb"); } if(lvl_num == 2) { level_load("nextmap.wmb"); } lvl_num += 1; }
function main() { on_q = abc; ...
i didnt realy get what you want but maby this is wat you want else try to explain some more ore wait for other comments
"empty"
|
|
|
Re: rotate map on keypress
[Re: x10d3]
#210108
06/08/08 00:28
06/08/08 00:28
|
Joined: May 2008
Posts: 27
x10d3
OP
Newbie
|
OP
Newbie
Joined: May 2008
Posts: 27
|
If I understand you right I should get the result I want with this.... string level_str1 = <lvl1.WMB>;
string level_str2 = <lvl2.WMB>;
string level_str3 = <lvl3.WMB>;
var lvl_num = "0";
fucntion lvlChng(lvl_num)
{
if(lvl_num == "1")
{
lvl_num = "2";
level_load(level_str2);
}
else if(lvl_num == "2")
{
lvl_num = "3";
level_load(level_str3);
}
else if(lvl_num == "3")
{
lvl_num = "1";
level_load(level_str1);
}
else
{
lvl_num = "1";
level_load(level_str1);
}
return(lvl_num);
}I keep getting an error stating "Parameter Unknown lvl_num bad keyword in {}"
Last edited by x10d3; 06/08/08 00:53.
|
|
|
Re: rotate map on keypress
[Re: x10d3]
#210163
06/08/08 14:09
06/08/08 14:09
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
function abc() { if(lvl_num == 1) { level_load(level_str2); } if(lvl_num == 2) { level_load(level_str3); } lvl_num += 1; lvl_num &= 3;// if lvl_num is 3 lvl_num = 0 }
function main() { on_q = abc; ...
if you are using vars dont use lvl_num = "1"; but lvl_num = 1; same white if same white var var lvl_num = 0;
"" are for strings STRING* lvl_num = "0" str_cpy(lvl_num,"1"); if(str_cmpni(lvl_num,"1");
"empty"
|
|
|
Re: rotate map on keypress
[Re: x10d3]
#210176
06/08/08 17:51
06/08/08 17:51
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
have you included:
#include "acknex.h" #include <default.c>
?
"empty"
|
|
|
Re: rotate map on keypress
[Re: x10d3]
#210195
06/08/08 22:08
06/08/08 22:08
|
Joined: Oct 2007
Posts: 5,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
|
@ flits: i guess he is using. C-script he dont need to include that files? (he defines strings this way:string level_str1 = <lvl1.WMB>; its c-script) @x10d3: everytime you call the function it will oad the next level, make sure you dont change level_num in other parts of the code:
string level_str1 = <lvl1.WMB>;
string level_str2 = <lvl2.WMB>;
string level_str3 = <lvl3.WMB>;
var lvl_num = 1;
fucntion lvlChng()
{
if(lvl_num == 1)//if level_num=1 load level1
{
level_load(level_str1);
level_num=2;
}
else if(lvl_num == 2)
{
level_load(level_str2);
lvl_num = 3;
}
else if(lvl_num == 3)
{
level_load(level_str3);
lvl_num = 1;
}
}
3333333333
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|
|
|
|