Page 2 of 2

Posted: October 28th, 2005, 1:16 am
by Dan2k3k4
I sorta used this code Drofder for making a small diving board map someone wanted... basically instead of climbing the ladder to the top (which was several thousand feet away) I just used this and it threw you all the way up to the top :D It was really helpful, Thanks :)

And Luke I guess wants to put trigger boxes in the air soo if you jump a certain way you pass through the trigger box and get shot up I guess...

Posted: October 28th, 2005, 1:54 am
by Luke
i mean like something which just launches you up, like one of those angled ladder things, but still being able to influence where u land by the directional keys, rather than it taking u from point a to point b..if thats not possible nvm, but even using the same code it doesnt send me to the coordinates defined in the script, i'll try again and if no luck send it to drofder for inspection :P

Posted: October 28th, 2005, 2:23 am
by Drofder2004
Luke wrote:i mean like something which just launches you up, like one of those angled ladder things, but still being able to influence where u land by the directional keys, rather than it taking u from point a to point b..if thats not possible nvm, but even using the same code it doesnt send me to the coordinates defined in the script, i'll try again and if no luck send it to drofder for inspection :P
Ahh, that should be quite easy... (hopefully)

jump_pad()
{
jumppad = getent ("jumppad","targetname"); //trigger_multiple jumppad

while (1)
{
jumppad waittill ("trigger",user);
if (user istouching(jumppad))
{
throw = user.origin + (200, 0, 750); //direction of launch
dest = spawn ("script_model",(0,0,0)); //spawn a script_model
dest.origin = user.origin; //give script_model same origin as user
dest.angles = user.angles; //give script_model same angle as user
user linkto (dest); //link the user to the script_model
time = 1; //speed in seconds
dest movegravity (throw, time, 0.5,0.5); //throw the script model (and the player) upwards at speed (time) with accel and decel of 0.5 seconds.
wait 1; //wait
user unlink(); //unlink the player from the script_model
wait 1; //wait
}
}
}

Change the Wait time in bold to a smaller number, such as 0.5, this will make it so the player can move after 0.5 seconds (halfway up the jump).

Untested, but im sure it is something :)

Posted: October 28th, 2005, 7:36 pm
by Luke
did the same thing..what is that stuff in the script about the script_model? are you supposed to make one?, i couldnt see it in your map

Posted: October 29th, 2005, 8:44 am
by Drofder2004
Luke wrote:did the same thing..what is that stuff in the script about the script_model? are you supposed to make one?, i couldnt see it in your map
this?
dest = spawn ("script_model",(0,0,0)); //spawn a script_model

This "spawns" a script model, no need to make it. Ill give an explantion of what happens...

When the user steps on the jumppad, the script grabs the users origin and adds on the direction to throw them, it stores this as "throw". It then spawns a script model at the centre origins (0,0,0) which is now called "dest".
The script then tells "dest" to make its origin the same as the players and then also tells it to take the same angles (angles are the direction the player is facing).

It then links the user to "dest", this stops the player from moving...

It then launches the "dest" script_model, and as that is launch, because the player is linked to it, the player will launch also. Then it unlinks the player.

----------------
Back to the question, have you tried setting the wait to a very low time? or no time at all?

If it doesn't work, I cannot think of how it can :(

Posted: October 29th, 2005, 5:39 pm
by Luke
ok, well i've tried changing the wait time to 0.5, and tried it with 0.0, but whatever i do the pad still throws me to one side..shall i send u the map and script then?

Posted: October 29th, 2005, 6:52 pm
by Drofder2004
Luke wrote:ok, well i've tried changing the wait time to 0.5, and tried it with 0.0, but whatever i do the pad still throws me to one side..shall i send u the map and script then?
sure, I could take a look, but no guarentees :)

Posted: November 19th, 2005, 11:21 am
by Pwn-Rikku
Couldnt you just make an invisable platform appear and take you up. it goes so fast then disapears you fly up?
sorta like this

Code: Select all

main()

thread lanch();

lanch()
{
     invisplatform = getent ("invisible","targetname")
     trigger = getent ("trigger","targetname");

trigger waittil ("trigger")
wait (1)

invisplatform movez (xx,xx,xx)
invisplatform waittil ("movedone")

invisplatform delete
}
this is not tested and just did out of my head.. prob wont work