Page 1 of 1

Random Script Help

Posted: April 21st, 2011, 1:52 pm
by Nekoneko
I just started scripting yesterday and have some questions.
(I'll probably have more coming, so I'll just post here)
First would be
how can i stop a thread until the players ammo is 0.
I know self GetWeaponAmmoStock(self GetCurrentWeapon()) gives the total ammo (even had a hard time figuring that out).
So would it be possible to do something like
waittill(-the ammo is 0-);
self givemaxammo(..);

Re: Random Script Help

Posted: April 21st, 2011, 2:09 pm
by iCYsoldier
You could just try

Code: Select all

while(GetWeaponAmmoStock(self GetCurrentWeapon()) > 0){
    wait 0.1;
}
self giveMaxAmmo(self GetCurrentWeapon());// This will run when the ammo is 0
It just saves the need for an if statement

Re: Random Script Help

Posted: April 21st, 2011, 2:32 pm
by Nekoneko
Hm ok. I've thought about that.
So there isnt a way to just make the code stop and then continue.
Is it bad if too many Scripts are running parallel?

Re: Random Script Help

Posted: April 21st, 2011, 2:52 pm
by Nekoneko
Thanks.
And too many moving objects + players on server make the objects lag?
In codjumper_training if too many people are on, the conveyor belt lags.
Is it just how cod4 handles it or is something in the script which causes the lag?

Re: Random Script Help

Posted: April 21st, 2011, 3:44 pm
by Nekoneko
Ah ok.
Still got some mapping questions ^^;
I have a terrain prefab and i cant make it non-coliding (maybe because it being terrain).
And is there a way to make moving water?

Re: Random Script Help

Posted: April 21st, 2011, 4:22 pm
by Nekoneko
Thanks KS.
I got the terrain to work somehow oO.
The water. ill go look for.

Just 1 last question, then im ok for now^^

Where do i get the texture aa_slippery.
like on ib_glass_v3 the slide has it.

Re: Random Script Help

Posted: April 22nd, 2011, 1:43 pm
by F |Madness| U
Nekoneko wrote:Where do i get the texture aa_slippery.
like on ib_glass_v3 the slide has it.
Can't confirm this but I think it may be a custom texture inside the .iwd of the map? Most of that map looks like custom textures anyway I don't remember seeing any of those textures in normal CoD4.

Re: Random Script Help

Posted: April 24th, 2011, 1:55 pm
by RAGEQUiT
Nekoneko wrote:Where do i get the texture aa_slippery.
like on ib_glass_v3 the slide has it.
well I made that texture using the asset manager.
you can simply put a check into " special surface properties / slick "
xSnipeZx wrote:Can't confirm this but I think it may be a custom texture inside the .iwd of the map? Most of that map looks like custom textures anyway I don't remember seeing any of those textures in normal CoD4.
nope, as far as I can remember I only used 2 custom textures .
The invisible slick texture & the one @ the ski ramp :)

- r4d