Scripting Marines!?

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Feloidea
Posts: 541
Joined: Sat, 25. Apr 09, 11:06
x4

Scripting Marines!?

Post by Feloidea » Sun, 7. Jun 09, 12:03

Hi there guys,

I need some advice for scripting marines with specific skills ( in particular: Each skill on level 3 ). I tried myself and came to the conclusion that I'm a total noob in scripting.

I used the Search but didn't find anything.

Thanks in advance

Feloidea

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Mon, 8. Jun 09, 01:21

Grab the cheat scripts pack and look at the one for adding marines. What you need would be in that script.

jlehtone
Posts: 21801
Joined: Sat, 23. Apr 05, 21:42
x4

Re: Scripting Marines!?

Post by jlehtone » Mon, 8. Jun 09, 08:00

Feloidea wrote:I used the Search but didn't find anything.
Funny, I opened a Sticky thread called [url=http://forum.egosoft.com/viewtopic.php?t=216690]TC Download Library[/url], and told the browser to find "Marine" on page. Two "Marine trainer" entries did turn up right away. If they do not contain code to set skill attributes, ...

And naturally the Cheap pack is in that Library too, and also in tc cheats.

Feloidea
Posts: 541
Joined: Sat, 25. Apr 09, 11:06
x4

Post by Feloidea » Mon, 8. Jun 09, 09:01

Well I didn't thought of a downloadable script, but one I can make and use in short with the ingame-script-editor.

Like the money cheat

add money to player <->
return playership

Just with marines

add <-> marines to playership
set marine skill level fight to <->
set marine skill level mechanics to <->
set marine skill level hacking to <->
set marine skill level engineering to <->
return playership

Just that I need help with the first line.

I apologize for having been clear on that issue.

Thanks

Feloidea

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Mon, 8. Jun 09, 09:02

The cheat script already does that. The best way of finding out how, is look at it.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22201
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 8. Jun 09, 16:38

to add marines, you must first create a passenger on a ship, with there name, and train the passenger to a marine and finally set the marine stats you want.

you need to repeat thatfor each marine you want to create

Feloidea
Posts: 541
Joined: Sat, 25. Apr 09, 11:06
x4

Post by Feloidea » Mon, 8. Jun 09, 19:24

Cycrow wrote:to add marines, you must first create a passenger on a ship, with there name
Great, thanks. How do I do that exactly. I think I found the line doing that but I can ...

1.) Not write, for example Bolo Hi, just BoloHi. That's a bit, ... annoying.

2.) Why define the face and voice, if it's just a common passenger, I mean it's not like that I could speak to them before, or did I miss something?

May someone just give an adaptable example, leaving me only to finally change the name or so. That'd be lovely!

Thanks in advance.

Feloidea

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22201
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 8. Jun 09, 19:53

passengers are used for various things, including pilots for ships and such like, so they need voices and faces for some of these things.

obviously if u just need a marines, it really doesn't matter which ones they use, but they still need to be set.

this might help you, from one of the offical scripts, !galaxyedit.obj.addmarine

Code: Select all

007   |$name = get random name: race=$race
008   |$face =  = random value from 0 to 4 - 1
009   |$voice =  = random value from 0 to 4 - 1
010   |$passenger = [THIS] -> create passenger in ship: name=$name race=$race voice=$voice face=$face
011   |if $passenger -> exists
012   ||if $exp
013   |||$fight =  = random value from 50 to 101 - 1
014   |||$hacking =  = random value from 50 to 101 - 1
015   |||$mechanical =  = random value from 50 to 101 - 1
016   |||$engineering =  = random value from 50 to 101 - 1
017   |||$passenger -> create marine from passenger: fighting=$fight hacking=$hacking mechanical=$mechanical engineering=$engineering
018   ||else
019   |||$passenger -> train passenger to marine
020   ||end
u should be able to create a name with spaces in, if u want to specify the name yourself, you can assign it to a string first

Code: Select all

$name = 'Bolo Hi'
make sure you set the value as a "String" and not a "Varible"

EDIT: if you want to randomise what race they are, u could add this

Code: Select all

$aRaces = create array with arguments, Argon, Boron, Teladi, Paranid, Split
$race = get array size $aRaces
$race = get random number from 0 to $race
$race = $aRaces[$race]

Leeisme0007
Posts: 1
Joined: Thu, 28. Mar 19, 15:40

Re:

Post by Leeisme0007 » Thu, 28. Mar 19, 15:50

Please help me bro it's not working for me im on 2.5 version can u tell me a step by step process please I tried many methods and it won't go through

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”