Forum

> > Stranded II > Scripts > Scripting Questions
Forums overviewStranded II overview Scripts overviewLog in to reply

English Scripting Questions

2,429 replies
Page
To the start Previous 1 277 78 79121 122 Next To the start

old Re: Scripting Questions

Vibhor
User Off Offline

Quote
JadeStone has written
i need on impact to check if the enemy is dead or not i want it to do somthing if its dead.


Event will be best option
on:kill
msg shutdafukup
or something like that
dont forget to put brackets and stuff

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
1
2
3
4
5
6
7
8
on:impact{
	$tmp1=impact_class;
	$tmp2=impact_id;
	if (lives ("$tmp1", $tmp2)==0){
		//What you want to happen
	}
	freevar $tmp1,$tmp2;
}

This should work, but I'm not sure as I haven't been scripting in so long...

old Re: Scripting Questions

Vibhor
User Off Offline

Quote
JadeStone has written
If the enemy is dead when you hit him it does somthing but if its alive it doesnt.


Its fun
it would go like this
on:kill
set $var to 1
and after that
on:hit
if $var==1
then do something

old Re: Scripting Questions

dragoana
User Off Offline

Quote
check if it is alive when you hit it:
1
2
3
4
5
on:hit {
	if(lives("self")==0) { 
		msg "dead"; 
	}
}

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
I thought you were using this script for a projectile. If it is for the lion than Schnapsidee's script will work.

old Re: Scripting Questions

Vibhor
User Off Offline

Quote
JadeStone has written
still doesnt work

its for a weapon


Did you try my hot stuff?
it should work

old Re: Scripting Questions

dragoana
User Off Offline

Quote
if you wrote it in a shooting weapon's script it won't work
either you use Bloodshot's script for the projectile or mine or Vibhor's script for the enemy.

old Re: Scripting Questions

Phyire
User Off Offline

Quote
What does this below mean? I keep getting this on an odd occation in random maps.

---------------------------
Error!
---------------------------
Memory access violation
---------------------------
OK
---------------------------

old Re: Scripting Questions

ohaz
User Off Offline

Quote
a memory access violation occurs when the game trys to read or write on a part of your RAM when it's not allowed to do so, or when the location where it wants to read is empty.
You can't to anything to solve this problem, just save often and hope that it doesn't occure

old Re: Scripting Questions

Lar5
User Off Offline

Quote
Hi! I'm trying to make a good Stranded 2 map, but i dont know how to make the npcs sell things...
How do i do it? Is it? Unit(hempguy)-scripts:

on:use {
page=start
title=Grandpa
text=start
Hey you. How's it going?
text=end
button=trade,I want to trade.
button=action:close,Don't bother me!

page=trade
title=Trade with grandpa
### Hempleaf -> Cookie
trade=start
sell=83,5
buy=66,1
trade=end
### Hempleaf -> Trunk
trade=start
sell=83,10
buy=7,1
trade=end
### Hempleaf -> Grapes
trade=start
sell=83,15
buy=45,3
trade=end
### Hempleaf -> Grain Pile
trade=start
sell=83,15
buy=42,3
trade=end
### Hempleaf -> Plums
trade=start
sell=83,15
buy=116,3
trade=end
### Hempleaf -> Coconut
trade=start
sell=83,20
buy=27,3
trade=end
### Hempleaf -> Banana
trade=start
sell=83,20
buy=14,3
trade=end
### Hempleaf -> Cacao Fruit
trade=start
sell=83,25
buy=67,3
trade=end
### Hempleaf -> Coffee Fruits
trade=start
sell=83,25
buy=70,3
trade=end
button=action:close,Cheers!
}

old Re: Scripting Questions

Vibhor
User Off Offline

Quote
Phyire has written
Is there NO way i can find out where this Memmory access violation originates from?

Nope
just avoid areas which takes higher memory and CPU speed
To the start Previous 1 277 78 79121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview