Forum

> > Stranded II > General > skill mod help
Forums overviewStranded II overviewGeneral overviewLog in to reply

English skill mod help

9 replies
To the start Previous 1 Next To the start

old skill mod help

The mad man
User Off Offline

Quote
How do you make your skill affect your stats like health, player speed, store, maxweight, etc.

I've been trying to do this for a while but can't,
Thanks

old Re: skill mod help

DontKnowToScript
User Off Offline

Quote
player_speed value
maxhealth "unit",1,value
you cant make maxweight,because it's a definiton,and its CANT be contained in a script.
edited 1×, last 29.09.08 03:19:04 pm

old Re: skill mod help

The mad man
User Off Offline

Quote
I still can't get it.
uh here is what i have in unit.inf under script=start

on:start {
     event "iskill_Survival","global";

     on:changeday {
               event "iskill_Survival","global";     
                    }
               if (skillvalue("survivor")>=160){
               player_store=125;
               player_maxweight=35000;
                    }
...
               elseif (skillvalue("survivor")>=40){
               player_store=115;
                    }
...
               elseif (skillvalue("survivor")>=2){
               player_store=105;
                    }
          }

and in game.inf i got

     on:skill_Survival { msgbox "Skill Info","sys/skillinfos/survival.inf"; }
     on:iskill_Survival {
          incskill "Survival",1,"Survival";
          $tmp=skillvalue("Survival");
          if ($tmp==2){ event "skillup","global";}
          if ($tmp==5){ event "skillup","global";}
          if ($tmp==10){ event "skillup","global";}
          if ($tmp==20){ event "skillup","global";}
          if ($tmp==40){ event "skillup","global";}
          if ($tmp==80){ event "skillup","global";}
          if ($tmp==160){ event "skillup","global";}
     }

Sorry
edited 1×, last 29.09.08 02:48:13 pm

old Re: skill mod help

DontKnowToScript
User Off Offline

Quote
1.line after event "iskill_survival","global" make }.
2.check all the script for mismatched brackets
3.have you done the skill info in the folder "skillinfos"?

old Re: skill mod help

The mad man
User Off Offline

Quote
Yeah i did the skillinfos thing.
it seems like theres something wrong with the if commands because, My skill level goes up each day and i can read the skill help, I just can't change the stats.

Thanks for your help

old Re: skill mod help

DontKnowToScript
User Off Offline

Quote
strange........
maybe try to use variables (e.g $speed=50 *normal speed*) and when the skillup event occurs,just make $speed +=10 or so.but i dont think it work well,though.
but try it

old Re: skill mod help

The mad man
User Off Offline

Quote
I don't really know t
this is the whole Unit player script
Sorry about this but thanks for your help


### Player
#ID 1 IS RESERVED FOR THE PLAYER UNIT!
id=1
name=Player
group=human
icon=gfx\strandedguy.bmp
model=gfx\strandedguy.b3d
colxr=8
colyr=17
speed=1.6
eyes=16
store=100
health=100
damage=3
attackrange=45
maxweight=25000
healthchange=0
script=start

on:start {
     event "iskill_Survival","global";
          }
     on:changeday {
               event "iskill_Survival","global";     
               
               $surevskill=skillvalue("survivor");
     
               if ($surevskill>=160){
               player_store=125;
               player_maxweight=35000;
                    }

               elseif ($surevskill>=80){
               player_maxweight=32500;
                    }

               elseif ($surevskill>=40){
               player_store=115;
                    }

               elseif ($surevskill>=20){
               player_maxweight=30000;
                    }

               elseif ($surevskill>=10){
               player_damage=4;
               player_maxweight=27500;
                    }

               elseif ($surevskill>=5){
               player_health=110;
                    }

               elseif ($surevskill>=2){
               player_store=105;
               msg "dhh";
                    }
          }

     on:kill {
          $rnd=random(1,3);
          if ($rnd==1){ play "human_die1.wav"; }
          if ($rnd==2){ play "human_die2.wav"; }
          if ($rnd==3){ play "human_die3.wav"; }
          if (currentid()!=1){
               event "iskill_hunt","global";
          }
          freevar $rnd;
     }
     
     on:cease_healthpotion {
          freestate "unit",1,16;
          msg "The potion has",3;
          msg "lost its effects.",3;
          play "fxdrain.wav";
     }

     on:cease_speedpotion {
          freestate "unit",1,9;
          msg "The potion has",3;
          msg "lost its effects.",3;
          play "fxdrain.wav";
     }

     on:cease_immortalpotion {
          freestate "unit",1,17;
          msg "The potion has",3;
          msg "lost its effects.",3;
          play "fxdrain.wav";
     }
     on:release_excrement {
          $id=create("item",72);
          play "fart.wav";
     }
     
     on:skill_Survival { msgbox "Skill Info","sys/skillinfos/survival.inf"; }
     on:iskill_Survival {
          incskill "Survival",1,"Survival";
          $tmp=skillvalue("Survival");
          if ($tmp==2){ event "skillup","global";}
          if ($tmp==5){ event "skillup","global";}
          if ($tmp==10){ event "skillup","global";}
          if ($tmp==20){ event "skillup","global";}
          if ($tmp==40){ event "skillup","global";}
          if ($tmp==80){ event "skillup","global";}
          if ($tmp==160){ event "skillup","global";}
     }


script=end

oh does it matter where the end bit is?

Thanks again.
edited 1×, last 29.09.08 04:55:12 pm

old Re: skill mod help

Raven Shadow
User Off Offline

Quote
I haven't read this whole thread, so if i repeat
something already said, i appologize.

The S2Ext mod dabbles in increasing player stats,
such as damage, carrying capacity, speed, jump height, etc. and I've played with it a little, and come a couple
conclusions.

1) It's best if all stat effecting scripts are declared as
global scripts, which means they should be in the
game.inf file.

2) S2 doesn't save stats in the save file, the game
assumes the player's stats are unchanging, so you have
to include script to reload stat values when a save file is
loaded.

Remember, the on:start event only fires when a new
map is starting for the first time, and the on:load event
fires when a new map is loading AND when a save file is
loaded, so reload stat values with the on:load event.

Also keep in mind that you can have custom global
scripts load in custom game_(modname).inf files instead
ofcluttering up the main game.inf file.

Here's a simple sample script that will increase the player's weight capicity on a daily basis and will make
sure the stat is reloaded when a save file is loaded,
making sure the value is always correct instead of waiting for the next on:changeday to fire:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
script=start
on:changeday {
	if ($player_maxweight==0){
		$player_maxweight=25000;
	}
	if ($player_maxweight<75000) {
		$player_maxweight+=500;
		player_maxweight $player_maxweight;
	}
}

on:load {
	if ($player_maxweight==0){
		$player_maxweight=25000;
	}
	player_maxweight $player_maxweight;
}
script=end

old Re: skill mod help

DontKnowToScript
User Off Offline

Quote
thats what i've looking for. im making jumping skill in destructive mod. so i will use a similar method for it.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewStranded II overviewForums overview