Home   Help Search Login Register  

Author Topic: respawn + vehicle creation  (Read 1328 times)

0 Members and 1 Guest are viewing this topic.

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
respawn + vehicle creation
« on: 16 Dec 2004, 02:30:05 »
Firstly, could somone tell me how to make every player (for this mp mission) respawn without weapons at a marker or atleast a location? Ive already searched the forum but nothing about locations!

Secondly, I would also like to know, when I use my addaction command "buy helicopter $1000" a helicopter spawns.. So how do I make an empty helicopter (a chinook) spawn on a specific location, a marker or game logic, like I asked above?

It makes me nervous to wait for an answer :P! It doesnt have to be  able to be locked or unlocked becuase this small role-playing like mission allows west vs east in a role-playing way.. Its hard to explain. Im wondering how to add actions like to make all players have an addaction "give leader $100" so if you trust each other you can buy things for each other :P.. I know how to do this anyway... Anyone interested in the mission yet  ;D?
« Last Edit: 16 Dec 2004, 02:32:43 by OFPfreak »
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:respawn + vehicle creation
« Reply #1 on: 16 Dec 2004, 02:48:09 »
You might want to download a command reference, its got all this stuff in it. ;)

To make a person, then you make, say a marker where you want the person to spawn. Then make a script with something like this in it:

Code: [Select]
"*UnitClassName*" createUnit ["westBarracks",group this,"removeAllWeapons this",0.5,"COLONEL"]

I'm pretty dang sure that this is the code. :P

TO create a vehicle its even easier.

Code: [Select]
tank1 = "*VehicleClassName*" createVehicle setPos [getMarkerPos "westHelipad" select 0,getMarkerPos "westHelipad select 1, getMarkerPos "westHelipad select 2]

to find the class names of the units or vehicles, make a radio trigger and in its on activation line put

Code: [Select]
hint format["Type is: %1",typeOf myUnit]

where myUnit is the type of unit/vehicle you want to create
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:respawn + vehicle creation
« Reply #2 on: 16 Dec 2004, 02:54:33 »
1) ehh... i don't know for sure, without working on it a bit, someone else will come by and tell you

2)unit addaction ["buy chopper",{"Ch47D" createvehicle getmarkerpos "vehiclespawn"}]

or whatever you want to call the marker

or use getpos on a game logic:

unit addaction ["buy chopper",{"Ch47D" createvehicle getpos vehiclespawnGameLogic}]

or in relation to the player:

unit addaction ["buy chopper",{"Ch47D" createvehicle [(getpos unit select 0) + 15,(getpos unit select 1) + 15, 0]}]

that will be 15m north and 15m east of the unit that buys it
« Last Edit: 16 Dec 2004, 02:55:47 by Triggerhappy »

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:respawn + vehicle creation
« Reply #3 on: 16 Dec 2004, 03:02:39 »
hey thx guys! That helped me out! But I still dont get the REspawn thingy  :o
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:respawn + vehicle creation
« Reply #4 on: 16 Dec 2004, 03:54:24 »
1)first, in your description.ext file, put:
Code: [Select]
respawn = 4
respawndelay = 5
unit addeventhandler ["killed",{[unit] exec "setrespawnman.sqs"}]

setrespawnman.sqs
Code: [Select]
_unit = _this select 0
_type = format ["%1",typeof _unit]
_grp = group _unit
[_unit] join grpnull
_spawnUnit = _type createunit [getmarkerpos "spawnpoint",group _unit,"removeallweapons this"]
~5.5
[_spawnUnit] join _grp
exit

what that does, is forces the player to become the spawned unit, then rejoin his group, but you need the respawn setting in your description.ext

