English Scripting Questions

2,429 replies
Goto Page
To the start Previous 1 2 ... 107 108 109 ... 121 122 Next To the start
28.09.10 04:35:37 pm
Up
Hurri04
Super User
Offline Off
try this:
Code:
1
2
3
4
5
6
on:hit {
     $health=health("self");
     if($health<=25) {
          ai_mode currentid(), "flee", "unit", 1;
     }
}
29.09.10 02:49:47 am
Up
UnIdEnTiFiEd
User
Offline Off
thanks but i want it that it would randomly flee when health low and hitting it. is it possible?
owner of "Eagle mod" and "Survival Stories mod" and Halo Mod for stranded 2. Also make games, http://www.unrealsoftware.de/forum_posts.php?post=249591#jn
29.09.10 09:10:26 am
Up
Psytechnic
User
Offline Off
Hurri04 has written:
try this:
Code:
1
2
3
4
5
6
7
8
9
on:hit {
     $health=health("self");
     if($health<=25) {
          [b]$tmp=random(1,4);
          if($tmp > 2) {[/b]
               ai_mode currentid(), "flee", "unit", 1;
          [b]}[/b]
     }
}


This would give you a 50/50 chance of fleeing.
if($tmp > 3) would give a 25% chance of fleeing
if($tmp > 1) would give a 75% chance of fleeing

alter the $tmp=random(<min>,<max>) values to fine tune if necessary.

If you wanted to make it more realistic, you could use the $health value as an decreasing indicator, like this:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
on:hit {
     $health=health("self");
     $tmp=random(1,4);
     if($health<=15) {
          if($tmp > 1) {
               ai_mode currentid(), "flee", "unit", 1;
          }
     }
     elseif($health<=20) {
          if($tmp > 2) {
               ai_mode currentid(), "flee", "unit", 1;
          }
     }
     elseif($health<=25) {
          if($tmp > 3) {
               ai_mode currentid(), "flee", "unit", 1;
          }
     }
}


This way, as it becomes more damaged, it becomes more inclined to flee...

