Hi, i have the standard TOM_BMX script for the buyable ending in my map but instead of requiring eletricity to buy i want that the player reaches a at least round 22 to buy it, i don't have any knowlege in scripting and i'm hoping someone can help
end_game() { user = undefined; cost = 22222; //change to cost that you want
self setCursorHint("HINT_NOICON"); self UseTriggerRequireLookAt(); self setHintString("The power must be activated first"); //remove line if you want it to work without power
flag_wait( "electricity_on" ); //remove line if you want it to work without power
self setHintString("Pressione &&1 Para fugir no carro do Colono [Custo da Gasolina: "+cost+"]"); //text hint trigger
If you want scripts / features made for you, then contact me by PM or email / skype etc it will cost you tho so if you have no intention of reciprocating don't even waste my time
if( level.round_number == level.round_to_escape ) //quando chegar no round 22, "libera" o trigger { level.can_scape = true; }
Code Snippet
Plaintext
if( level.round_number == level.round_to_escape ) //quando chegar no round 22, "libera" o trigger { level.can_scape = true; wait .1; }
add a wait, or if they "hold" the button, it may infinite loop - depending on if the trigger is already set to delay or not ( triger use is, trigger raidius isnt for example )
your also waiting on "between round over" from round 1 onwards. As its then "waiting" for someone to touch the tigger before continuing & your not checking equal to "or greater"
Last Edit: January 22, 2016, 05:08:24 am by Harry Bo21
end_game() { level.round_to_escape = 22; //round to escape (round pra fugir no blindado) level.can_scape = false; user = undefined; cost = 22222; //change to cost that you want
this will make it so whenever the player tries to activate the trigger it will test to see if they have reached round 22 or greater instead of only being able to work at the end of the round specifically on round 22
thats true i forgot about the possibility of undefined. i was just trying to explain that you dont have to test for equals to when using boolean values.
they used it before just didnt have a seperate function, so did the ( isDefined( value ) && value ) thing in the argument rather than using a function
that would explain why i havent found it anywhere in waw. i might have to go and change any of my statements from (isDefined(value) && value) to the isTrue method. thanks for the new utility lol
lol read my post again, just edited it to show another treyarch fail you may need
I only noticed coz i was testing my monkeys so flew through one of my doors, threw it, and it still counted as "in bounds" despite me using that check and manually entering a "inactive" zone lol. When i looked i saw why instantly...
In theory this means, if you played Der Riese, and threw a monkey into another zone that was still closed - it would count, and all the zombies would freeze in place coz they cant "get" there
Last Edit: January 22, 2016, 05:33:44 am by Harry Bo21
isTrue( value ) { if ( isDefined( value ) && value ) return true;
return false; }
How to script like Treyarch:
1. Create a bunch of bogus functions that do literally nothing
2. Create functions using bogus logic
3. Duplicate a function everytime you need to use it in a campaign level instead of including it into a utility where it can be accessed once with the same code.
4. Leave commented code from the initial release of the game in the scripts
Edit:
For call of duty games in general. So many crappy utility functions that use bogus logic.
Last Edit: January 22, 2016, 05:49:40 am by daedra descent
1. Create a bunch of bogus functions that do literally nothing
2. Create functions using bogus logic
3. Duplicate a function everytime you need to use it in a campaign level instead of including it into a utility where it can be accessed once with the same code.
4. Leave commented code from the initial release of the game in the scripts
Edit:
For call of duty games in general. So many crappy utility functions that use bogus logic.
cant forget to include a bunch of methods that are never used in your own scripts!
cant realy deny that, although their work in BO2 is monumentally better than some of the complete and utter shit ive seen in WAW lol
like the jugg bug... 3 entire maps and still didnt get fixed
even then tho they do some way overcomplicated shit. Should see brutus script lol
Like following a piece of string in a bundle
Ill admit tho i struggle deciding what should be placed in a shared utility, have to be careful not to be calling anything that may error if that "other thing" doesnt exist
I had a bit of logic for redirecting AI, but relied on changes i made to zombiemode_spawner so when i handed my utility out with something else, everyone got game crashes lol
anything you cant find in the game scripts are usually written in the engine. Sometimes theres a few missing off the script references. I work it out this way
wordWord() - engine based word_word() - treyarch made it
Last Edit: January 22, 2016, 06:02:18 am by Harry Bo21
anything you cant find in the game scripts are usually written in the engine. Sometimes theres a few missing off the script references. I work it out this way
wordWord() - engine based word_word() - treyarch made it
Engine must be written in C++ then, since wordWord is what you'd do for an Object Orientated language.