update readme for console

This commit is contained in:
Cracker64 2011-03-02 16:00:49 -05:00
parent 9fffbb88da
commit 57d24f3ffa
2 changed files with 40 additions and 41 deletions

View File

@ -2,37 +2,36 @@
the console in this version is a python console and will execute any command you enter. the console in this version is a python console and will execute any command you enter.
the api for interacting with the powder toy is contained in the tpt module and is already imported at startup. the api for interacting with the powder toy is contained in the tpt module and is already imported at startup.
currently implemented api functions: currently implemented api functions:
tpt.create(x,y,type) create a particle of type <type> at <x>,<y> create(x,y,type) create a particle of type <type> at <x>,<y>
tpt.reset_velocity() resets all velocity reset_velocity() resets all velocity
tpt.reset_pressure() resets all pressure reset_pressure() resets all pressure
tpt.reset_sparks() resets all sparks reset_sparks() resets all sparks
tpt.set_life(type,life) sets the life of all particles with type <type>
to <life>(set <type> to -1 for all) ### USING SET COMMANDS ###
tpt.set_type(type1,type2) sets the type of all particles with type <type1> the console uses keywords to identify variables of what to set, you can specify x and y coords with x=100 y=100, ect.
to <type2>(set <type1> to -1 for all) i is the particle number
tpt.set_temp(type,temp) sets the temp of all particles with type <type> name will change all of name's type to the setto variable. It needs to be a string "dust" ect, "all" for all.
to <temp>(set <type> to -1 for all) the setto is what the particle(s) will be set to, it is a string for the type/ctype commands, and an int for the rest.
tpt.set_tmp(type,tmp) sets the tmp of all particles with type <type> you need to set the to* variable and one location/name/coords for it to work.
to <tmp>(set <type> to -1 for all) set_type(x=,y=,i=,name="",totype="")
tpt.set_x(type,x) sets the x of all particles with type <type> set_life()
to <x>(set <type> to -1 for all) set_temp()
tpt.set_y(type,y) sets the y of all particles with type <type> set_tmp()
to <y>(set <type> to -1 for all) set_x()
tpt.set_vx(type,vx) sets the vx of all particles with type <type> set_y()
to <vx>(set <type> to -1 for all) set_vx()
tpt.set_vy(type,vy) sets the vy of all particles with type <type> set_vy()
to <vy>(set <type> to -1 for all) set_ctype()
tpt.set_ctype(type,ctype) sets the ctype of all particles with type
<type> to <ctype>(set <type> to -1 for all) pause() pause the game(note that closing the console
tpt.pause() pause the game(note that closing the console
pauses the game) pauses the game)
tpt.unpause() unpause the game(note that closing the console unpause() unpause the game(note that closing the console
pauses the game) pauses the game)
tpt.toggle_pause() toggle pause(note that closing the console toggle_pause() toggle pause(note that closing the console
pauses the game) pauses the game)
tpt.close_console() closes the console and pauses the game close_console() closes the console and pauses the game
tpt.open_console() opens the console open_console() opens the console
tpt.toggle_console() toggles the console toggle_console() toggles the console
NOTE: these functions don't do bounds checking, which means that they CAN AND NOTE: these functions don't do bounds checking, which means that they CAN AND
WILL CRASH the powder toy. be carefull. WILL CRASH the powder toy. be carefull.

View File

