server side transporters

Post your scripting questions / solutions here

Moderator: Moderators

Porkchop
Private
Posts: 9
Joined: Mon Jun 20, 2005 4:51 am

server side transporters

Post by Porkchop »

Okay, I've been searching for about 3 hours now- stumbling through scripting webpages, map making pages, and forums and none of what I'm reading makes any freaking sense.


My clan currently is running a spearhead server on our box so we have complete access to all the files. I am hoping to create a simple server side mod that adds in two transporters to the map remegan as a test. Eventually, I hope to add a couple to all of our stock maps, and maybe a box or two- nothing extreme.


How do I go about doing it? What tools do I need? Is this scripting or mapping? I am completely lost.



Thank you,
Pork.
User avatar
k47a
товарищ
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

Transporters? You mean, vehicles?
Umm, afaik, that would be mapping (and maybe scripting, too)
You need the SH SDK and Builder to compile the stuff afterwards. You can download all you need on the site...
Hope that helps.
And, umm, welcome!
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Teleporter

Post by tltrude »

I think you mean "teleporters", right?

You can add them to the map's script and all clients will be able to use them. This thread should help you out.
http://dynamic.gamespy.com/~map/mohaa/f ... t=teleport
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

or this one: http://dynamic.gamespy.com/~map/mohaa/f ... php?t=3084
but do a search for spawn + teleporter :wink:
Porkchop
Private
Posts: 9
Joined: Mon Jun 20, 2005 4:51 am

Post by Porkchop »

Thanks for the replies without flames :)

This is incredibly nubbishm, so bare with me. The extent of my coding knowledge is basic html.


Where to put the coding and what to do beyond that- I'm not completely sure. I know in my main directory there is a pak5.pk3 file that contains maps. the .bsp one, I think, if the one I need to edit? I'm not entirely sure where I should actually put the lines of code.


As for the code itself...




thread trigger_maker ( x x x ) ( x x x ) //(from) (to) 1
thread trigger_maker ( x x x ) ( x x x ) //(from) (to) 2
thread trigger_maker ( x x x ) ( x x x ) //(from) (to) 3
thread trigger_maker ( x x x ) ( x x x ) //(from) (to) 4

end

trigger_maker local.location local.dest:

local.marker = spawn script_model
local.marker model "static/corona_orange.tik"
local.marker.origin = (local.location)

local.trig = spawn trigger_multiple
local.trig.origin = (local.location)
local.trig setsize ( -20 -20 -20 ) ( 20 20 20 )
thread teleport local.trig local.dest

end

teleport local.trig local.dest:

local.trig waittill trigger
local.player = parm.other
local.player tele (local.dest)
thread teleport local.trig local.dest

end



Now, I'll need the exact coordinates from in game somehow, correct? I know by using fps 1 in the console I can get map coordinates. Is there an easier way to achieve this?

If anyone has a link to a tutorial designed to add server side items to the map- that may help too. But it needs to be very noobish :)



Thanks for the help.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Ok, it's really easy to script(code) for MOHAA, it's a lot like C/C++ so if you have any experience with those you'll cruise right along.

You need to open Notepad and put your script in it, save it along with your map with the same name as your map but with a .scr extension.

Example: Your map is named water.map, your script needs to be named water.scr and in the same folder as the map file.

Hope this helps ;)

Appendix A
Appendix B
Appendix C

EDIT: fps 1 does not return coordinates, it returns the refresh rate of your game. to get coordinates use coord, or location (?)

EDIT of the EDIT: No, do not modify anything that was installed with your game, simply make a new .zip folder, and name it what your mod will be. say your mod will be named couchPotato, then name that .zip file exactly like this

zzz_couchPotato.pk3

get rid of the .zip, ignore Windows telling you it may become unstable, it wont ;)
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

get coordinates by running to the location in your map, bring down console and enter viewpos or coord. these will return x y and z and an angle. you just need x y z for location and your destination.

put the thread trigger maker line above level waittill spawn. you only need one line per teleport. In the first () put your location and in the second put your destination.

put the trigger maker and teleport at the bottom of the script after end.
Porkchop
Private
Posts: 9
Joined: Mon Jun 20, 2005 4:51 am

Post by Porkchop »

lizardkid wrote:EDIT of the EDIT: No, do not modify anything that was installed with your game, simply make a new .zip folder, and name it what your mod will be. say your mod will be named couchPotato, then name that .zip file exactly like this


Okay... so, step by step because I'm a moron- I plan on doing this with remegen- adding two transporters in the spawns to enter the middle hotel.