you've been asking a lot of questions lately... it seems to me that you would be better off learning some of the basics especially before trying an rpg version of flashpoint, which requires some heavy scripting.... just an opinion.
In fact, i don't even think i'm a good enough scripter to do that by myself, at least if i want it to be good....

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:respawn + vehicle creation
« Reply #5 on: 16 Dec 2004, 04:27:39 »
wait a second!! sorry man I should have known there was already a spawn setting in a script editor of mine... Sadly it only helps with adding weapons/ammo and briefings, overviews, and description.ext's! Thanks anyway.. but the vehicle creation is what I still need to know.. too complicated.. ???
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:respawn + vehicle creation
« Reply #6 on: 16 Dec 2004, 07:41:05 »
 :( never mind.. I still dont get it... so I created the respawn but I dont know what command to use to make it spawn/respawn at a marker or game logic!
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

StonedSoldier

  • Guest
Re:respawn + vehicle creation
« Reply #7 on: 16 Dec 2004, 16:30:24 »
@triggerhappy,

unit addaction ["buy chopper",{"Ch47D" createvehicle getmarkerpos "vehiclespawn"}]??...the second element should be the name of the script....

unit addaction ["buy chopper","chopperspawn.sqs"]

chopperspawn.sqs

"Ch47D" createvehicle getmarkerpos "vehiclespawn"

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:respawn + vehicle creation
« Reply #8 on: 16 Dec 2004, 20:04:49 »
ok so um... whats the 2nd element?? And as I think it is is erm....
for in the script:

unit addaction ["buy chopper",{"Ch47D" createvehicle getmarkerpos "vehiclespawn"}]?? and something behind this

and in init:

Condition:

On Activation: action5=P1 addaction ["buy chopper $1000","chopperspawn.sqs"]

On Deactivation: P1 removeaction action5 (i already got action 1 to 4)

So basically the only thing more I need to know is the 2nd element ;D
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:respawn + vehicle creation
« Reply #9 on: 16 Dec 2004, 21:24:52 »
ahh crap, i mixed up addaction and addeventhandler, my bad

the second element is "chopperspawn.sqs"
a script which will make the chopper
« Last Edit: 16 Dec 2004, 21:26:06 by Triggerhappy »

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:respawn + vehicle creation
« Reply #10 on: 17 Dec 2004, 02:19:37 »
I think im getting it :P.. Im using a unit setpos (getpos spawn) (spawn is name of game logic) and its already working ;D! Maybe I can at the start hide it in the corner of the map on some pallets :P or 20000 m above ground :P.. I'll see.. anyway im putting the mission in the mission depot (single player) but its still a beta but I already used like 20 scripts just for 3 players!! I recommend you not to use p2 or p3 and not order them things becuase they just waste your time.. ai not supported. So dont take it as my best skilled map, no just a beta still.. Im finding some .pbo extraction programs right now and it will be on the site in no time  ;)!
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:respawn + vehicle creation
« Reply #11 on: 17 Dec 2004, 02:29:30 »
You should put it in the Missions: Beta Testing Forums first.

It will possibly then get tested by anyone who wishes to try it out.

It is better to do this......I don't think it will be accepted in the Missions Depot as a beta..........I could be wrong though.


Planck
« Last Edit: 17 Dec 2004, 02:43:27 by Planck »
I know a little about a lot, and a lot about a little.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:respawn + vehicle creation
« Reply #12 on: 17 Dec 2004, 02:40:48 »
nope, so say
THE RULES

hehe, that was fun, but yeah read the rules so you know how everything works, it won't take long, and everything gets explained

RedHouse

  • Guest
Re:respawn + vehicle creation
« Reply #13 on: 17 Dec 2004, 03:18:26 »
I think im getting it :P.. Im using a unit setpos (getpos spawn) (spawn is name of game logic) and its already working ;D! Maybe I can at the start hide it in the corner of the map on some pallets :P or 20000 m above ground :P.. I'll see.. anyway im putting the mission in the mission depot (single player) but its still a beta but I already used like 20 scripts just for 3 players!! I recommend you not to use p2 or p3 and not order them things becuase they just waste your time.. ai not supported. So dont take it as my best skilled map, no just a beta still.. Im finding some .pbo extraction programs right now and it will be on the site in no time  ;)!

if you don't want to hide it in the corner of the map, put this in your init.sqs

spawn = "logic" createVehicle [0,0,0]

or something like that

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:respawn + vehicle creation
« Reply #14 on: 17 Dec 2004, 06:50:08 »
Quote
hehe, that was fun, but yeah...

cmon ure making me nervous! What was fun!?
???  ???  ???  ::)  :o  ;D  :o  ::)  ???  ???  ???
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:respawn + vehicle creation
« Reply #15 on: 17 Dec 2004, 21:28:57 »
i wanted the RULES on my last post to be a lot bigger, so i wrote that was fun.... cuz i got to write really big, and stuff, and i didn't want to appear standoffish... i dont know....

Most people won't make feel nervous around here...stupid at times, yes, but not nervous  ;D