Random Script Help

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Random Script Help

Post by Nekoneko » April 21st, 2011, 1:52 pm

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(..);

User avatar
iCYsoldier
CJ Worshipper
CJ Worshipper
Posts: 289
Joined: December 5th, 2009, 7:12 am
Location: Australia

Re: Random Script Help

Post by iCYsoldier » April 21st, 2011, 2:09 pm

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

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Random Script Help

Post by Nekoneko » April 21st, 2011, 2:32 pm

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?

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Random Script Help

Post by Nekoneko » April 21st, 2011, 2:52 pm

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?

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Random Script Help

Post by Nekoneko » April 21st, 2011, 3:44 pm

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?

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Random Script Help

Post by Nekoneko » April 21st, 2011, 4:22 pm

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.

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Random Script Help

Post by F |Madness| U » April 22nd, 2011, 1:43 pm

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.
-

User avatar
RAGEQUiT
CJ Newbie
CJ Newbie
Posts: 59
Joined: March 1st, 2011, 7:16 pm

Re: Random Script Help

Post by RAGEQUiT » April 24th, 2011, 1:55 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests