I have been trying to think of a way to allow the player to make choices by pressing one of three hotkeys. I haven't had any success so far. Is my method on the right track or doomed?
Here is one of the 3 hotkeyed item cogs for choices:
Here is an example of a dialogue cog that asks the player to make a choice:
I modified items.dat like this:
fieldlight 42 1 1 0x122 cog=item_fieldlight.cog
keyred 117 1 1 0x122 cog=item_choice1.cog
keyblue 118 1 1 0x122 cog=item_choice2.cog
keygreen 119 1 1 0x122 cog=item_choice3.cog
Is there a better way to do what I want to do? Is it possible? Thanks for any suggestions!
Here is one of the 3 hotkeyed item cogs for choices:
Code:
# Jedi Knight Cog Script
#
# item_choice1.COG
#
# This Cog is Not supported by LucasArts Entertainment Co
symbols
message activated
int bin=117 local
end
# ========================================================================================
code
activated:
player = GetSourceRef();
SetInvActivated(player, bin, 0); // sets the choice1 BIN to 1 or ON.
Print("BIN 117 Choice 1 is switched ON."); // this message has never printed, so I must have made a mistake
return;
# ........................................................................................
endHere is an example of a dialogue cog that asks the player to make a choice:
Code:
# Jedi Knight Cog Script
#
# suicidaldroid.COG
#
# This is a test cog for my dialogue choices system.
#
# This Cog is Not supported by LucasArts Entertainment Co
symbols
message activated
message pulse
thing droid
int done=0 local
end
# ========================================================================================
code
activated:
player=GetLocalPlayerThing();
Print("Hello, I am D4K6. I am sorry to be unable to serve you as best I might.");
Print("My programming is insufficient for even simple tasks. Shall I self-destruct, master?");
Print("CHOICE 1: Yes, blow up now!");
Print("CHOICE 2: No, live!");
Print("CHOICE 3: I don't care, you decide.");
SetPulse(1); // starts search for a hotkey depression
return;
pulse:
# I never get any positive response, suggesting that my hotkeys don't do anything.
choice1=IsInvActivated(player, 117);
choice2=IsInvActivated(player, 118);
choice3=IsInvActivated(player, 119);
if(choice1==1)
{
Print("very good, master...");
SetThingHealth(droid, 0);
SetInvActivated(player, 117, 0);
SetInvActivated(player, 118, 0);
SetInvActivated(player, 119, 0);
done=1;
SetPulse(0); // ends search for a hotkey depression
return;
}
if(choice2==1)
{
Print("Oh no, master, I am afraid that would be a disservice to you! Goodbye...");
SetThingHealth(droid, 0);
SetInvActivated(player, 117, 0);
SetInvActivated(player, 118, 0);
SetInvActivated(player, 119, 0);
done=1;
SetPulse(0); // ends search for a hotkey depression
return;
}
if(choice3==1)
{
Print("Oh, master, how wise! Yes, perhaps I should define my own role in life. Thank you, master!...");
SetThingHealth(droid, 100);
SetInvActivated(player, 117, 0);
SetInvActivated(player, 118, 0);
SetInvActivated(player, 119, 0);
done=1;
SetPulse(0); // ends search for a hotkey depression
return;
}
else
return;
# ........................................................................................
endI modified items.dat like this:
fieldlight 42 1 1 0x122 cog=item_fieldlight.cog
keyred 117 1 1 0x122 cog=item_choice1.cog
keyblue 118 1 1 0x122 cog=item_choice2.cog
keygreen 119 1 1 0x122 cog=item_choice3.cog
Is there a better way to do what I want to do? Is it possible? Thanks for any suggestions!