Home   Help Search Login Register  

Author Topic: Pitching tents + making it a respawn  (Read 2171 times)

0 Members and 1 Guest are viewing this topic.

Anthrid

  • Guest
Pitching tents + making it a respawn
« on: 13 Mar 2004, 07:20:30 »
Can anyone do that? I am a script n00b so....someone please do something like this, or similar, or if it's somewhere out there, tell me where  :)  

More detailed of script:
-Pitch a tent: starts out flat, and u build like workers in CTI do (if anyone played CTI)
-Make a fireplace automatically when u pitch
-Able to pack it up, yet at speeds of pitching it
-is it possible to set as spawn without any hard scripts?

I know it's harder than it looks, and i would appreciate it SO MUCH if someone can atleast make the fir bullet work  :)

Thanks

DBR_ONIX

  • Guest
Re:Pitching tents + making it a respawn
« Reply #1 on: 13 Mar 2004, 11:30:17 »
Shouldn't be too hard :)
I'll guess you want the player to select "Set up camp" in the actions menu (Where drop weapon, pick up weapon etc apper)
Code: [Select]
player removeaction campactiong
_centerposx = getpos player select 0
_centerposy = getpos player select 1
_centerposz = getpos player select 0

tent1 = "CampEast" camcreate [_centerposx + 5, _centerposy, _centerposz]
fire1 = "Fire" camcreate [_centerposx + 2, _centerposy, _centerposz]

tent1 setdammage 1
~5
tent1 setdammage 0.5
~5
tent1 setdammage 0
~10
fire1 inflame true
HINT "Camps up!"

You'll need to save this in notepad (etc), and save it as setupcamp.sqs (Anything really).. But make sure you change Text File (*.txt) to All Files
Save this in your mission directory (/Op Flashpoint Dir/Users/UserName/Mission Name.intro but a few thing changed)

Then, add to the players INIT field (In Advanced mode), campactiong = this addaction ["Set up camp", "setupcamp.sqs"]

Save/Preview the mission.. Walk around a bit, and press enter on the Set Up Camp menu option..
The tent should apper, flatened (Like it's destroyed), then half up (Half destroyed) and then 5 seconds later, it's as good as new!
It's the best way I can think of ATM, sorry :)

Warning : This script might not work!!
I'm not sure of the class names for the fire and tent.. I've looked in cfgVehicles.hpp and this is what I guess they are..
Also, the tent/fire appers to the north.. You need trig to get it to apper in front of the player.. It shouldn't matter though..

Hope this works!
- Ben
BTW, if you could provide more detail, I could possibly improve this script...

DBR_ONIX

  • Guest
Re:Pitching tents + making it a respawn
« Reply #2 on: 13 Mar 2004, 11:37:15 »
Oh.. I've not played CTI.. But heres the rest of the script..
movecamp.sqs
Code: [Select]
deletevehicle fire1
deletevehicle tent1
respawn setmarkerpos [getmarkerpos orig_respawn]
campactiong = this addaction ["Set up camp", "setupcamp.sqs"]

And add this to the other script :
Code: [Select]
respawn setmarkerpos [_centerposx + 5, _centerposy, _centerposz]

Make the respawn your respawn (In the decription.ext thing.. Can't help you there..), and make a marker wherer you want the respawn at the respawn.. And make a respawn_orig in the same place (Place it next to it, and move it over)

- Ben

Anthrid

  • Guest
Re:Pitching tents + making it a respawn
« Reply #3 on: 13 Mar 2004, 19:58:57 »
Thanks for all the help guys  :)  :)  :) ....i'll try to work this out, somehow. If not, i'll ask someone to do this

Appreciate your answers  ;D

-EDIT: This is for the east tent?
« Last Edit: 13 Mar 2004, 20:19:25 by -=Anthrid=- »

DBR_ONIX

  • Guest
Re:Pitching tents + making it a respawn
« Reply #4 on: 13 Mar 2004, 20:49:52 »
Thats the one I found.. I think you could use :
Tent
or
WestTent

Good luck :)
- Ben

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Pitching tents + making it a respawn
« Reply #5 on: 13 Mar 2004, 20:53:09 »
Shouldnt that tope part be;

_centerposx = getpos player select 0
_centerposy = getpos player select 1
_centerposz = getpos player select 2

?

Anthrid

  • Guest
Re:Pitching tents + making it a respawn
« Reply #6 on: 13 Mar 2004, 22:02:23 »
Prolly righ,t since it didn't appear when i used (yep, i tried it all by myself)

Onix, you asked about more detail, so ok...

-Make west tent(open) open facing you.
-maybe adding your camp on the map? (if possible)
I'll think of some more if i can, i gonna try stuff out :-)

EDIT: Ok, i got "script setupcamp.sqs not found" what do i do?

EDIT2: I might know what id id wrong.......nope, i stuck

EDIT3: OK, successful, except it's a bit inside the ground, so should I make elevation change? like +2  (Show me how to add to script)

EDIT4: ok, i got all of the elevation, and stuff working, and now i need to change the position the tent is pointing, can anyone help?
« Last Edit: 14 Mar 2004, 05:11:03 by -=Anthrid=- »

