Forum

> > Stranded II > General > A variable problem
Forums overviewStranded II overviewGeneral overviewLog in to reply

English A variable problem

2 replies
To the start Previous 1 Next To the start

old A variable problem

thecode
User Off Offline

Quote
Hello

I have creat a new skill and i have edit the game file:
1
2
3
4
5
6
on:skill_new { msgbox "Skill Info","sys/skillinfos/new.inf"; }
	on:iskill_new {
		incskill "new",1,"new skill";
		$tmp=skillvalue("new");
		if ($tmp==50){ event "newskillup","global";}
}
1
2
3
4
5
6
7
on:newskillup{
	   msg "Skill improved!",1;
	   play "fx_spell.wav";
	   corana getx("unit",1),getz("unit,1"),40,255,250,0;
	   $newskillvar++;
	    $newskilltime=$newskilltime+1000;
	   }

When I tested in game, I noted that my variable is not increasing.

I then display a message through a "msg" to display the variable and to my surprise, the variables are not changed!
they are a 0

Why?

old Re: A variable problem

DannyDeth
User Off Offline

Quote
Now, lets see...

There are a few possible reasons here:

1. ( i noticed this first ) Have you create the sys/skillinfos/new.inf? If not that may be the problem

2. ( moving onto the scond code since the first if ok so far ) Now this code looks a little shifty to me hmmmm...

what do you mean by corana? And second of all, have you created a trigger/event ingame to start this whole conundrum?

Maybe try this code:
1
2
3
4
5
on:iskill_new { msgbox "Skill Info","sys/skillinfos/new.inf";
	incskill "new",1,"new skill";
	$tmp=skillvalue("new");
	if ($tmp==50){ ëvent "skillup","global"; }
}

I say that because there should be no need to use 2 on:iskill_new events to do 1 thing, and becasue the event "skillup"is a event that does the whole "play fx_spell.wav" and shows the whole light flash thingy. What i dont understand is the part where it says:
1
2
$newskillvar++;
      $newskilltime=$newskilltime+1000;
Now i must ask what this is for? plus the reason that the "newskilltime"doesnt work is because it does not exist before you add the 1000, so its going to go like this if you just play it like this:

the sequence will be:
1000
3000
5000
etc, so there is no point anyways, tell more about it and we might be able to help you.

EDIT: first the variable will be a zero thanks to ur crappy output, try using the event 3 or four times if it still sint then say

old Re: A variable problem

thecode
User Off Offline

Quote
EDIT:
Problem resolved!

I had to put the variables before:
corana getx("unit",1),getz("unit,1"),40,255,250,0;
edited 1×, last 19.09.10 03:53:36 pm
To the start Previous 1 Next To the start
Log in to replyGeneral overviewStranded II overviewForums overview