The 'QuakeC lessons' thread[prev. help with script teleport]
Moderator: Core Staff
Re: help with script teleport
Lol soviet i was looking at ur picture for like 10 minutes, Its addicting
The Only Reason Everyone Holds on to Memories So Tightly Is Because Memories Are the Only Things That Don't Change When Everything and Everyone Else Does
Re: help with script teleport
i dont understand what you mean manRezil wrote:Make a variable that contains some random numbers that is 15 letters long, then print out that variable to the player. You can use the built-in function RandomInt(<max>) to get a random value from 0 to <max>-1. Also, you can add to a string by using +("ap"+"ple" would generate a string with the value "apple").
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: help with script teleport
Firstly, create a 15 character long variable using random numbers.Ryan wrote:i dont understand what you mean manRezil wrote:Make a variable that contains some random numbers that is 15 letters long, then print out that variable to the player. You can use the built-in function RandomInt(<max>) to get a random value from 0 to <max>-1. Also, you can add to a string by using +("ap"+"ple" would generate a string with the value "apple").
To create a string of 15 individual numbers, you will be required to create a string variable and then append a character to that variable after each loop.
So, in Pseudocode:
Create (string) Variable. [*] Generate a random digit and append this digit to the existing variable. Loop from [*] until variable contains 15 characters.
The function for a Random Integer is RandomInt(x) where x is an integer greater than 0.
The method of appending to a variable is 'myVariable = myVariable + "str"' where 'str' is the string you wish to add on (or alternatively 'myVariable =+ "str"')
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: help with script teleport
(or alternatively 'myVariable += "str"')Drofder2004 wrote:(or alternatively 'myVariable =+ "str"')
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: help with script teleport
My most common errorIzNoGoD wrote:(or alternatively 'myVariable += "str"')Drofder2004 wrote:(or alternatively 'myVariable =+ "str"')
One day I will correctly remember the direction without looking at a cheat sheet
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 2214
- Joined: February 6th, 2006, 3:18 pm
- Location: Germany/Bayern
Re: help with script teleport
One dayDrofder2004 wrote: My most common error
One day I will correctly remember the direction without looking at a cheat sheet
THAT HANDS WERE NOT TRACED!
visit my blog: Link
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Re: help with script teleport
i still dont understand it... its like jumping from 1+1=2 to pro maths...
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: help with script teleport
Nah, this is simple. Use Pseudocode and create a step-by-step of what needs to happenRyan wrote:i still dont understand it... its like jumping from 1+1=2 to pro maths...
First, an empty string variable.
Code: Select all
myVariable = "";
Second create a loop (for/while are the easiest)
Code: Select all
myVariable = "";
for(;;)
{
}
Third a Randomly generated number between 0-9
Code: Select all
myVariable = "";
for(;;)
{
// randomInt(10);
}
Now make the variable update with the new number each loop
Code: Select all
myVariable = "";
for(;;)
{
myVariable = myVariable + randomInt(10);
}
Now we need to stop the loop after 15 characters
Code: Select all
myVariable = "";
for(i=0;i<15;i++)
{
myVariable = myVariable + randomInt(10);
}
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: help with script teleport
If you run this code, try what happens if you switch myvariable=""; with myvariable=0;
That way you might understand things a little better.
That way you might understand things a little better.
Re: help with script teleport
Here ya go download and extract this zip file. Inside is a teleporter prefab.
If you make copies of it make sure you delete the targetname and targets of the trigger and script_origin before making copies. Otherwise they will all link together. Each grouped trigger and script_origin must have unique names.The Trigger is the entrance and the script_origin is the exit.
Also includes a teleporter.gsc file which must be called from your mapname.gsc file and be placed in the maps/mp folder.
http://rrmsweb.com/sub/teleporter.zip
If you make copies of it make sure you delete the targetname and targets of the trigger and script_origin before making copies. Otherwise they will all link together. Each grouped trigger and script_origin must have unique names.The Trigger is the entrance and the script_origin is the exit.
Also includes a teleporter.gsc file which must be called from your mapname.gsc file and be placed in the maps/mp folder.
http://rrmsweb.com/sub/teleporter.zip
Re: help with script teleport
it seems like that forum doesnt like me and keeps deleting my posts...
i still dont understand it i dont know am i officially to ostupid to script or hsould i carry on desperately trying to grasp it with not the slightest chance of success forming the basis for a news announcement ending with the words "then he pointed the weapon at himself"?
i still dont understand it i dont know am i officially to ostupid to script or hsould i carry on desperately trying to grasp it with not the slightest chance of success forming the basis for a news announcement ending with the words "then he pointed the weapon at himself"?
Re: help with script teleport
No luck with my teleporter? That thing is the easiest script to setup. Even multiple ones.
Don't need to ever alter the script file either.
Don't need to ever alter the script file either.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: help with script teleport
Read through the thread. If he wanted to simply copy and paste someone elses work, the thread would've finished on the first page.SubGunner wrote:No luck with my teleporter? That thing is the easiest script to setup. Even multiple ones.
Don't need to ever alter the script file either.
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: help with script teleport
Read through my post step by step and at what point do you not understand?Ryan wrote:it seems like that forum doesnt like me and keeps deleting my posts...
i still dont understand it i dont know am i officially to ostupid to script or hsould i carry on desperately trying to grasp it with not the slightest chance of success forming the basis for a news announcement ending with the words "then he pointed the weapon at himself"?
Wording or the method used in the coding?
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: help with script teleport
why is it myVariable or can it be anything actually?
why is it myVariable = ""; what do the "" do there
why is it for(;;) what do the ;; do there
why is it i=0; i<15 what is i?
how do you print out this stuff then? rezil asked to make players able to see this then...
why is it myVariable = ""; what do the "" do there
why is it for(;;) what do the ;; do there
why is it i=0; i<15 what is i?
how do you print out this stuff then? rezil asked to make players able to see this then...
Who is online
Users browsing this forum: No registered users and 2 guests