DBR_ONIX

  • Guest
Re:Pitching tents + making it a respawn
« Reply #7 on: 16 Mar 2004, 18:49:06 »
Heres the updated bit you need to replace
Code: [Select]
_centerposx = getpos player select 0
_centerposy = getpos player select 1
_centerposz = getpos player select 0
with

Here's the new code
Code: [Select]
_centerposx = getpos player select 0
_wherex = getpos player select 1
_wherey = getpos player select 2
_dir = (direction _guy)

_centerposx = _where *cos _dir
_centerposy = _where *sin _dir

That should put the tent infront of the player
:)
- Ben

Anthrid

  • Guest
Re:Pitching tents + making it a respawn
« Reply #8 on: 17 Mar 2004, 04:12:33 »
Ok, either it didn't work because your code thingy was wrong, or I put it wrong (prolly me) I'll paste what code i put in and please help me  :)

Quote
player removeaction campactiong
_centerposx = getpos player select 0
_wherex = getpos player select 1
_wherey = getpos player select 2
_dir = (direction _guy)

_centerposx = _where *cos _dir
_centerposy = _where *sin _dir

tent1 = "CampEmpty" camcreate [_centerposx, _centerposy + 8, _centerposz + 1]
fire1 = "Fire" camcreate [_centerposx, _centerposy + 3, _centerposz + 0.1]

tent1 setdammage 1
~5
tent1 setdammage 0.5
~5
tent1 setdammage 0
~10
fire1 inflame true
HINT "Camps up!"

Please check for anything wrong

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Pitching tents + making it a respawn
« Reply #9 on: 17 Mar 2004, 04:28:51 »
I don't see _where defined anywhere e.g.:

_centerposx = _where *cos _dir
_centerposy = _where *sin _dir

Possibly they should be:

_centerposx = _wherex *cos _dir
_centerposy = _wherey *sin _dir


EDIT:  Regards this line:   dir = (direction _guy)
IS _guy defined anywhere, or is it the name of your soldier?




Planck
« Last Edit: 17 Mar 2004, 04:46:06 by Planck »
I know a little about a lot, and a lot about a little.

Anthrid

  • Guest
Re:Pitching tents + making it a respawn
« Reply #10 on: 17 Mar 2004, 07:13:22 »
I hope u asking ONIX, because i just need help with writing this script (i'm a scripting n00b  ;D ) Anyone please help me work this out :-)

DBR_ONIX

  • Guest
Re:Pitching tents + making it a respawn
« Reply #11 on: 18 Mar 2004, 18:47:10 »
Argh, stupid me! Sorry.. I copied pasted most of that from another script..
Code: [Select]
player removeaction campactiong
_centerposx = getpos player select 1
_centerposy = getpos player select 2
_dir = (direction player)

_centerposx = _where *cos _dir
_centerposy = _where *sin _dir

tent1 = "CampEmpty" camcreate [_centerposx, _centerposy + 8, _centerposz + 1]
fire1 = "Fire" camcreate [_centerposx, _centerposy, _centerposz]

tent1 setdammage 1
~5
tent1 setdammage 0.5
~5
tent1 setdammage 0
~10
fire1 inflame true
HINT "Camps up!"

That should be the corrected code

I'll make the mission tonight
- Ben

Anthrid

  • Guest
Re:Pitching tents + making it a respawn
« Reply #12 on: 19 Mar 2004, 08:03:03 »
 ;D  ;D   ;D   Well, it just moved East of where i'm standing....i guess someone should just try the script and work it before they post it, or this post will go on and on(and me starting OFP everytime, praying it works)  ;)  Oh, and you left out the position above ground that I edited so it won't be in the ground   ;).

Help  ???   :'(

DBR_ONIX

  • Guest
Re:Pitching tents + making it a respawn
« Reply #13 on: 19 Mar 2004, 23:30:41 »
"If you want something doing well, you gotta do it your-self" I guess comes to mind ::) :P
I'm sorry it didn't work, but I typed the code strait into this window/post bit..
I had no idea if it would work

I promise to get it working..
- Ben
BTW, the y pos shouldn't matter.. It should be at ground level

Anthrid

  • Guest
Re:Pitching tents + making it a respawn
« Reply #14 on: 20 Mar 2004, 02:49:13 »
No problem, I thank you for helping me out with this. Oh, and i gotta set up y position because the tent and fire are in the gorund  :P  Where did you learn how to script anyway?

DBR_ONIX

  • Guest
Re:Pitching tents + making it a respawn
« Reply #15 on: 20 Mar 2004, 12:22:21 »
Where I learned to script..
Hmm, good question :P
Basicly, download as many scripts as you can, open the up and read em..
There are some really good ones that have comments of what each line does etc

That is how I've learned things like PHP (Web basec scripting).. Also use the De-PBO untilites from www.ofp.info to open other people mission up and look at the scripts/mission.. Just don't copy any scripts etc strait out of the mission with out asking
You can learn a lot that way..

Tis a usefull thing to know ;)
- Ben