I had a question... I wanted to add more user mode's for better verbcoin functionality. I suppose the first place I should be concerned with this is in the Engine itself. As I have mentioned numerous times, I am not expert at c++, I am still learning and the adventure game engine scene in C++ is still a bit out of reach for me. However, that does not mean I cant practice and mingle :)
Anyway, I wanted to add the following cursor modes to the engine itself:
Give, Pull, Push, Take Off, Put On, Use with, read, Open, Close, Turn on, Turn Off, Kiss, Kick, Punch, Lick, Slap, instigate.
So, correct me if I am wrong, but, would I do this as far as the engine goes:
in rundefines.h, on lines 72 of the refactored code I would add:
#define MODE_GIVE 10
#define MODE_PULL 11
#define MODE_PUSH 12
#define MODE_TAKEOFF 13
#define MODE_PUTON 14
#define MODE_USEWITH 15
#define MODE_READ 16
#define MODE_OPEN 17
#define MODE_CLOSE 18
#define MODE_TURNON 19
#define MODE_TURNOFF 20
#define MODE_KISS 21
#define MODE_KICK 22
#define MODE_PUNCH 23
#define MODE_SLAP 24
#define MODE_LICK 25
#define MODE_INSTIGATE 26
-----------------------------
In global_character.cpp on lines 381 I would add:
else if (mood==MODE_GIVE) passon = 10;
else if (mood==MODE_PULL) passon = 11;
else if (mood== MODE_PUSH) passon = 12;
else if (mood== MODE_TAKEOFF) passon = 13;
else if (mood==MODE_PUTON) passon = 14;
else if (mood==MODE_USEWITH) passon = 15;
else if (mood== MODE_READ) passon = 16;
else if (mood==MODE_OPEN) passon = 17;
else if (mood== MODE_CLOSE) passon = 18;
else if (mood== MODE_TURNON) passon = 19;
else if (mood== MODE_TURNOFF) passon = 20;
else if (mood== MODE_KISS) passon = 21;
else if (mood== MODE_KICK) passon = 22;
else if (mood==MODE_PUNCH) passon = 23;
else if (mood==MODE_SLAP) passon = 24;
else if (mood==MODE_LICK) passon = 25;
else if (mood== MODE_INSTIGATE) passon = 26;
--------------------------
In Global_Object.cpp on line 374 I would add:
else if (mood==MODE_GIVE) passon = 10;
else if (mood==MODE_PULL) passon = 11;
else if (mood== MODE_PUSH) passon = 12;
else if (mood== MODE_TAKEOFF) passon = 13;
else if (mood==MODE_PUTON) passon = 14;
else if (mood==MODE_USEWITH) passon = 15;
else if (mood== MODE_READ) passon = 16;
else if (mood==MODE_OPEN) passon = 17;
else if (mood== MODE_CLOSE) passon = 18;
else if (mood== MODE_TURNON) passon = 19;
else if (mood== MODE_TURNOFF) passon = 20;
else if (mood== MODE_KISS) passon = 21;
else if (mood== MODE_KICK) passon = 22;
else if (mood==MODE_PUNCH) passon = 23;
else if (mood==MODE_SLAP) passon = 24;
else if (mood==MODE_LICK) passon = 25;
else if (mood== MODE_INSTIGATE) passon = 26;
---------
In Global_hotspot.cpp on line 88 add:
else if (mood==MODE_GIVE) passon = 10;
else if (mood==MODE_PULL) passon = 11;
else if (mood== MODE_PUSH) passon = 12;
else if (mood== MODE_TAKEOFF) passon = 13;
else if (mood==MODE_PUTON) passon = 14;
else if (mood==MODE_USEWITH) passon = 15;
else if (mood== MODE_READ) passon = 16;
else if (mood==MODE_OPEN) passon = 17;
else if (mood== MODE_CLOSE) passon = 18;
else if (mood== MODE_TURNON) passon = 19;
else if (mood== MODE_TURNOFF) passon = 20;
else if (mood== MODE_KISS) passon = 21;
else if (mood== MODE_KICK) passon = 22;
else if (mood==MODE_PUNCH) passon = 23;
else if (mood==MODE_SLAP) passon = 24;
else if (mood==MODE_LICK) passon = 25;
else if (mood== MODE_INSTIGATE) passon = 26;
In Global_inventoryitem.cpp on lines 104 and on
else if (modd == MODE_GIVE)
run_event_block_inv(iit, 10);
else if (modd == MODE_PULL)
run_event_block_inv(iit,11);
else if (modd == MODE_PUSH)
run_event_block_inv(iit, 12);
else if (modd == MODE_TAKEOFF)
run_event_block_inv(iit, 13);
else if (modd == MODE_PUTON)
run_event_block_inv(iit, 14);
else if (modd == MODE_USEWITH)
run_event_block_inv(iit, 15);
else if (modd == MODE_READ)
run_event_block_inv(iit, 16);
else if (modd == MODE_OPEN)
run_event_block_inv(iit, 17);
else if (modd == MODE_CLOSE)
run_event_block_inv(iit, 18);
else if (modd == MODE_TURNON)
run_event_block_inv(iit, 19);
else if (modd == MODE_TURNOFF)
run_event_block_inv(iit, 20);
else if (modd == MODE_KISS)
run_event_block_inv(iit, 21);
else if (modd == MODE_KICK)
run_event_block_inv(iit, 22);
else if (modd == MODE_PUNCH)
run_event_block_inv(iit, 23);
else if (modd == MODE_SLAP)
run_event_block_inv(iit, 24);
else if (modd == MODE_LICK)
run_event_block_inv(iit, 25);
else if (modd == MODE_INSTIGATE)
run_event_block_inv(iit, 26);
Now the next few parts of code are for the editor itself. I get most of it, however, I can not seem to be able to add these to the mouse cursors section on the pane. Any idea’s? Anyway, here goes:
On line 23 in Roomhotspot.cs, change the following to:
_interactionSchema = new InteractionSchema(new string[] {"Stands on hotspot",
"$$01 hotspot","$$02 hotspot","Use inventory on hotspot",
"$$03 hotspot", "Any click on hotspot","Mouse moves over hotspot",
"$$05 hotspot", "$$08 hotspot", "$$09 hotspot", “Giveâ€, “Pullâ€, “Pushâ€, “Take Offâ€, “Put onâ€, “Use withâ€, “Readâ€, “Openâ€, “Closeâ€, “Turn onâ€, “Turn offâ€, “Kissâ€, “Kickâ€, “Punchâ€, “Slapâ€, “Lickâ€, “Instigateâ€},
new string[] { "WalkOn", "Look", "Interact", "UseInv", "Talk", "AnyClick", "MouseMove", "PickUp", "Mode8", "Mode9", “Giveâ€, “Pullâ€, “Pushâ€, “TakeOffâ€, “PutOnâ€, “UseWithâ€, “Readâ€, “Openâ€, “Closeâ€, “TurnOnâ€, “TurnOffâ€, “Kissâ€, “Kickâ€, “Punchâ€, “Slapâ€, “Lickâ€, “Instigate†});
}
On line 40 on Character.cs:
_interactionSchema = new InteractionSchema(new string[] {"$$01 character",
"$$02 character","$$03 character","Use inventory on character",
"Any click on character", "$$05 character","$$08 character",
"$$09 character", “Giveâ€, “Pullâ€, “Pushâ€, “Take Offâ€, “Put onâ€, “Use withâ€, “Readâ€, “Openâ€, “Closeâ€, “Turn onâ€, “Turn offâ€, “Kissâ€, “Kickâ€, “Punchâ€, “Slapâ€, “Lickâ€, “Instigateâ€},
new string[] { "Look", "Interact", "Talk", "UseInv", "AnyClick", "PickUp", "Mode8", "Mode9", “Giveâ€, “Pullâ€, “Pushâ€, “TakeOffâ€, “PutOnâ€, “UseWithâ€, “Readâ€, “Openâ€, “Closeâ€, “TurnOnâ€, “TurnOffâ€, “Kissâ€, “Kickâ€, “Punchâ€, “Slapâ€, “Lickâ€, “Instigate†});
}
Line 27 in InventoryItem.cs:
_interactionSchema = new InteractionSchema(new string[] { "$$01 inventory item",
"$$02 inventory item", "$$03 inventory item", "Use inventory on this item",
"Other click on inventory item", “Giveâ€, “Pullâ€, “Pushâ€, “Take Offâ€, “Put onâ€, “Use withâ€, “Readâ€, “Openâ€, “Closeâ€, “Turn onâ€, “Turn offâ€, “Kissâ€, “Kickâ€, “Punchâ€, “Slapâ€, “Lickâ€, “Instigate†},
new string[] { "Look", "Interact", "Talk", "UseInv", "OtherClick", “Giveâ€, “Pullâ€, “Pushâ€, “TakeOffâ€, “PutOnâ€, “UseWithâ€, “Readâ€, “Openâ€, “Closeâ€, “TurnOnâ€, “TurnOffâ€, “Kissâ€, “Kickâ€, “Punchâ€, “Slapâ€, “Lickâ€, “Instigate†});
}
On line 33 in RoomObject.cs
_interactionSchema = new InteractionSchema(new string[] {"$$01 object",
"$$02 object", "$$03 object", "Use inventory on object",
"Any click on object",
"$$05 object", "$$08 object", "$$09 object", “Giveâ€, “Pullâ€, “Pushâ€, “Take Offâ€, “Put onâ€, “Use withâ€, “Readâ€, “Openâ€, “Closeâ€, “Turn onâ€, “Turn offâ€, “Kissâ€, “Kickâ€, “Punchâ€, “Slapâ€, “Lickâ€, “Instigateâ€},
new string[] { "Look", "Interact", "Talk", "UseInv", "AnyClick", "PickUp", "Mode8", "Mode9", “Giveâ€, “Pullâ€, “Pushâ€, “TakeOffâ€, “PutOnâ€, “UseWithâ€, “Readâ€, “Openâ€, “Closeâ€, “TurnOnâ€, “TurnOffâ€, “Kissâ€, “Kickâ€, “Punchâ€, “Slapâ€, “Lickâ€, “Instigate†});
}
Am I missing anything, besides the mouse cursors pane issue?
I am sorry to say this, but I believe hard-coding interaction modes in the engine is one of the worst ideas I've heard.
Even the fact that few are hard-coded in the current AGS is bad enough already.
Why do you say that? I always liked the idea that there were hard-coded interactions in AGS as it made programming for people like me easier to do.
Quote from: Joseph DiPerla on Fri 27/07/2012 17:18:16
Why do you say that? I always liked the idea that there were hard-coded interactions in AGS as it made programming for people like me easier to do.
I'll try to elaborate.
The question here is not how those interactions look in the editor and script. The question is how they look in the engine.
Better idea would be to allow creating interaction types right in the editor, similar to how you create custom properties. That would allow ultimate flexibility.
Newbies could use templates that define some simple default interaction schemas, while hardcore game devs could create their own schemas with custom itneraction types.
Now what you do is making a bunch of interactions that will be in game regardless if game dev wants them to be there or not. And if the engine development will follow this logic, we would have to add more and more hard-coded interactions for every interaction type users would like to have (I dunno, Shoot, Eat, Drink, Dance...).
So, to be frank, I do not see any benefit from this, unless you are doing this for learning purposes only.
On your code.
Why are you using constant values (11,12,13 etc) when you just declared macros for those types? That makes no sense.
More than that, you do realize that you set a "passon" variable to the same value as the mood? Why writing all those "else if" lines when you could just write
passon = mood;
only once.
Same for inventory:
run_event_block_inv(iit, mode);
I hadn't paid much attention to how that works, so I'll have too look more to give any further opinion.
Well, yes, I am definitely doing this for learning purposes. :) Also, I always thought that there should be a way to add more interactions in the editor as you mentioned. Sorry, I didn't understand why you were opposed to the hard-coded interactions. But again, I think the next best thing if we do not have the ability to add interactions to the editor is to hard code it. I think adding mouse cursor modes is heading in the right direction, but not streamlined enough.
Quote from: Joseph DiPerla on Fri 27/07/2012 17:27:34
Sorry, I didn't understand why you were opposed to the hard-coded interactions. But again, I think the next best thing if we do not have the ability to add interactions to the editor is to hard code it. I think adding mouse cursor modes is heading in the right direction, but not streamlined enough.
Well, you see, problem with AGS, as being mentioned by Chris Jones himself, is that it was written in not a very best way. Ah, well, why to be so tender... it is coded just terribly :D.
In fact I am pretty much amazed by stoicism CJ had to have to maintain this program for nearly 13 or 14 years.
So, what I meant to say is that many things there were coded the way they are because that did have sense back then, 10 years ago, when everyone wanted to make games with Sierra-like interface. As more time passed more customizable features were added. But it would require lots of rewriting to change it all.
So now when we have this opportunity (at least in theory) I feel a bit strange when I see someone attempts to extend the thing that should not be extended but rather replaced.
QuoteWell, you see, problem with AGS, as being mentioned by Chris Jones himself, is that it was written in not a very best way. Ah, well, why to be so tender... it is coded just terribly .
TRAITOR!!!! HOW DARE YOU!!!!!! :D
No, I see what your saying. Unfortunately, my C++/C# Coding experience only allows me to do it the way I am doing it. Eventually I will be good enough to make cool enhancements in AGS. :)