how is this not working?

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: how is this not working?
Agent
Member # 27
Profile #0
How is this not killing my final character in a party of four? pchar = 0, and, if I'm correct, a while statement runs until the phrase is false.
while (pchar < (party_size() + 1)){
if((char_on_loc(26,10) == -1) && (char_on_loc(26,11) == -1) && (char_on_loc(26,14) == -1) && etc...){
put_boom_on_char(pchar,0,0);
run_animation_sound(51);
kill_char(pchar,3,0);
clear_buffer();
append_char_name(pchar);
append_string(" is ");
append_string("obliterated!");
get_buffer_text(teststring);
print_str_color(teststring,3);
}
pchar = pchar + 1;
}

Posts: 1233 | Registered: Wednesday, October 3 2001 07:00
Infiltrator
Member # 148
Profile #1
It looks like it is the AND in the if statement. Are you sure you want to be checking that ALL those spaces are blank, or at least one?

--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
Agent
Member # 27
Profile #2
The script is trying to say that unless a character is in one of those spaces he's going to die. Though you brought up a different problem that I hadn't noticed, this does not answer my original question.

EDIT:
Why didn't Jeff include a single call that checked to see if a SPECIFIC character was in a spot? Now I'm going to have to manipulate this script more than I wanted to. My head hurts.

[ Sunday, July 08, 2007 13:35: Message edited by: Enraged Slith ]
Posts: 1233 | Registered: Wednesday, October 3 2001 07:00
Agent
Member # 27
Profile #3
Here's another problem. Though it gave me a bad head ache, I finally got this section of script to work. Essentially, what this script is supposed to do is: if this creature spots your party, he runs away to a new hiding spot (with a failsafe for making sure it isn't the same spot as last time.) Unfortunately, the failsafe isn't working, and the creature reappears the next turn (over and over and over and over.) If someone could get back to me on this question and the one above, I would appreciate it.

EDIT: It isn't shown here but I've assigned all my variables.

Town Script:
(startstate, yadda yadda yadda)
if(myself == 49){
activate_hidden_group(2);
}
if(myself == 50){
activate_hidden_group(3);
}
if(myself == 51){
activate_hidden_group(4);
}
if(myself == 52){
activate_hidden_group(5);
}
if(myself == 53){
activate_hidden_group(6);
}
if(myself == 54){
activate_hidden_group(7);
}
if(myself == 55){
activate_hidden_group(8);
}
if(myself == 56){
activate_hidden_group(9);
}
if(myself == 57){
activate_hidden_group(10);
}
if(myself == 58){
activate_hidden_group(11);
}

if ((get_flag(2,15) < 4) && (get_flag(2,14) == 1)){
print_str_color("This script is working.",2);
myself = get_ran(1,49,58);
if(myself == myselfold){
myself = myself + 1;
}
myselfold = myself;
t = t + 1;
if(t == 1){
message_dialog("
}
if(t == 2){
message_dialog("","");
}
if(t == 3){
message_dialog("","");
}
set_flag(2,14,0);
}
Creature Script:
beginstate START_STATE;
if (t < 4){
if(can_see_char(1000)){
force_view_center(char_loc_x(my_number()),char_loc_y(my_number()));
text_bubble_on_char(my_number(),"!");
force_instant_terrain_redraw();
pause(20);

text_bubble_on_char(my_number(),"");
force_instant_terrain_redraw();

play_sound(-121);
erase_char(my_number());

t = t + 1;
set_flag(2,15,t);
set_flag(2,14,1);
}
}


[ Sunday, July 08, 2007 13:48: Message edited by: Enraged Slith ]
Posts: 1233 | Registered: Wednesday, October 3 2001 07:00
Shaper
Member # 7472
Profile Homepage #4
I can't help with the problem you're currently experiencing, but I can tell you that creating the message after killing the character is not a good idea. I've found that BoA gets rather unreliable when it tries to retrieve data on a character that's either dead or doesn't exist.

EDIT: It appears that, if get_ran turns out 58, and the creature's last hiding spot was 58, it'll change it to 59, which isn't supported. I'm not sure if that's what's causing the glitch you're experiencing, but it's still worth correcting.

[ Sunday, July 08, 2007 14:07: Message edited by: Nioca ]

--------------------
Scenarios need reviews! Please rate these scenarios at the CSR after playing them!
AmnesiaWitch HuntWhere the Rivers MeetFoul Hordes
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Agent
Member # 27
Profile #5
Thanks for the catch, I fixed that up. Script is doing some weird things now after tweaking.

First, the failsafe works only on occasion. Second, after a certain point when I kill the creature, he keeps reviving over and over and over and over. I used no create creature calls so this seems pretty strange to me.
Posts: 1233 | Registered: Wednesday, October 3 2001 07:00
Infiltrator
Member # 5576
Profile Homepage #6
I think that maybe one problem is with the creature script-terrain script interaction; the way that the creature script sends information to the town script is by setting flags 2,15 and 2,14. It appears that you are trying to make flag 2,15 be set 1 higher each time; but this won't work because the3 first time, t is 0, gets incremented to 1, and the flag is set to the value, but because the creature erases itself, the new one is back to having t=0, so the exact same result will be given each time. So, maybe the solution is to avoid using the local variable t, and instead to use only an SDF to store the count. I don't see a way that this would cause the creature always appear in the same place, though.

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Agent
Member # 27
Profile #7
I have ten creatures using the same creature script (all are hidden but one of course). Does the t variable only apply to each individual creature rather than them all as a whole?
Posts: 1233 | Registered: Wednesday, October 3 2001 07:00
Shaper
Member # 7472
Profile Homepage #8
Variables are unique to each and every creature, whether or not the script is the same. If you want to have a variable that is non-unique to a set of creatures, you'll have to use a flag.

[ Sunday, July 08, 2007 15:53: Message edited by: Nioca ]

--------------------
Scenarios need reviews! Please rate these scenarios at the CSR after playing them!
AmnesiaWitch HuntWhere the Rivers MeetFoul Hordes
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Lifecrafter
Member # 6193
Profile Homepage #9
I think this is what you were going for with the first script:
while (pchar < (party_size() + 1)){
if((char_on_loc(26,10) != pchar) && (char_on_loc(26,11) != pchar) && (char_on_loc(26,14) != pchar) && etc...){
put_boom_on_char(pchar,0,0);
run_animation_sound(51);
kill_char(pchar,3,0);
clear_buffer();
append_char_name(pchar);
append_string(" is ");
append_string("obliterated!");
get_buffer_text(teststring);
print_str_color(teststring,3);
}
pchar = pchar + 1;
}
Checks for each PC whether or not he's on one of the safe spots, and kills him if he isn't.

As for the creature script, I'm not patient enough to debug that. But at first glance I'd say the problem is, as Niemand said, with the variable. Remember that whenever you erase the creature and activate a new group the value T is lost. Use a flag.

--------------------
Guaranteed to blow your mind.

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Agent
Member # 27
Profile #10
Thanks for the help everyone, I finally fixed every problem. The side effects I got along the way were pretty weird and amusing though.

This scenario should be ready for beta testing tomorrow or the next day. I'll need help converting everything to be Mac compatable.

[ Sunday, July 08, 2007 20:54: Message edited by: Enraged Slith ]
Posts: 1233 | Registered: Wednesday, October 3 2001 07:00