Page 22 of 59

Posted: 17 Dec 2007, 21:21
by KDR_11k
What kind of question is that? You just make the function return the value 200, that means 200% damage.

Posted: 17 Dec 2007, 21:37
by bobthedinosaur
so
HitByWeaponId(var1posZ,var2posX,id,damage)

var rando

if id == 30 // some weapon that does random damage
(
rando = (Rand( 1, 20 ))*10;
return damage rando; // dis does not make sense
)

Posted: 17 Dec 2007, 22:10
by KDR_11k
Return takes only one parameter.

return rando;

Posted: 17 Dec 2007, 22:17
by bobthedinosaur
oh, thats what i was confused about, thanks kdr

Posted: 19 Dec 2007, 08:02
by hamsate
Argh wrote:I'd suggest, frankly, to start with my "minimal unit" file from NanoBlobs 0.63..
I got the public release version 0.64. Anyways, I looked through some of the scripts for the units and that just confuses me. I only have slight experience with programming, so I can understand parts of it, but I just don't understand. This is probably the next hurdle I have to go through. Anyone supply a tutorial or reference about what all it's about?

Just throwing this question out there, a unit requires a script right?

Posted: 19 Dec 2007, 08:09
by Rubenes
hamsate wrote:
Argh wrote:I'd suggest, frankly, to start with my "minimal unit" file from NanoBlobs 0.63..
I got the public release version 0.64. Anyways, I looked through some of the scripts for the units and that just confuses me. I only have slight experience with programming, so I can understand parts of it, but I just don't understand. This is probably the next hurdle I have to go through. Anyone supply a tutorial or reference about what all it's about?

Just throwing this question out there, a unit requires a script right?
Every unit requires a script, but you can make scripts which do absolutely nothing.

Posted: 19 Dec 2007, 16:21
by KDR_11k
Note that every script must contain at least one function (even if it's a made-up one) and every function must contain at least one command (even if it's just a return 0 or sleep 1), otherwise Scriptor will screw up.

Posted: 19 Dec 2007, 19:22
by [Krogoth86]
Is it possible to have a unit in multiple classes inside the Armor.txt i.e. the Arm Triton for example could be inside a L2Tank and another Amphibious class? Or does this give some errors / conflicts?

Posted: 19 Dec 2007, 19:34
by Peet
Nope, multiple armour classes make no logical sense and thus do not work.

Posted: 19 Dec 2007, 22:51
by [Krogoth86]
Damn - I had hoped that this might work as long as you don't create a group for just a single unit (which has the unit's name) as it's said in the wiki. Something like that would have been nifty...

Posted: 20 Dec 2007, 03:13
by KingRaptor
If a unit has multiple armorclasses it probably just uses the first one in the file or the last one in alphabetical order, not sure which.

Posted: 20 Dec 2007, 03:14
by kiki
Peet wrote:Nope, multiple armour classes make no logical sense and thus do not work.
ditto

Posted: 20 Dec 2007, 12:40
by [Krogoth86]
lbctech wrote:ditto
Well to my mind this perfectly makes sense as you don't really give one unit an armor class (though this is what's done via the engine) but you define damage groups. If you could define groups rather than have to give every unit just one entry you could ease and clean up the process of damage groups for your weapon entries. For example if you want a fake explosion you put the default value high and add an "ALL" damage group which contains all your units so you don't have to list every category you created. This way you could have several groups like "GROUND", "AIR", "BOATS", "SUBS" and on and on. This makes the weapons code much more clean and easy and it's way faster if you would want to change a damage value (as you now have to change it for all other similar groups too). This is just a "cosmetic" nicety of course but I'd be glad to have this...

This gets more annoying if you want a more complex damage behaviour between your units and so you end up with a lot of groups which isn't very nice...

Posted: 20 Dec 2007, 23:19
by hamsate
Rubenes wrote:Every unit requires a script, but you can make scripts which do absolutely nothing.
And so a unit without script won't have animations, correct? It will still be able to just move around? Or does the script have a part in that, too?

Posted: 20 Dec 2007, 23:27
by SinbadEV
default behavior for the suggested "minimal script" would be to slide along the ground, turn in the direction it needs to shoot and shoot from it's base (I think) or something... basically it will show up and move around enough to know you have the texture and scale right.

Posted: 20 Dec 2007, 23:27
by Pressure Line
hamsate wrote:
Rubenes wrote:Every unit requires a script, but you can make scripts which do absolutely nothing.
And so a unit without script won't have animations, correct? It will still be able to just move around? Or does the script have a part in that, too?
it will move around (or not) as defined by the unit.fbi file. iirc the BA adv solars have a more or less blank script.

there is a program called 'lazyscripter' that will generate a template script for you from a 3do model, find, download and use if you really cannot be bothered doing a script. but tbh, unless you are actually going to write a proper script you may as well not bother.

Posted: 20 Dec 2007, 23:29
by kiki
+1 for damage groups. But armor class is different is all I was saying.

Posted: 21 Dec 2007, 00:32
by bobthedinosaur
best resource for scripts is other ones already made, and cut and paste

Posted: 21 Dec 2007, 00:49
by Dragon45
BOB! :D

and yes bob speak truths.

First cut and paste
Then small bits here and there
Then you know enough to build small script on your own
And then with more practice, build large scripts on your own.

Posted: 21 Dec 2007, 09:26
by KDR_11k
I used that TA Design guide. It's not perfect though.