(Thanks for the cover bloodshot)
edited 1×, last 01.10.10 12:34:09 pm
30.09.10 05:45:26 am
Up
Bloodshot
User
Offline Off
elseif($health<=15) { should be if($health<=15) {
It is better to fail and then succeed than to succeed in the first place IMG:http://i420.photobucket.com/albums/pp281/L31ch3/Userbars/Strandedgamerub.png
30.09.10 08:13:56 am
Up
Psytechnic
User
Offline Off
Bloodshot has written:
elseif($health<=15) { should be if($health<=15) {
]

Yeah, the first 'elseif' should just be 'if', I was copy-pasting-creating. But apart from that, that script should be copy and pastable.

Edited the post.
edited 1×, last 01.10.10 12:34:31 pm
30.09.10 10:23:59 am
Up
UnIdEnTiFiEd
User
Offline Off
thanks! now my boar runs from me!
owner of "Eagle mod" and "Survival Stories mod" and Halo Mod for stranded 2. Also make games, http://www.unrealsoftware.de/forum_posts.php?post=249591#jn
03.10.10 07:00:59 pm
Up
Spicy Night Owl
User
Offline Off
Hey can anyone tell me how to make a grenade script. Here's the code. I want to make it so that when you throw it, he timer starts. Then after the timer ends itll explode. Please copy it and fix it.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
### Grenade
id=127
name=Grenade
group=weapon
icon=gfx\grenade.bmp
model=gfx\clod.b3d
color=0,1000,0
behavior=killthrow
mat=metal
weight=50
info=an explosive grenade
healthchange=0
damage=120
script=start
on:attack1 { 5 second timer script goes here
on:timerend { explosion script goes here
script=end
edited 2×, last 03.10.10 07:23:12 pm
Original creator of Stranded 2 wiki, which I'm more proud of than graduating high school
04.10.10 08:53:53 am
Up
UnIdEnTiFiEd
User
Offline Off
i beleive massive mod has a grenade script.

anyway i was wondering if there is anyway i can do this..


on:start {
tired, bit thirsty and very peckish.
}

something like that would be great please
owner of "Eagle mod" and "Survival Stories mod" and Halo Mod for stranded 2. Also make games, http://www.unrealsoftware.de/forum_posts.php?post=249591#jn
04.10.10 09:03:04 am
Up
Psytechnic
User
Offline Off
on:start {
consume 0, 70, 30, 75;
}

This script would not change health, would decrease hunger by 70 (to 30), decrease thirst by 30 (to 70) and decrease tiredness by 75 (to 25)...

Yep... Just one command.
04.10.10 09:10:51 am
Up
UnIdEnTiFiEd
User
Offline Off
thanks! and how can i make it units attack other units that have the predator behavior, but not me? like the soldior object thing in v666 mod but for units instead.
edited 1×, last 04.10.10 09:28:25 am
owner of "Eagle mod" and "Survival Stories mod" and Halo Mod for stranded 2. Also make games, http://www.unrealsoftware.de/forum_posts.php?post=249591#jn
05.10.10 08:18:01 am
Up
Psytechnic
User
Offline Off
UnIdEnTiFiEd has written:
thanks! and how can i make it units attack other units that have the predator behavior, but not me? like the soldior object thing in v666 mod but for units instead.


Can't be done. I've seen many mentions of this kind of behaviour and it seems that it can't be done by scripting. You'd need to change the source code.
05.10.10 09:34:31 am
Up
UnIdEnTiFiEd
User
Offline Off
damn! but does that mean extension mod has changed the source code?
owner of "Eagle mod" and "Survival Stories mod" and Halo Mod for stranded 2. Also make games, http://www.unrealsoftware.de/forum_posts.php?post=249591#jn
05.10.10 10:22:19 am
Up
Vectarrio
User
Offline Off
If you mean SWNs from v666 mod, then it is projectile command, see Defence Tower script.
05.10.10 10:25:08 pm
Up
Spicy Night Owl
User
Offline Off
Even if MM does have a grenade script, I dont want to download MM, (no matter how good it is), I just need a grenade script please.
Original creator of Stranded 2 wiki, which I'm more proud of than graduating high school
06.10.10 07:05:00 am
Up
UnIdEnTiFiEd
User
Offline Off
well theres none i know of except that one.

btw is there a script that if i shoot something with a certain weapon it will die?

and how do i make the projectile with the script from defence tower be a bullet, not and arrow?
edited 1×, last 06.10.10 07:56:02 am
owner of "Eagle mod" and "Survival Stories mod" and Halo Mod for stranded 2. Also make games, http://www.unrealsoftware.de/forum_posts.php?post=249591#jn
11.10.10 01:56:29 am
Up
Smurf
User
Offline Off
Heres a "Grenade" script.I am not sure if its the same as the Massive mod one.In the "Exploding Bomb" script were it says (timer "self",3000,0,"boom";), the "3000" is the delay time,just set any number here.3000=3 seconds delay.



Paste this in "Items_weapons.inf"

### Grenade
id=520
name=Grenade
group=weapon
icon=gfx\banana.bmp
model=gfx\banana.b3d
fx=16
scale=0.3
mat=stone
weight=100
info=Grenade
behaviour=throw
damage=0
speed=15
drag=1.8
rate=3000
script=start
on:impact {
          
                         $tmp=create ("object",530);
                         setpos " object",$tmp,impact_x(),impact_y(),impact_z();
                         setrot " object",$tmp,0,getyaw("unit",1),0;

               }
          }
     }
script=end

--------------------------------------------------------------------

Paste this in "Objects_Stuff.inf"


### Exploding Bomb
id=530
name=explosive
model=gfx\banana.b3d
fx=16
scale=0.3
group=stuff
icon=gfx\banana.bmp
health=5
color=300,300,300
mat=stone
var=radius,Radius of Explosion,200,0
var=damage,Damage,150,0
script=start


on:create {
     
     timer "self",3000,0,"boom";
     }
     
     on:boom {

     
          explosion getx("self"),gety("self"),getz("self") ,$radius,$damage;
free "self";
     }
script=end

-----------------------------------------------------------------------------------------------------
edited 1×, last 11.10.10 06:54:44 am
11.10.10 08:57:30 am
Up
SLY3152
User
Offline Off
I wanted to interact with the use or player and saw the inputwin command here : http://stranded.unrealsoftware.de/s2_commands.php?list=strings

This inputwincommand is defined in other language which i dont understand ...Please help he and tell how can i use it and store what the user says(types)
edited 2×, last 11.10.10 09:10:54 am
hey my website http://hdfree.weebly.com/
11.10.10 09:01:06 am
Up
UnIdEnTiFiEd
User
Offline Off
SLY3152 has written:
Sorry to disturb but i really need help .... I was making a mod which i left in between but now i want to restart and saw the inputwin command ....


Please help and tell me how to use it and how to store what the user enters.....

.....

I dont understand, any of that! but if you explain more carefully i might be able to help you..
owner of "Eagle mod" and "Survival Stories mod" and Halo Mod for stranded 2. Also make games, http://www.unrealsoftware.de/forum_posts.php?post=249591#jn
11.10.10 09:14:26 am
Up
SLY3152
User
Offline Off
I wanted to interact with the user or player and saw the inputwin command here : http://stranded.unrealsoftware.de/s2_commands.php?list=strings

This inputwincommand is defined in other language which i dont understand ...Please help he and tell how can i use it and store what the user says
hey my website http://hdfree.weebly.com/
To the start Previous 1 2 ... 107 108 109 ... 121 122 Next To the start