Page 2 of 6

Re: help with script teleport

Posted: April 30th, 2011, 10:41 am
by Ben xD
Lol soviet i was looking at ur picture for like 10 minutes, Its addicting :P

Re: help with script teleport

Posted: April 30th, 2011, 3:38 pm
by Ryan
Rezil 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").
i dont understand what you mean man

Re: help with script teleport

Posted: April 30th, 2011, 5:13 pm
by Drofder2004
Ryan wrote:
Rezil 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").
i dont understand what you mean man
Firstly, create a 15 character long variable using random numbers.
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"')

Re: help with script teleport

Posted: April 30th, 2011, 5:44 pm
by IzNoGoD
Drofder2004 wrote:(or alternatively 'myVariable =+ "str"')
(or alternatively 'myVariable += "str"')

Re: help with script teleport

Posted: April 30th, 2011, 8:03 pm
by Drofder2004
IzNoGoD wrote:
Drofder2004 wrote:(or alternatively 'myVariable =+ "str"')
(or alternatively 'myVariable += "str"')
My most common error :(
One day I will correctly remember the direction without looking at a cheat sheet

Re: help with script teleport

Posted: April 30th, 2011, 8:53 pm
by waywaaaard
Drofder2004 wrote: My most common error :(
One day I will correctly remember the direction without looking at a cheat sheet
One day :P

Re: help with script teleport

Posted: April 30th, 2011, 9:01 pm
by Ryan
i still dont understand it... its like jumping from 1+1=2 to pro maths...

Re: help with script teleport

Posted: April 30th, 2011, 10:13 pm
by Drofder2004
Ryan wrote:i still dont understand it... its like jumping from 1+1=2 to pro maths...
Nah, this is simple. Use Pseudocode and create a step-by-step of what needs to happen

First, an empty string variable.

Code: Select all

myVariable = "";
[/size]
Second create a loop (for/while are the easiest)

Code: Select all

myVariable = "";
for(;;)
{
   
}
[/size]
Third a Randomly generated number between 0-9

Code: Select all

myVariable = "";
for(;;)
{
   // randomInt(10);
}
[/size]
Now make the variable update with the new number each loop

Code: Select all

myVariable = "";
for(;;)
{
   myVariable = myVariable + randomInt(10);
}
[/size]
Now we need to stop the loop after 15 characters

Code: Select all

myVariable = "";
for(i=0;i<15;i++)
{
   myVariable = myVariable + randomInt(10);
}
[/size]

Re: help with script teleport

Posted: May 1st, 2011, 9:27 am
by IzNoGoD
If you run this code, try what happens if you switch myvariable=""; with myvariable=0;
That way you might understand things a little better.

Re: help with script teleport

Posted: May 1st, 2011, 11:20 am
by SubGunner
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

Re: help with script teleport

Posted: May 1st, 2011, 11:33 am
by Ryan
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"?

Re: help with script teleport

Posted: May 1st, 2011, 11:44 am
by SubGunner
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.

Re: help with script teleport

Posted: May 1st, 2011, 1:52 pm
by Drofder2004
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.
Read through the thread. If he wanted to simply copy and paste someone elses work, the thread would've finished on the first page.

Re: help with script teleport

Posted: May 1st, 2011, 1:52 pm
by Drofder2004
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"?
Read through my post step by step and at what point do you not understand?
Wording or the method used in the coding?

Re: help with script teleport

Posted: May 1st, 2011, 2:05 pm
by Ryan
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...