MODULE: AGS Console v4.0(Custom Cheat Commands)

Started by Dualnames, Thu 25/10/2007 18:46:11

Previous topic - Next topic

Dusk

Quote from: Dualnames on Tue 18/11/2008 09:44:50
Ok, version 3.0 is up. I'll be adding custom cheat commands for the next days, so sorry if you waited only for those.

Thanks, I like very much this Quake-like console idea!
Just trying it (5 min) and waiting for the next versions with the command handler...
some random suggestions about stuff that you probably already taught of:
- listbox autoscroll and related key or command to set it on/off at runtime
- fancy Quake-like drop down animation

A basic information filtering based on some commands, when you implement their input, could also be useful.
Looking forward to this one (and also contributing if I have time!)

bye,
D.


Trent R

Excellent, playing with it right now. 2 things that I changed:

Added
 if (data==gconsole.ID) return;
to 90 and 94/95. Also added
 if (keycode==32) return;
to line 230/232. These both prevent 'useless' additions to the listbox, especially for the mouse click. It was broken before cause I couldn't scroll at all (kept adding new entries).

~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Dualnames

#42
Update 3.1
--------------

-Updated the console module fixing some stuff around.(I noticed that TrentR you got to notice as well).
-Added custom commands(yay)(Feel free to tell me what more is needed).
-Now a GUI with sprites by yours truly comes along.

So what's on to change? You tell me..

-I'll probably add UltraVariables module along if SSH fine with that, but that will be discussed later on.

Oh, by the way custom commands can be enabled true or false, so you can still keep the console but disable codes for players.


Download
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Dusk

Quote from: Dualnames on Fri 21/11/2008 09:53:57
Update 3.1

Suggestions:
1) write in the docs/instructions what's needed to have the cheat command working if you aren't using the template. Now if you import the module and the pre-made GUI, it's missing the handlers that go in the global script. You should just tell to copy paste in the global script
Code: ags

function bconstype_OnClick(GUIControl *control, MouseButton button) {
  if (constxtbox.Enabled==true) {
    constxtbox.Enabled=false;
    return;
  } else {
    constxtbox.Enabled=true;
    return;
  }
}

function bconsdown_OnClick(GUIControl *control, MouseButton button){
  lstconsole.ScrollDown();
}
function bconsup_OnClick(GUIControl *control, MouseButton button){
  lstconsole.ScrollUp();
}
function constxtbox_OnActivate(GUIControl *control){
  AGSConsole.CustomCommands(constxtbox, lstconsole, true);
  constxtbox.Text="";
}


2) autoscroll: easy, you just call lstconsole.ScrollDown(); when you add a line to the listbox. That's different respect autocleaning because you can manually scroll up to read an old entry.
Now, I see in the code that you repeatedly do

Code: ags

 if (event==eEventStartDialog) {
    aevent=aevent.Append(rmenter.Format("Player just started dialog: %d",data));
    lstboxtoevent.AddItem(aevent);
  }
  if (event==eEventSaveGame) {
    aevent=aevent.Append(rmenter.Format("Player just saved gameslot: %d",data));
    lstboxtoevent.AddItem(aevent);
  }
  // other cases

to clean a bit you could call just once the addItem, after all cases: you're always doing the same thing, adding a string to the listbox. The variable part is formatting the string to add.
For the scrolling thing, I'm suggesting of wrapping AddItem and have like

function addLine(String line) { 
  lstconsole.AddItem(line);
  lstconsole.ScrollDown();
}

At this point you can find/replace
lstboxtoevent.AddItem
with
addLine
and it works smoothly. It's not perfect because if you manually scroll up when another line is added it doesn't scroll down at the end of the listbox, but that can also be done, of course.

3) cheat commands.
Well this is the hard part and a personal point of view. I don't like very much the command names and popups that come out to ask for parameters.
This console is mainly for debugging and skilled users I suppose... so, why not choosing the new scripting style and do a little parsing on what the user inputs?
I mean, interpreter like, you write in the console
character[3].Transparency
and the console outputs
= 80;
or you can input
character[3].Transparency = 100
and it changes transparency for character 3.

I understand that part 3 is a lot of work, so feel free to ignore it - I might code it myself in the future, and let you know!

Thanks, bye

D.

Dualnames

I've read the whole part,well, let me tell you my thoughts on it.
1) Great, I'll do it.
2)Well, yeah, come to think of it that would unmess things a lot.
As for the scroll , yes, definetely, that would really make the module more user-friendly.
3)Yeah, definetely inputs seem to appear as less professional, but you have to agree that it requires less typing to do what you need to be done. I'm open to suggestions though, and if you feel like collaborating with me on this feel free to PM, or let me know.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Dualnames

Sorry for the bump, but I found AGSConsolev2 original module file wrote almost completely by Ashen

Known Issues:

Known Issue: LogMouse not always right.
If a blocking function is run, logged information might be based on mouse position AFTER that, not at time of click
Resolution: Add more parameters to LogMouse, so mode, postion, etc, are passed at time of click.

Due to the last time we built this, was long ago, property function can't be used for inventory items. DengVat has changed so it's no longer internally supported. But we've added a function to allow player to type on the console's textbox only when the mouse is over the textbox. And did some minor tinkering adding a couple of new functions. Please do ask for more if you wish, or if you implement them yourself, send them over, so we can add them too! Also added bg for the console and added a listbox that iterates on game settings (d3d, windowed, depth).


Things to do:
-Add more commands, so players can enhance the testing experience and test stuff in-game
-Add UltraVariables(former DengVat) module commands.
-

http://ledzepforever.googlepages.com/AGS_Console4_00.rar
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Monsieur OUXX

#46
Sorry for bumping, but some interesting things :

1) There is just one line in the module that breaks compatibility with 3.2.1, and it's easy to fix :
Line causing the compilation failure: (SetPlayerCharacter is deprecated)
Code: ags

SetPlayerCharacter(TempO); 


Should be replaced with:
Code: ags

character[TempO].SetAsPlayer(); //NEW STYLE


2) I'm currently integrating this with UltraVariables 1.1. It already looks awesome
3) I'm implementing scrolling up and down in this console (atm you constantly need to do "dump" to empty the console, and there is no safety when the number of lines exceeds AGS built-in limit)
4) When it's all finished I'll release it all, along with other nice debugging tools (for example: the ability to run scripts from external text files in this console)
 

Dualnames

Go ahead and work on this, and I'll edit the first post accordingly.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Monsieur OUXX

It's nice :)
I need to create a little demo game and everything will be ready for upload

http://www.youtube.com/watch?v=RnRvSp8x9g8

 

SMF spam blocked by CleanTalk