Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 08/21/07 22:08

ookami
Member
From: Mississippi, USA
Registered: 08/20/07

Command line descriptions

Is there a complete list of all of the commands and functions, as one would use in Dev Mode or whilst scripting?
Or should I lurk more?

Offline

#2 08/22/07 04:08

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Command line descriptions

Preset variables and functions: http://wiki.oni2.net/index.php/BSL:Preset
Preset variables (mostly done): http://wiki.oni2.net/index.php/BSL:Variables
Preset functions (incomplete): http://wiki.oni2.net/index.php/BSL:Functions
Preset functions (work in progress): http://wiki.oni2.net/index.php/Sandbox
Overview @ Oni Stuff: http://www6.fh-eberswalde.de/user/dkrie … mmands.htm

Last edited by geyser (08/22/07 04:08)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#3 08/22/07 11:08

ookami
Member
From: Mississippi, USA
Registered: 08/20/07

Re: Command line descriptions

Aha. Thank you.

Offline

#4 08/25/07 18:08

ookami
Member
From: Mississippi, USA
Registered: 08/20/07

Re: Command line descriptions

Ok, I need help. I've been playing around in Dev Mode, trying to learn what different functions do, and while I can do some things, other commands have no effect, or I can't seem to get the syntax right. I can't seem to input floats or bools; and some commands that wouldn't seem to need such input still don't have an effect. For example:

Some examples:

> ai2_shownames -- Does nothing for me. Also tried putting in "ai2_shownames 0 1"
> ai2_ignoreplayer konoko -- No effect; even if I use char_0.
> chr_location_settocamera demo3 -- Does nothing.
> chr_location demo3 ???? -- What is the syntax for putting in coordinates?

While I'm at it I wish to inquire about flags. I cannot turn them on to see them; nor do I know how to place them.

Thanks in advance to whoever answers this.

Offline

#5 08/25/07 19:08

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Command line descriptions

To avoid further confusion: are you on a PC? The biggest difference between the PC and Mac versions is in BSL, as explained here: http://wiki.oni2.net/index.php/BSL:Preset
You shouldn't have any trouble entering floats or bools. Just enter "true" or "3.14" at the console and you should see messages like "bool: true" and "float: 3.14" appear.
Booleans are a bit messy because of how they are implemented, but most of the time you'll be fine if you use 0 and 1: those are integers, but they are cast into bools.

As for your examples, I suggest you mind the distinction between functions and variables. People sometimes call both of them "commands", which introduces confusion.
Here you can see a rather complete overview of what variables are and how they work: http://wiki.oni2.net/index.php/BSL:Variables
The page about functions is not finished, but you can get an idea by looking here: http://wiki.oni2.net/index.php/BSL:Functions

Specifically:
ai2_shownames is a variable (a boolean). You can either read its value (e.g., enter "ai2_shownames" at the console), or set it with an assignment: ai2_shownames= 1;
ai2_ignore_player is also a variable (BTW, be careful about the spelling: you forgot the underscore). Usually it's 0 (false) so you'd want to type: ai2_ignore_player= 1;
The semicolon is not necessary as long as you put one statement per line. If you put several statements on a line, you have to use strong syntax instead of whitespace.

You seem to be confused about how you can or can't refer to Konoko. Konoko's name is unique and depends on the chapter: it doesn't have to be "konoko" or "char_0".

chr_location and chr_location_settocamera are functions. They use the character ID to address characters. The ID is attributed in the order the characters were spawned.
Konoko's ID will always be 0, the ID of the first spawned char will be 1, etc. The IDs are dynamic, i.e., a dead character frees its ID for use by chars spawned afterwards.
These IDs are not to be confused with the "script IDs". Most AI-related functions accept either a name or a "script ID", Konoko's "script ID" also being 0 no matter where.
chr_location_settocamera doesn't have any arguments except the ID of the character, and chr_location takes 3 additional arguments: the XYZ coordinates of the target.
dump_docs and ssg's page usually provide complete information on a function's signature. Our example is: chr_location chr_index:int [loc_x:float loc_y:float loc_z:float]

