 |
|
leftover_crack
|
|
hmm.. mind if I take a look and try it? I enjoy modding a bit. I saw somthing about this earlier. Ive been reading and looking.
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:14
|
|
This is what i have in mind. Of course it needs some polishing to be possible the offers/requests. But basicly this is where aim at.
The restriction is that you can only make one diplomatic item per proposal. (eg. cant give city and money at once).
One bad part is that diplomacy will take several moths to complete when ithere is counters and threats.
Still to this code work we need to know if a player can send a proposal if it isnt its turn.
code:
int_t PBEM_CanSendProposal;
int_t PBM_Sender[];
int_t PBEM_receiver[];
int_t PBM_Proposal[];
int_t PBEM_HasBeenSent[];
int_f StoreProposalType(int_t sender, int_t receiver, int_t ProposalType) {
int_t i;
int_t sucess;
i = 0;
while(i < PBEM_HasBeenSent.# && sucess == 0){
if(PBEM_HasBeenSent[i] == 1) {
PBM_Sender[i] = sender;
PBEM_receiver[i] = receiver;
PBM_Proposal[i] = ProposalType;
PBEM_HasBeenSent[i] = 0;
}
i = i + 1;
}
if(sucess == 0) {
i = PBEM_HasBeenSent.#;
PBM_Sender[i] = sender;
PBEM_receiver[i] = receiver;
PBM_Proposal[i] = ProposalType;
PBEM_HasBeenSent[i] = 0;
}
}
HandleEvent(NewProposal) 'SaveProposalToPBEM' pre {
int_t ProposalType; //initial proposal
if(PBEM_CanSendProposal == 0) {
ProposalType = GetLastNewProposalType(player[0], player[1], 0);
StoreProposalType(player[0], player[1], ProposalType, 0);
return STOP;
}
else{
PBEM_CanSendProposal = 0;
}
}
HandleEvent(BeginTurn) 'SendStoragedProposal' post {
int_t i;
for(i = 0; i < PBEM_HasBeenSent.#; i = i + 1) {
if(player[0] == PBEM_receiver[i] && PBEM_HasBeenSent[i] == 0) {
PBEM_CanSendProposal = 1;
ConsiderNewProposal(PBM_Sender[i], PBEM_receiver[i], 2000, PBM_Proposal[i],0,ID_NONE,ID_NONE,ID_NONE);
Event: NewProposal(PBM_Sender[i], PBEM_receiver[i]);
PBEM_HasBeenSent[i] = 1;
}
}
}
Did not tested too. But any comments?
EDIT: Fixed syntax errors
EDIT2: a stupid i = 1 + 1; missing was causing loops. Fixed.
Last edited by Pedrunn on 08-09-2002 at 08:18
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:14
|
|
1) Wich button in CTP2 triggers this code?
code:
Trigger 'PBEM_test' on "ControlPanelWindow.ControlPanel.ShortcutPad.DiplomacyButton" when (1) {
2) Is the alertbox for the "now is your turn" of the PBEM and HotSeat in the script.slc? I can find it!
Last edited by Pedrunn on 08-09-2002 at 18:53
|
|
|  |
 |
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:14
|
|
Peter Triggs already told me about it.
And what about these ones before they became forgoten?
1) Wich button in CTP2 triggers this code?
2) Is the alertbox for the "now is your turn" of the PBEM and HotSeat in the script.slc? I can find it!
Plus:
3) The events Accept(int_t, int_t ) and Reject(int_t, int_t ). The firs int_t is the one who sent the the proposal that was accept or the one who accepted?
Report. I already did a fix for the proposal. You can send them and the player will receive them nicely as long as it has only one proposal. The warning of the proposal reponse (accept/reject) is made by messagebox. I am current working with counters and threatens. Although i am having some dificulties coming up with a idea on how to implement the threatens.
Last edited by Pedrunn on 09-09-2002 at 23:29
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:14
|
|
Pedrunn,
I really liked your idea of using the regular diplomacy interface to do diplomacy, but I was already afraid it wouldn't work... 
There's no 'MakeTreaty' function but I suspect that we can write SLIC code that will make the AI accept/reject proposals depending on what the results of messagebox-negotiations are. This will need extensive testing though, but it's the least important part of this diplomacy code, the most important part is to make it possible for human players to give each other maps/gold/cities/advances/etc. Although a nice bonus, it's not necesssary to be able to make peacy treaties, cease-fires, etc through the regular diplomacy system, that can be done through the chat box as well...
quote: Originally posted by Pedrunn
1) Wich button in CTP2 triggers this code?
code:
Trigger 'PBEM_test' on "ControlPanelWindow.ControlPanel.ShortcutPad.DiplomacyButton" when (1) {
|
The diplomacy button in the 'wheel' on the control panel, as I've stated several times in this thread already 
quote: 2) Is the alertbox for the "now is your turn" of the PBEM and HotSeat in the script.slc? I can find it! |
No, not AFAIK. It's probably hard-coded.
|
|
|  |
 |
|  |
 |
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:14
|
|
It supports more than 2.
When you send the proposal did it left the diplomatic proposals screen or the proposal was sent and got accepted/reject?
Last edited by Pedrunn on 10-09-2002 at 03:17
|
|
|  |
All times are GMT. The time now is 05:14. Apolyton Time is 00:14. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|