SO i'm failing epically to get a basic script to execute(again). this is only a test script that i want to turn into something more, but if i can't even get this to work, then whats the point?
The sound of God is the screech of tires, lights and magnets, bolts and wires. Strayed from the road, this very one, still to come. The sound of tires is the sound of God, the electric version.
There are no player specific zombie vars in WaW. If you want to set the players score, use this:
Code Snippet
Plaintext
players[i].score = 2000; // The line below is to show how much was taken away / added, remove if you don't want this. players[i] maps\_zombiemode_score::set_player_score_hud();
There are no player specific zombie vars in WaW. If you want to set the players score, use this:
Code Snippet
Plaintext
players[i].score = 2000; // The line below is to show how much was taken away / added, remove if you don't want this. players[i] maps\_zombiemode_score::set_player_score_hud();
- Phil.
No dice either way. The hasweapon check isn't working, because when i place a print before the test, it shows up on the screen, but not after. and yes i changed the zombie_colt into something else.
The hasweapon check isn't working, because when i place a print before the test, it shows up on the screen, but not after. and yes i changed the zombie_colt into something else.
My code should be correct, both in syntax and semantics. However, you probably are calling the code too soon (before _zombiemode::main()), when the players are not yet connected and initialized. Also, your code doesn't contain a loop (other than the for), so it only iterates over all players once, then terminates. I don't know if you want it that way.
Ray1235, generally, C style languages require brackets around if. IF that's the case with GSC too (which I think it is), yours won't work too. My code should be correct, both in syntax and semantics. However, you probably are calling the code too soon (before _zombiemode::main()), when the players are not yet connected and initialized. Also, your code doesn't contain a loop (other than the for), so it only iterates over all players once, then terminates. I don't know if you want it that way.
- Phil.
I added a wait right before that function is called, turns out thats part of the issue. Now it's giving me a potential infinite loop in script warning after i added the loop.
I really think that the hasweapon check just isn't working right, because no matter what i spawn with i always get the debug text "working".
First of all, never do an infinite loop without any wait()s. Second of all, you probably want to put the player loop inside infinite loop, not the other way (it won't work). Something like this:
why would you want to use the first over the last, is there any practical difference at all? (it's less typing i guess) I know that line isn't the issue anymore, like i said i'm just really curious
Last Edit: December 22, 2013, 03:57:46 pm by BluntStuffy
First of all, never do an infinite loop without any wait()s. Second of all, you probably want to put the player loop inside infinite loop, not the other way (it won't work). Something like this:
@daedra descent Well, I didn't know what you wanted to achieve with this, so I just changed the code as little as possible to make it work. @BluntStuffy There is no difference in semantics and performance should be equal too. It kinda comes down to personal preference, although the explicit comparison of boolean variables with a boolean literal is considered unneccessary often. For example, the checkstyle tool, which does automated coding convention checks on Java code has an option to issue a warning if such explicit comparisons are used.
- Phil.
Last Edit: December 22, 2013, 04:21:21 pm by YaPh1l
@daedra descent Well, I didn't know what you wanted to achieve with this, so I just changed the code as little as possible to make it work. @BluntStuffy There is no difference in semantics and performance should be equal too. It kinda comes down to personal preference, although the explicit comparison of boolean variables with a boolean literal is considered unneccessary often. For example, the checkstyle tool, which does automated coding convention checks on Java code has an option to issue a warning if such explicit comparisons are used.
- Phil.
Basically i want to add powerups to the random box by making the powerups "weapons", however i just relized that its going to be a bit more complicated than that because the "weapon" would replace the current weapon that the player has.