@ -1346,7 +1346,7 @@ emb_set_life(PyObject *self, PyObject *args, PyObject *keywds)
{ {
int i = -1,life,j,x=-1,y=-1; int i = -1,life,j,x=-1,y=-1;
char *name = ""; char *name = "";
char *kwlist[] = {"tolife", "from", "i", "x", "y", NULL}; char *kwlist[] = {"setto", "from", "i", "x", "y", NULL};
if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y)) if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y))
return NULL; return NULL;
// //
@ -1387,7 +1387,7 @@ emb_set_type(PyObject *self, PyObject *args, PyObject *keywds)
int i = -1,life,j,x=-1,y=-1; int i = -1,life,j,x=-1,y=-1;
char *name = ""; char *name = "";
char *type = ""; char *type = "";
char *kwlist[] = {"totype", "from", "i", "x", "y", NULL}; char *kwlist[] = {"setto", "from", "i", "x", "y", NULL};
if(!PyArg_ParseTupleAndKeywords(args, keywds, "s|sIII:set_type",kwlist ,&type,&name,&i,&x,&y)) if(!PyArg_ParseTupleAndKeywords(args, keywds, "s|sIII:set_type",kwlist ,&type,&name,&i,&x,&y))
return NULL; return NULL;
// //
@ -1428,7 +1428,7 @@ emb_set_temp(PyObject *self, PyObject *args, PyObject *keywds)
{ {
int i = -1,life,j,x=-1,y=-1; int i = -1,life,j,x=-1,y=-1;
char *name = ""; char *name = "";
char *kwlist[] = {"totemp", "from", "i", "x", "y", NULL}; char *kwlist[] = {"setto", "from", "i", "x", "y", NULL};
if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y)) if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y))
return NULL; return NULL;
// //
@ -1468,7 +1468,7 @@ emb_set_tmp(PyObject *self, PyObject *args, PyObject *keywds)
{ {
int i = -1,life,j,x=-1,y=-1; int i = -1,life,j,x=-1,y=-1;
char *name = ""; char *name = "";
char *kwlist[] = {"totmp", "from", "i", "x", "y", NULL}; char *kwlist[] = {"setto", "from", "i", "x", "y", NULL};
if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y)) if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y))
return NULL; return NULL;
// //
@ -1509,7 +1509,7 @@ emb_set_x(PyObject *self, PyObject *args, PyObject *keywds)
int i = -1,life,j,x=-1,y=-1; int i = -1,life,j,x=-1,y=-1;
char *name = ""; char *name = "";
char *type = ""; char *type = "";
char *kwlist[] = {"tox", "from", "i", "x", "y", NULL}; char *kwlist[] = {"setto", "from", "i", "x", "y", NULL};
if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y)) if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y))
return NULL; return NULL;
// //
@ -1549,7 +1549,7 @@ emb_set_y(PyObject *self, PyObject *args, PyObject *keywds)
{ {
int i = -1,life,j,x=-1,y=-1; int i = -1,life,j,x=-1,y=-1;
char *name = ""; char *name = "";
char *kwlist[] = {"toy", "from", "i", "x", "y", NULL}; char *kwlist[] = {"setto", "from", "i", "x", "y", NULL};
if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y)) if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y))
return NULL; return NULL;
// //
@ -1590,7 +1590,7 @@ emb_set_ctype(PyObject *self, PyObject *args, PyObject *keywds)
int i = -1,life,j,x=-1,y=-1; int i = -1,life,j,x=-1,y=-1;
char *name = ""; char *name = "";
char *type = ""; char *type = "";
char *kwlist[] = {"toctype", "toctypeint", "from", "i", "x", "y", NULL}; char *kwlist[] = {"setto", "toctypeint", "from", "i", "x", "y", NULL};
if(!PyArg_ParseTupleAndKeywords(args, keywds, "s|IsIII:set_type",kwlist ,&type, &life, &name,&i,&x,&y)) if(!PyArg_ParseTupleAndKeywords(args, keywds, "s|IsIII:set_type",kwlist ,&type, &life, &name,&i,&x,&y))
return NULL; return NULL;
// //
@ -1632,7 +1632,7 @@ emb_set_vx(PyObject *self, PyObject *args, PyObject *keywds)
{ {
int i = -1,life,j,x=-1,y=-1; int i = -1,life,j,x=-1,y=-1;
char *name = ""; char *name = "";
char *kwlist[] = {"tovx", "from", "i", "x", "y", NULL}; char *kwlist[] = {"setto", "from", "i", "x", "y", NULL};
if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y)) if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y))
return NULL; return NULL;
// //
@ -1672,7 +1672,7 @@ emb_set_vy(PyObject *self, PyObject *args, PyObject *keywds)
{ {
int i = -1,life,j,x=-1,y=-1; int i = -1,life,j,x=-1,y=-1;
char *name = ""; char *name = "";
char *kwlist[] = {"tovy", "from", "i", "x", "y", NULL}; char *kwlist[] = {"setto", "from", "i", "x", "y", NULL};
if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y)) if(!PyArg_ParseTupleAndKeywords(args, keywds, "I|sIII:set_type",kwlist ,&life,&name,&i,&x,&y))
return NULL; return NULL;
// //