Forum
Stranded II Scripts Scripting Questionsprobably on:kill
1
2
3
4
5
2
3
4
5
on:attack1 	{ 	flash 220,208,196,0.002,0.9; 	create "item",<shell's item ID number>,"self","self"; 	}
something like that
BTW, it seemsfunction randomcreate doesnt work on objects:?:
edited 1×, last 14.03.09 08:24:38 am
1
2
3
2
3
on:use { setat "unit",1,"info",1; }
1
2
3
4
2
3
4
on:start { add "text"; diary "diary"; }
### UMP
id=150
name=H&K UMP-45
group=weapon
icon=gfx\umpicon.bmp
model=gfx\UMP.b3d
scale=0.15
behaviour=gun
range=300
rate=150
mat=metal
weight=250
info= a basic SMG.
damage=15
healthchange=0
script=start
on:attack1 {
flash 255,252,187,5.050,0.1;
create "item",146,"self","self";
if (gety("unit",1)<-15){
skipevent;
speech "negative"; }
if (playergotitem(29)>0) {
local $sht;
$sht++;
if (gety("unit",1)<-15){
skipevent;
speech "negative";
msg "This gun can't",3;
msg "shoot under water!",3;
}elseif ($sht==26){
process "reloading",400;
play "crack2.wav",15;
play "crack1.wav",15;
freevar "$sht";
skipevent;
}else{
if (playergotitem(29)>0) { play "ump_fire.wav"; }
}
}
on:impact {
$tmp=impact_class();
$tmp2=impact_id();
//+100 Bonus Damage on Flesh
if (compare_material($tmp,$tmp2,"flesh")==1){
damage $tmp,$tmp2,100;
//+100 Bonus Damage on Fruit
} elseif (compare_material($tmp,$tmp2,"fruit")==1){
damage $tmp,$tmp2,100;
//+200 Bonus Damage on Glass
} elseif (compare_material($tmp,$tmp2,"glass")==1){
damage $tmp,$tmp2,200;
}
freevar $tmp;
freevar $tmp2;
}
on:inhand {
play "crack1.wav";
}
on:noammo {
speech "negative";
msg "No ammo!",3;
}
script=end
_____________________________________________
Same with another similar gun, it keeps saying on the debug menu that 'on' must not be subordinated to conditions.
One more question , I'm trying to make an item that when you use it, it makes you faster but it ware off after a while but I cant seem to get the free state script to work properly without freeing the state too early. Your help is much apreciated
and pls what i have ti write,when i want a diary entry later in my map?
edited 2×, last 14.03.09 11:54:54 pm
make the diaryscript in a time-trigger
the best effect would probably be when the player gets the shell through store command and then drops it, that the icon flies away Stranded way, but I'm pretty sure it's impossible to script. What you can is either store the item in the player's inventory, use find that will inform the player about finding the item, or spawn it in the player's position, using variables with player's X and Z coordinates, like:
1
$x=getx("unit",1)
1
create "item",146,$x,$z;
-Lemon/lint35
I want to script, when I drop something on something, it makes a teleport, like on the second island ....Can you show me pls?:$
1. first you need to create a text document in the game files. make one in the maps files (mods/sranded II/maps).
2. place this in the text file:
on:start {
ai_stay "self";
}
//~chieftainscript
on:use {
fademusic 10000;
dialogue "start","maps\sales.txt","chieftaindialogue";
}
//~chieftaindialogue
page=start
title=chieftain
text=start
Yo!
Welcome to the gun store, Want to buy some hunting gear? I would be interested in doing business with you!
text=end
button=sell,Yeah, I have something to sell!
button=buy,Show me your goods!
button=nothing,I have no treasures.
button=action:close,I don't want anything!
page=nothing
title=chieftain
text=start
What? No treasures? I take Gold coins,... and I love fried fish by the way! So find something for me!
text=end
button=sell,Maybe I got something.
button=buy,What is your offer?
button=action:close,Bye.
page=sell
title=Trade with chieftain
# fried fish -> Gold
trade=start
sell=90,1
buy=5,1
trade=end
button=buy,I want to buy something.
button=action:close,Bye.
page=buy
title=Trade with chieftain
# Gold -> Bullet
trade=start
sell=5,1
buy=29,10
trade=end
# Gold -> Shotgun
trade=start
sell=5,30
buy=110,1
trade=end
# Gold -> Pistol
trade=start
sell=5,25
buy=58,1
trade=end
button=sell,I have something to sell.
button=action:close,Bye.
3. after you have put this script in the text document; Start up the game and click on editor.
4. just use a small map that you can see at first; Now, click on Units and scroll down to chieftain (40). Click on the chieftain and place him on the island.
5.Click on the chieftain thats on the island, now, click on script, then click on import script and search for the sales.txt that you made in maps.(mods/stranded II/maps). Click on the sales.txt and click the green ok check. Click ok again and the click ok once more.
6. now save and name yor map. You should be able to play this map in single maps section.
*** I hope this helps anyone out that doen't have a clear understanding of the trade script. From this script you can make different varities of trade scripts.
edited 1×, last 20.03.09 01:32:03 am