As for the flags, they used to be shown by setting show_flags to 1, but right now the only ways to see them are these:
http://oni.bungie.org/community/forum/v … php?id=151 http://oni.bungie.org/community/forum/v … 2260#p2260
BTW, feel free to browse/search this forum and the former one (http://oni.bungie.org/forums/) for script-related threads.

Flags are listed in binary resources, so you can't place them where you like at runtime. You can only use the preset ones.

Last edited by geyser (08/25/07 19:08)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#6 08/25/07 21:08

ookami
Member
From: Mississippi, USA
Registered: 08/20/07

Re: Command line descriptions

Geyser, you are brilliant and wonderful. Thank you.

I suppose then the names as referenced at 'Oni Stuff ' are only useful in writing scripts.

FYI, I am on a PC. Didn't think to clarify that.

I understood about Konoko's name; all my allusions were within the first level.

Just to clairfy:

chr_location 0 42 56 91

Puts Konoko at those coordinates. This is what you actually type in. (well, whatever coordinates suits ya, but...) I see it now; I got hung up looking at the ':' and using them to separate the coordinates. big_smile FWIW, I was doing (e.g.) "ai2_ignore_player 0 1" or somesuch because that is how it was written here http://wiki.oni2.net/index.php/Developer_Mode at the bottom of the page.

Offline

#7 08/25/07 22:08

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Command line descriptions

The "[" and ":" and "|" are part of the markup used by dump_docs to specify the signature. They're not used for actual function calls.

The weak syntax for function calls is with spaces. The strong syntax is with round brackets and commas: chr_location(0, 42, 56, 91);
You can't pass a variable (or an expression) to a function with the weak syntax, so advanced scripts like OTA use strong syntax a lot.

I can see no reference to ai2_ignore_player on the Dev Mode wiki page: there's chr_nocollision, which is a function with 2 arguments.

See here for character names: http://www6.fh-eberswalde.de/user/dkrie … charas.htm
In the first chapter, the usual Konoko is called "char_0"; there is a "konoko" in that level, too.

The Oni Stuff overview is quite useful as a reference, but I don't like how it mixes functions and variables.
What do you mean by "names"? And by "only"? What else could such a reference be useful for? smile

Last edited by geyser (08/25/07 22:08)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#8 08/26/07 10:08

ookami
Member
From: Mississippi, USA
Registered: 08/20/07

Re: Command line descriptions

Yeah, I should have quoted chr_nocollision straightaway; I also now better understand why that was written that way. I was using http://www6.fh-eberswalde.de/user/dkrie … l00_01.htm as my reference; but as you noted it's just a good reference. It doesn't explicate.

So characters are referenced three ways:
>Character ID (spawn order), which is dynamic
>Name (which changes per level)
>Model (which also has a different designation per level)

So let's say I go insane and try to put thirty of Train_TD_1 (model: thug_wh_5) in the first room of the warehouse level; is that possible? Could I give different instances of them weapons or not? That latter would be difficult (to me) because scripts use the name, Train_TD_1, as the only way of talking about an AI.

Offline

#9 08/26/07 14:08

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Command line descriptions

You can force spawn the same AI several times with, e.g., ai2_spawn(Train_TD_1); ai2_spawn(Train_TD_1, force); ai2_spawn(Train_TD_1, force);
As you've noted, the problem will be to address those characters individually. You can no longer address them by name, except for the first one.
That means you won't be able to chr_teleport them. That's OK as long as you're on PC, since you can use chr_location and chr_location_settocamera.
As for issuing weapons, there is a PC-only command called chr_weapon. As opposed to chr_giveweapon, it addresses the characters by their ID.
So you could enter something like this (at the console):

ai2_spawn Train_TD_1
chr_location 1 42 56 91
chr_weapon 1 w1_tap
ai2_spawn Train_TD_1 force
chr_location 2 42 56 91
chr_weapon 2 w2_sap
ai2_spawn Train_TD_1 force
ai2_spawn Train_TD_1 force
ai2_spawn Train_TD_1 force
chr_location 3 42 56 91
chr_location 4 42 56 91
chr_location 5 42 56 91
chr_weapon 3 w3_phr
chr_weapon 4 w4_psm
chr_weapon 5 w5_sbg

A completely different way is to spawn a few different characters, and then shapeshift them with chr_set_class
For example, you could write the following:

ai2_spawn Train_TD_1
chr_teleport Train_TD_1 0
chr_giveweapon Train_TD_1 w1_tap
ai2_spawn Top_Comguy_1
chr_teleport Top_Comguy_1 0
chr_giveweapon Top_Comguy_1 w2_sap
chr_set_class 2 thug_wh_5

Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#10 08/27/07 17:08

ookami
Member
From: Mississippi, USA
Registered: 08/20/07

Re: Command line descriptions

Thank you for the ideas. I decided to play with it a bit. Now I'm seeing something else. I wrote this into the *.bsl file. I'll explain the last three lines in a few moments. The third through fifth lines were what I initially added. And of course, another little wage slave was created, albiet with a gun.

        ai2_spawn A_t48
        ai2_spawn A_t48 force
        chr_location 2 -700 0 -730
        chr_weapon 2 w1_tap
        ai2_setmovementmode 2 walk_noaim
        ai2_makeaware 2 char_0
        ai2_setjobstate 2

However, he followed the exact same path as the 'original' fellow. So I added some extra lines in an attempt to get him to, say, stay in one place, or at least start out in a different place. But invariably, that character is always spawned in the same location. I don't know why.

Now for something completely different:

func void unlock6(string ai_name)
{
    dprint unlock6
    d6 = 1
    door_unlock 6
    particle d1_locklight01 do start
    trigvolume_enable trigger_volume_65 1
    door_open 1
    door_jam 1
    ai2_spawn Bay1_Thug_1
    chr_location 3 -651 0 -768
    sleep 20
    door_close 1
    door_jam 1
    ai2_spawn Bay1_Thug_1 force
    chr_location 4 -448 0 -533
}

I also tried sticking a guy outside the locked door. If I use either A_t48 or Bay1_Thug_1, it will spawn at its regular location. In fact, I cannot relocate any of the AI from anywhere.
My thoughts are that there is something somewhere in the *.bsl files which is preventing me from using chr_location. Alternatively, I am more unintelligent than I appear.
I also tried to open the outside door, let in said thug, and close the door again. It's probably a good example of a cute idea with a poor execution.

Any thoughts, fellow Oni Centralers?

Offline

#11 08/27/07 19:08

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Command line descriptions

The "2" in the first piece won't work for ai2_setmovementmode, ai2_makeaware and ai2_setjobstate.
They refer to the AI though either names or "script IDs", which are NOT the same as character IDs.

So the last 3 lines in your first piece of code are simply ignored by Oni. That's why nothing happens.
Then again, they are not supposed to affect an active AI's behaviour, let alone its spawning point.

The chr_location command you provided works OK, but it might fail coming right after the spawn.
Try putting a sleep statement between the two: it should work. It should work without it, though smile

Make sure that the character IDs are what you actually think they are. Using the console helps.
At any moment you can type "who" to list all nearby chars: names, ONCC names and char IDs.
Also try "chr_who": now all the players are listed, with name, char ID, script ID and ONCC name.
The char ID is the one prefixed with # when you call chr_who. The script ID is prefixed by "id ".

Don't forget that IDs are affected by spawns AND kills. You have to keep track of who died smile
Suppose you killed everyone in the first room and let them turn to corpses (looked away).
Then the ID 1 (and 2 if you used the second thug) will be free for the thugs in unlock6.
Just try typing chr_who in different situations to check what the char IDs actually are.

As for the door thing: cute idea indeed, but you'd have to make the thug aware of Konoko or plain force him through the door.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#12 08/27/07 22:08

ookami
Member
From: Mississippi, USA
Registered: 08/20/07

Re: Command line descriptions

Thank you!
Didn't realize the real usefulness of 'chr_who'. Kind of glossed over it whilst playing around. I shall keep playing around.

My initital goal, BTW, is just to rescript this level, move the enemies to different places, and include more of them. Make it what might be considered 'very hard' on the difficulty scale. I also want do a little different with some of the cutscenes and such. I've always wondered why, when Konoko finds Chung, the camera doesn't cut to Griffin when Griffin is talking. Or where the hell those syndicate troops loading the truck are. ((I mean, two minutes to get to the console, but there's just one striker up there to stop her? No one actually loading the truck?)) Also, giving Konoko some teammates along the way might be fun.

In doing this, I'll be getting my nuts and bolts straight; might come up with some more ambitious modding goals. If I get my laptop fixed, where I can use Corel Draw again, I'll get interested in changing some textures.

Offline

#13 08/28/07 13:08

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Command line descriptions

The camera doesn't always have to cut to Griffin, especially not when his voice is heard over radio.
See for example the first cutscene in the warehouse, or the final cutscene in C8: AN INNOCENT LIFE.

The truck loaders are inside the truck, "securing the cargo" so it doesn't collapse while on the move.
Some of the thugs have helped loading the truck. And it's not a big operation, so not many Strikers.
Teammates: there were teammates in Loser's Warehouse, and there should be in Warehouse Too.
http://wiki.oni2.net/index.php/ONK:Warehouse

Warehouse is a very compelling level indeed. I don't know what Loser is doing for it at the moment.
For my part, I've turned the Train_TD_# thugs into Comguy ninjas, with Kojiro as their leader smile
I also toyed a bit with the 15 hidden doors that turn the linear level into a lifelike architecture.
I can unhide those doors and even fix the pathfinding grids so the AI find their way through.
The reason I haven't done so is that we haven't got a modular patching engine yet.
If I am to mod a large amount of data, I'd like not to do it again several times smile
I still might find some time to hack those hidden doors into shape for DemOni.

Last edited by geyser (09/06/07 13:09)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

Board footer

Powered by FluxBB