Go onto remegan and find the exact coordinates for where I want the portal to be- and where I want them to drop at. For example, transport 1 would be at 123 456 789 (xyz) and I want it to go to 987 654 321 (xyz, again). We'll use one in this example.


So open notepad..


I put this in.




thread trigger_maker ( 123 456 789 ) ( 987 654 321 ) //(from) (to) 1

end

trigger_maker local.location local.dest:

local.marker = spawn script_model
local.marker model "static/corona_orange.tik"
local.marker.origin = (local.location)

local.trig = spawn trigger_multiple
local.trig.origin = (local.location)
local.trig setsize ( -20 -20 -20 ) ( 20 20 20 )
thread teleport local.trig local.dest

end

teleport local.trig local.dest:

local.trig waittill trigger
local.player = parm.other
local.player tele (local.dest)
thread teleport local.trig local.dest

end




save the notepadd as the remegan map name.. I'll have to look it up. Then, change the .txt to .scr ...


Then, grab the .bsp file, zip it together with my .scr and name it zzz_transporters.pk3


and upload?
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

This also would work.
main:

// set scoreboard messages
setcvar "g_gametypestring" ""
setcvar "g_obj_alliedtext1" ""
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" " "
setcvar "g_obj_axistext1" " "
setcvar "g_obj_axistext2" " "
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "none"


level waittill prespawn


//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/dm/mohdm3.scr
exec global/ambient.scr mohdm3

level waittill spawn

thread teleporter

end

teleporter:
local.trigger = spawn trigger_multiple

local.trigger.origin = ( 00.00 000 00.00 ) //origin

local.trigger setsize ( -10 -10 -10 ) ( 10 10 10 )

local.trigger setthread teleport

local.trigger message "Teleporting"
local.trigger wait 1

local.trigger delay 0



teleport:

self waittill trigger

local.player=parm.other
if (local.player.isteleport==1)

end

local.player.isteleport=1
local.player tele 0 0 900

wait 1

local.player.isteleport=0

end
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Then, grab the .bsp file, zip it together with my .scr and name it zzz_transporters.pk3


and upload?
Not exactly the .pk3 process, but close.

You've got the script part right, but don't copy the Remagen .bsp or anything liek that, people already have those with their game, they dont need a cpy ;)

after you have the .scr:

make a new .zip file
rename it to .pk3
((sorry i forgot this part))=
place the .scr file in a folder named maps
make another folder named dm, put that inside maps, put the .scr in dm
place those folders in the new .pk3
save as zzz_transporters.pk3
upload

Sorry about that :oops:
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

ah ok. what game are you using aa,spearhead or breakthrough?
Porkchop
Private
Posts: 9
Joined: Mon Jun 20, 2005 4:51 am

Post by Porkchop »

spearhead.


And I upload the .pk3 file to the server and it'll automatically load onto the server? No one needs to download this, right?


y'all makin' this sound simple :) there's gotta be something I'm missing hmm
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Nope, scripts uploaded to the server don't need to be downloaded by clients. however, new maps and such do. scripts are pretty much the only thing that dont need to be downlaoded by clients.

Yeah, it's that easy ;)
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

well, whenever i do stuff like this i allways start with as much stock info that i can. the script you want to edit is in your mohaa/mainta pak1.pk3 -
it is called mohdm3.scr and it is in maps/dm folder.

extract the mohdm3.scr into a new folder titled "dm" and put dm in a new folder called "maps". Put maps/dm/mohdm3.pk3 in your own pk.3 - title it something like zzz-porkchopmod.pk3

to edit the scr i use notepad (within the pk3 right click your file and press view). I am sure there are better ways it just the way i do it.

Every time you edit the scr. you need to repack it into your pk3. your newly saved scr will default to the root directory. extract it to your maps/dm and add maps/dm/mohdm3.scr (with your new changes) back to your zzz-porkchopmod.pk3

whew- place your pk3 in your pcs mohaa/mainta and restart to test it. when you are happy with the results then put it on your servers mainta and restart.
Porkchop
Private
Posts: 9
Joined: Mon Jun 20, 2005 4:51 am

Post by Porkchop »

woot, ty guys. I'll be testing this out. I assume placement for boxes to provide just a little bit of cover in key places would be simular- in that script file, correct?


We don't want to go nuts- but we've been playing spearhead for so long we just wanna add some twists to the maps. I'm also interested in Lambon (I think that's his name) single player map conversions- or, if I get adept at this, attempting to create my own.



Anyway, thanks again for all the help. Tomorrow, I'll be testing and, hopefully, adding the mod to the server
Post Reply